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": "a97a3198-a097-445c-8d98-8872f689a1f1"
}

Headers

Authorization: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoidWFhLWlkLTM5NSIsImVtYWlsIjoiZW1haWwtMjkxQHNvbWVkb21haW4uY29tIiwic2NvcGUiOlsiY2xvdWRfY29udHJvbGxlci5hZG1pbiJdLCJhdWQiOlsiY2xvdWRfY29udHJvbGxlciJdLCJleHAiOjE0MzM5ODExMjJ9.oExRHVXD_ZGNxca8TG2dMmNp2UkAMYkXPrVs5Dom36E
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": "a97a3198-a097-445c-8d98-8872f689a1f1"
}' -X POST \
	-H "Authorization: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoidWFhLWlkLTM5NSIsImVtYWlsIjoiZW1haWwtMjkxQHNvbWVkb21haW4uY29tIiwic2NvcGUiOlsiY2xvdWRfY29udHJvbGxlci5hZG1pbiJdLCJhdWQiOlsiY2xvdWRfY29udHJvbGxlciJdLCJleHAiOjE0MzM5ODExMjJ9.oExRHVXD_ZGNxca8TG2dMmNp2UkAMYkXPrVs5Dom36E" \
	-H "Host: example.org" \
	-H "Content-Type: application/x-www-form-urlencoded" \
	-H "Cookie: "

Response

Status

201 Created

Body

{
  "metadata": {
    "guid": "8113502b-06c4-4c9e-8ec5-7e6ac76ed371",
    "url": "/v2/private_domains/8113502b-06c4-4c9e-8ec5-7e6ac76ed371",
    "created_at": "2015-06-04T00:05:22Z",
    "updated_at": null
  },
  "entity": {
    "name": "exmaple.com",
    "owning_organization_guid": "a97a3198-a097-445c-8d98-8872f689a1f1",
    "owning_organization_url": "/v2/organizations/a97a3198-a097-445c-8d98-8872f689a1f1",
    "shared_organizations_url": "/v2/private_domains/8113502b-06c4-4c9e-8ec5-7e6ac76ed371/shared_organizations"
  }
}

Headers

Content-Type: application/json;charset=utf-8
Location: /v2/private_domains/8113502b-06c4-4c9e-8ec5-7e6ac76ed371
X-VCAP-Request-ID: 21ba1c53-bace-4aaf-9fce-e42a686edcb3
Content-Length: 530
X-Content-Type-Options: nosniff