Home
Version 3
Private Domains API

Private Domains API

Create a Private Domain owned by the given Organization

POST /v2/private_domains

Fields

Name Description Default Valid Values Example Values
guid The guid of the domain.
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.

Request

Headers

Authorization: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoidWFhLWlkLTE2NCIsImVtYWlsIjoiZW1haWwtMTE2QHNvbWVkb21haW4uY29tIiwic2NvcGUiOlsiY2xvdWRfY29udHJvbGxlci5hZG1pbiJdLCJhdWQiOlsiY2xvdWRfY29udHJvbGxlciJdLCJleHAiOjE0MTk5ODk5NzB9._nMsFWz7EjqvZEJL_Mo8-JBhYVTewe2PRNzqlyFChVo
Host: example.org
Content-Type: application/x-www-form-urlencoded
Cookie: 

Route

POST /v2/private_domains

Body

{
  "name": "exmaple.com",
  "owning_organization_guid": "255379d0-90b2-40ad-85a1-40cbd9e84543"
}

cURL

curl "https://api.[your-domain.com]/v2/private_domains" -d '{
  "name": "exmaple.com",
  "owning_organization_guid": "255379d0-90b2-40ad-85a1-40cbd9e84543"
}' -X POST \
	-H "Authorization: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoidWFhLWlkLTE2NCIsImVtYWlsIjoiZW1haWwtMTE2QHNvbWVkb21haW4uY29tIiwic2NvcGUiOlsiY2xvdWRfY29udHJvbGxlci5hZG1pbiJdLCJhdWQiOlsiY2xvdWRfY29udHJvbGxlciJdLCJleHAiOjE0MTk5ODk5NzB9._nMsFWz7EjqvZEJL_Mo8-JBhYVTewe2PRNzqlyFChVo" \
	-H "Host: example.org" \
	-H "Content-Type: application/x-www-form-urlencoded" \
	-H "Cookie: "

Response

Headers

Content-Type: application/json;charset=utf-8
Location: /v2/private_domains/a70e186b-f5b5-4149-9213-b769f6f51c07
X-VCAP-Request-ID: 5ee45241-5e32-4f6a-803c-3fdbfc77a02b
Content-Length: 422
X-Content-Type-Options: nosniff

Status

201 Created

Body

{
  "metadata": {
    "guid": "a70e186b-f5b5-4149-9213-b769f6f51c07",
    "url": "/v2/private_domains/a70e186b-f5b5-4149-9213-b769f6f51c07",
    "created_at": "2014-12-24T01:39:30+00:00",
    "updated_at": null
  },
  "entity": {
    "name": "exmaple.com",
    "owning_organization_guid": "255379d0-90b2-40ad-85a1-40cbd9e84543",
    "owning_organization_url": "/v2/organizations/255379d0-90b2-40ad-85a1-40cbd9e84543"
  }
}