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": "9db6d8ec-2e37-4470-a2c8-c0b561f4d0ba"
}

Headers

Authorization: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoidWFhLWlkLTIxMSIsImVtYWlsIjoiZW1haWwtMTQ0QHNvbWVkb21haW4uY29tIiwic2NvcGUiOlsiY2xvdWRfY29udHJvbGxlci5hZG1pbiJdLCJhdWQiOlsiY2xvdWRfY29udHJvbGxlciJdLCJleHAiOjE0NDQ3ODI5MzV9.5fAcFMu10dnwblHB6ohwfenDEW7ZVGiZCmmdeQMJ-88
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": "9db6d8ec-2e37-4470-a2c8-c0b561f4d0ba"
}' -X POST \
	-H "Authorization: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoidWFhLWlkLTIxMSIsImVtYWlsIjoiZW1haWwtMTQ0QHNvbWVkb21haW4uY29tIiwic2NvcGUiOlsiY2xvdWRfY29udHJvbGxlci5hZG1pbiJdLCJhdWQiOlsiY2xvdWRfY29udHJvbGxlciJdLCJleHAiOjE0NDQ3ODI5MzV9.5fAcFMu10dnwblHB6ohwfenDEW7ZVGiZCmmdeQMJ-88" \
	-H "Host: example.org" \
	-H "Content-Type: application/x-www-form-urlencoded" \
	-H "Cookie: "

Response

Status

201 Created

Body

{
  "metadata": {
    "guid": "3d14eb72-c9c7-40d5-b8df-d1312b1d12f8",
    "url": "/v2/private_domains/3d14eb72-c9c7-40d5-b8df-d1312b1d12f8",
    "created_at": "2015-10-07T00:35:35Z",
    "updated_at": null
  },
  "entity": {
    "name": "exmaple.com",
    "owning_organization_guid": "9db6d8ec-2e37-4470-a2c8-c0b561f4d0ba",
    "owning_organization_url": "/v2/organizations/9db6d8ec-2e37-4470-a2c8-c0b561f4d0ba",
    "shared_organizations_url": "/v2/private_domains/3d14eb72-c9c7-40d5-b8df-d1312b1d12f8/shared_organizations"
  }
}

Headers

Content-Type: application/json;charset=utf-8
Location: /v2/private_domains/3d14eb72-c9c7-40d5-b8df-d1312b1d12f8
X-VCAP-Request-ID: 5121f25a-78b4-4da6-9a6c-64ce6431d59b
Content-Length: 530
X-Content-Type-Options: nosniff