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.eyJ1c2VyX2lkIjoidWFhLWlkLTI5NCIsImVtYWlsIjoiZW1haWwtMTk3QHNvbWVkb21haW4uY29tIiwic2NvcGUiOlsiY2xvdWRfY29udHJvbGxlci5hZG1pbiJdLCJhdWQiOlsiY2xvdWRfY29udHJvbGxlciJdLCJleHAiOjE0MjQxMzczNzN9.rRPT_fLpTRHGVlfIL9efWeehLCgjCSJ5Qj1LI9K7FyY
Host: example.org
Content-Type: application/x-www-form-urlencoded
Cookie: 

Route

POST /v2/private_domains

Body

{
  "name": "exmaple.com",
  "owning_organization_guid": "b222fd12-1b39-47e9-8b3f-0ee2a445e9ac"
}

cURL

curl "https://api.[your-domain.com]/v2/private_domains" -d '{
  "name": "exmaple.com",
  "owning_organization_guid": "b222fd12-1b39-47e9-8b3f-0ee2a445e9ac"
}' -X POST \
	-H "Authorization: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoidWFhLWlkLTI5NCIsImVtYWlsIjoiZW1haWwtMTk3QHNvbWVkb21haW4uY29tIiwic2NvcGUiOlsiY2xvdWRfY29udHJvbGxlci5hZG1pbiJdLCJhdWQiOlsiY2xvdWRfY29udHJvbGxlciJdLCJleHAiOjE0MjQxMzczNzN9.rRPT_fLpTRHGVlfIL9efWeehLCgjCSJ5Qj1LI9K7FyY" \
	-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/5ffc3648-2265-4358-9144-c0eb83c641db
X-VCAP-Request-ID: b62ee25b-7b33-43fe-8543-72cd415142aa
Content-Length: 417
X-Content-Type-Options: nosniff

Status

201 Created

Body

{
  "metadata": {
    "guid": "5ffc3648-2265-4358-9144-c0eb83c641db",
    "url": "/v2/private_domains/5ffc3648-2265-4358-9144-c0eb83c641db",
    "created_at": "2015-02-10T01:42:53Z",
    "updated_at": null
  },
  "entity": {
    "name": "exmaple.com",
    "owning_organization_guid": "b222fd12-1b39-47e9-8b3f-0ee2a445e9ac",
    "owning_organization_url": "/v2/organizations/b222fd12-1b39-47e9-8b3f-0ee2a445e9ac"
  }
}