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": "a7a404b1-96c3-4737-929d-f233cfcd1fea"
}

Headers

Authorization: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoidWFhLWlkLTEzIiwiZW1haWwiOiJlbWFpbC0xM0Bzb21lZG9tYWluLmNvbSIsInNjb3BlIjpbImNsb3VkX2NvbnRyb2xsZXIuYWRtaW4iXSwiYXVkIjpbImNsb3VkX2NvbnRyb2xsZXIiXSwiZXhwIjoxNDI2MTg3NzM1fQ.pW-_lgw0bPjrcXP5zlENTzlIDunaSW9zJyjvzDwKkeU
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": "a7a404b1-96c3-4737-929d-f233cfcd1fea"
}' -X POST \
	-H "Authorization: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoidWFhLWlkLTEzIiwiZW1haWwiOiJlbWFpbC0xM0Bzb21lZG9tYWluLmNvbSIsInNjb3BlIjpbImNsb3VkX2NvbnRyb2xsZXIuYWRtaW4iXSwiYXVkIjpbImNsb3VkX2NvbnRyb2xsZXIiXSwiZXhwIjoxNDI2MTg3NzM1fQ.pW-_lgw0bPjrcXP5zlENTzlIDunaSW9zJyjvzDwKkeU" \
	-H "Host: example.org" \
	-H "Content-Type: application/x-www-form-urlencoded" \
	-H "Cookie: "

Response

Status

201 Created

Body

{
  "metadata": {
    "guid": "25c6e793-f853-4b90-9033-3ec6ea334a04",
    "url": "/v2/private_domains/25c6e793-f853-4b90-9033-3ec6ea334a04",
    "created_at": "2015-03-05T19:15:34Z",
    "updated_at": null
  },
  "entity": {
    "name": "exmaple.com",
    "owning_organization_guid": "a7a404b1-96c3-4737-929d-f233cfcd1fea",
    "owning_organization_url": "/v2/organizations/a7a404b1-96c3-4737-929d-f233cfcd1fea",
    "shared_organizations_url": "/v2/private_domains/25c6e793-f853-4b90-9033-3ec6ea334a04/shared_organizations"
  }
}

Headers

Content-Type: application/json;charset=utf-8
Location: /v2/private_domains/25c6e793-f853-4b90-9033-3ec6ea334a04
X-VCAP-Request-ID: bac67def-c8d3-49dc-8255-cb6603d797fc
Content-Length: 530
X-Content-Type-Options: nosniff