Home
Version 3
Domains (deprecated) API

Domains (deprecated) API

Create a Domain owned by the given Organization (deprecated)

POST /v2/domains

Request

Route

POST /v2/domains

Body

Name Description Default Valid Values Example Values
guid The guid of the domain.
name The name of the domain.
  • example.com
  • foo.example.com
wildcard Allow routes with non-empty hosts
  • true
  • false
owning_organization_guid The organization that owns the domain. If not specified, the domain is shared.
{
  "name": "exmaple.com",
  "wildcard": true,
  "owning_organization_guid": "07824a7c-cac6-4f28-8eb1-fe588801f5ee"
}

Headers

Authorization: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoidWFhLWlkLTQwNCIsImVtYWlsIjoiZW1haWwtMjk0QHNvbWVkb21haW4uY29tIiwic2NvcGUiOlsiY2xvdWRfY29udHJvbGxlci5hZG1pbiJdLCJhdWQiOlsiY2xvdWRfY29udHJvbGxlciJdLCJleHAiOjE0Mzk0MjYyMTZ9.7y0C5CboueGS0Ned6UlcuPY8Om6TH-U2hlNqFTrcPFE
Host: example.org
Content-Type: application/x-www-form-urlencoded
Cookie: 

cURL

curl "https://api.[your-domain.com]/v2/domains" -d '{
  "name": "exmaple.com",
  "wildcard": true,
  "owning_organization_guid": "07824a7c-cac6-4f28-8eb1-fe588801f5ee"
}' -X POST \
	-H "Authorization: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoidWFhLWlkLTQwNCIsImVtYWlsIjoiZW1haWwtMjk0QHNvbWVkb21haW4uY29tIiwic2NvcGUiOlsiY2xvdWRfY29udHJvbGxlci5hZG1pbiJdLCJhdWQiOlsiY2xvdWRfY29udHJvbGxlciJdLCJleHAiOjE0Mzk0MjYyMTZ9.7y0C5CboueGS0Ned6UlcuPY8Om6TH-U2hlNqFTrcPFE" \
	-H "Host: example.org" \
	-H "Content-Type: application/x-www-form-urlencoded" \
	-H "Cookie: "

Response

Status

201 Created

Body

{
  "metadata": {
    "guid": "f0084ab5-439e-4b37-ae21-8db376ffd772",
    "url": "/v2/domains/f0084ab5-439e-4b37-ae21-8db376ffd772",
    "created_at": "2015-08-06T00:36:56Z",
    "updated_at": null
  },
  "entity": {
    "name": "exmaple.com",
    "owning_organization_guid": "07824a7c-cac6-4f28-8eb1-fe588801f5ee",
    "shared_organizations": [

    ],
    "owning_organization_url": "/v2/organizations/07824a7c-cac6-4f28-8eb1-fe588801f5ee",
    "spaces_url": "/v2/domains/f0084ab5-439e-4b37-ae21-8db376ffd772/spaces"
  }
}

Headers

Content-Type: application/json;charset=utf-8
Location: /v2/domains/f0084ab5-439e-4b37-ae21-8db376ffd772
X-VCAP-Request-ID: a94fbfbe-48e1-4067-b09a-8bdba970f78a
X-Cf-Warnings: Endpoint+deprecated
Content-Length: 524
X-Content-Type-Options: nosniff