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": "83f6ff9e-2cd8-4dbc-a3da-124ec61510eb"
}

Headers

Authorization: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoidWFhLWlkLTI2NSIsImVtYWlsIjoiZW1haWwtMTg5QHNvbWVkb21haW4uY29tIiwic2NvcGUiOlsiY2xvdWRfY29udHJvbGxlci5hZG1pbiJdLCJhdWQiOlsiY2xvdWRfY29udHJvbGxlciJdLCJleHAiOjE0NjYwMDg4OTV9.YfotTDCwdT_Ke8QR6Jwv6HEbEknkm3_lYYU5r45m6z8
Host: example.org
Content-Type: application/json
Cookie: 

cURL

curl "https://api.[your-domain.com]/v2/domains" -d '{
  "name": "exmaple.com",
  "wildcard": true,
  "owning_organization_guid": "83f6ff9e-2cd8-4dbc-a3da-124ec61510eb"
}' -X POST \
	-H "Authorization: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoidWFhLWlkLTI2NSIsImVtYWlsIjoiZW1haWwtMTg5QHNvbWVkb21haW4uY29tIiwic2NvcGUiOlsiY2xvdWRfY29udHJvbGxlci5hZG1pbiJdLCJhdWQiOlsiY2xvdWRfY29udHJvbGxlciJdLCJleHAiOjE0NjYwMDg4OTV9.YfotTDCwdT_Ke8QR6Jwv6HEbEknkm3_lYYU5r45m6z8" \
	-H "Host: example.org" \
	-H "Content-Type: application/json" \
	-H "Cookie: "

Response

Status

201 Created

Body

{
  "metadata": {
    "guid": "d6b88020-bb62-404b-9b4e-0f673deb7bd1",
    "url": "/v2/private_domains/d6b88020-bb62-404b-9b4e-0f673deb7bd1",
    "created_at": "2016-06-08T16:41:35Z",
    "updated_at": "2016-06-08T16:41:26Z"
  },
  "entity": {
    "name": "exmaple.com",
    "owning_organization_guid": "83f6ff9e-2cd8-4dbc-a3da-124ec61510eb",
    "owning_organization_url": "/v2/organizations/83f6ff9e-2cd8-4dbc-a3da-124ec61510eb",
    "spaces_url": "/v2/domains/d6b88020-bb62-404b-9b4e-0f673deb7bd1/spaces"
  }
}

Headers

Content-Type: application/json;charset=utf-8
Location: /v2/domains/d6b88020-bb62-404b-9b4e-0f673deb7bd1
X-VCAP-Request-ID: 611872e6-e26d-43f5-906f-ad7d9276cae7
X-Cf-Warnings: Endpoint+deprecated
Content-Length: 494
X-Content-Type-Options: nosniff