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.eyJ1c2VyX2lkIjoidWFhLWlkLTEwOCIsImVtYWlsIjoiZW1haWwtNzhAc29tZWRvbWFpbi5jb20iLCJzY29wZSI6WyJjbG91ZF9jb250cm9sbGVyLmFkbWluIl0sImF1ZCI6WyJjbG91ZF9jb250cm9sbGVyIl0sImV4cCI6MTQyMjMyMzUzNn0.U52gm6eBh9kNRIpHZINRk-0k93zgT-76CtTAG5CobnY
Host: example.org
Content-Type: application/x-www-form-urlencoded
Cookie: 

Route

POST /v2/private_domains

Body

{
  "name": "exmaple.com",
  "owning_organization_guid": "37f1327a-26e3-4a0c-9043-b2b201b5ad56"
}

cURL

curl "https://api.[your-domain.com]/v2/private_domains" -d '{
  "name": "exmaple.com",
  "owning_organization_guid": "37f1327a-26e3-4a0c-9043-b2b201b5ad56"
}' -X POST \
	-H "Authorization: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoidWFhLWlkLTEwOCIsImVtYWlsIjoiZW1haWwtNzhAc29tZWRvbWFpbi5jb20iLCJzY29wZSI6WyJjbG91ZF9jb250cm9sbGVyLmFkbWluIl0sImF1ZCI6WyJjbG91ZF9jb250cm9sbGVyIl0sImV4cCI6MTQyMjMyMzUzNn0.U52gm6eBh9kNRIpHZINRk-0k93zgT-76CtTAG5CobnY" \
	-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/b950157c-b2fa-4ca5-87d6-3b14722af9b1
X-VCAP-Request-ID: 630e5965-b5fd-4f57-a95c-b17523bbb9c5
Content-Length: 422
X-Content-Type-Options: nosniff

Status

201 Created

Body

{
  "metadata": {
    "guid": "b950157c-b2fa-4ca5-87d6-3b14722af9b1",
    "url": "/v2/private_domains/b950157c-b2fa-4ca5-87d6-3b14722af9b1",
    "created_at": "2015-01-20T01:52:16+00:00",
    "updated_at": null
  },
  "entity": {
    "name": "exmaple.com",
    "owning_organization_guid": "37f1327a-26e3-4a0c-9043-b2b201b5ad56",
    "owning_organization_url": "/v2/organizations/37f1327a-26e3-4a0c-9043-b2b201b5ad56"
  }
}