Home
Version 3
Private Domains API

Private Domains API

Create a Private Domain owned by the given Organization

POST /v2/private_domains

Request

Route

POST /v2/private_domains

Body

Name Description Default Valid Values Example Values
name The name of the domain.
  • example.com
  • foo.example.com
owning_organization_guid The organization that owns the domain. If not specified, the domain is shared.
{
  "name": "exmaple.com",
  "owning_organization_guid": "c4ce4e4c-f40f-47a1-b3b4-5badb9e57f02"
}

Headers

Authorization: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoidWFhLWlkLTI3NCIsImVtYWlsIjoiZW1haWwtMjA1QHNvbWVkb21haW4uY29tIiwic2NvcGUiOlsiY2xvdWRfY29udHJvbGxlci5hZG1pbiJdLCJhdWQiOlsiY2xvdWRfY29udHJvbGxlciJdLCJleHAiOjE0NTY0NTIyMzl9.I5CAtzjq3gUq9NYK5nCTbEdHyn8YTdXzNaABXELeNhU
Host: example.org
Content-Type: application/x-www-form-urlencoded
Cookie: 

cURL

curl "https://api.[your-domain.com]/v2/private_domains" -d '{
  "name": "exmaple.com",
  "owning_organization_guid": "c4ce4e4c-f40f-47a1-b3b4-5badb9e57f02"
}' -X POST \
	-H "Authorization: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoidWFhLWlkLTI3NCIsImVtYWlsIjoiZW1haWwtMjA1QHNvbWVkb21haW4uY29tIiwic2NvcGUiOlsiY2xvdWRfY29udHJvbGxlci5hZG1pbiJdLCJhdWQiOlsiY2xvdWRfY29udHJvbGxlciJdLCJleHAiOjE0NTY0NTIyMzl9.I5CAtzjq3gUq9NYK5nCTbEdHyn8YTdXzNaABXELeNhU" \
	-H "Host: example.org" \
	-H "Content-Type: application/x-www-form-urlencoded" \
	-H "Cookie: "

Response

Status

201 Created

Body

{
  "metadata": {
    "guid": "e941cafb-33a6-4e25-a09e-deb8accf6fed",
    "url": "/v2/private_domains/e941cafb-33a6-4e25-a09e-deb8accf6fed",
    "created_at": "2016-02-19T02:03:59Z",
    "updated_at": null
  },
  "entity": {
    "name": "exmaple.com",
    "owning_organization_guid": "c4ce4e4c-f40f-47a1-b3b4-5badb9e57f02",
    "owning_organization_url": "/v2/organizations/c4ce4e4c-f40f-47a1-b3b4-5badb9e57f02",
    "shared_organizations_url": "/v2/private_domains/e941cafb-33a6-4e25-a09e-deb8accf6fed/shared_organizations"
  }
}

Headers

Content-Type: application/json;charset=utf-8
Location: /v2/private_domains/e941cafb-33a6-4e25-a09e-deb8accf6fed
X-VCAP-Request-ID: 
Content-Length: 530
X-Content-Type-Options: nosniff