Home
Version 3
Shared Domains API

Shared Domains API

Create a Shared Domain

POST /v2/shared_domains

Request

Route

POST /v2/shared_domains

Body

Name Description Default Valid Values Example Values
guid The guid of the domain.
router_group_guid The guid of the router group.
name The name of the domain.
  • example.com
  • foo.example.com
{
  "name": "example.com",
  "router_group_guid": "my-random-guid"
}

Headers

Authorization: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoidWFhLWlkLTQxNSIsImVtYWlsIjoiZW1haWwtMzExQHNvbWVkb21haW4uY29tIiwic2NvcGUiOlsiY2xvdWRfY29udHJvbGxlci5hZG1pbiJdLCJhdWQiOlsiY2xvdWRfY29udHJvbGxlciJdLCJleHAiOjE0NDcxMTY4NTh9.04XNUWHK5tcOrt4IisRVSA97qSjNTF6rla_WxCX-nwc
Host: example.org
Content-Type: application/x-www-form-urlencoded
Cookie: 

cURL

curl "https://api.[your-domain.com]/v2/shared_domains" -d '{
  "name": "example.com",
  "router_group_guid": "my-random-guid"
}' -X POST \
	-H "Authorization: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoidWFhLWlkLTQxNSIsImVtYWlsIjoiZW1haWwtMzExQHNvbWVkb21haW4uY29tIiwic2NvcGUiOlsiY2xvdWRfY29udHJvbGxlci5hZG1pbiJdLCJhdWQiOlsiY2xvdWRfY29udHJvbGxlciJdLCJleHAiOjE0NDcxMTY4NTh9.04XNUWHK5tcOrt4IisRVSA97qSjNTF6rla_WxCX-nwc" \
	-H "Host: example.org" \
	-H "Content-Type: application/x-www-form-urlencoded" \
	-H "Cookie: "

Response

Status

201 Created

Body

{
  "metadata": {
    "guid": "94c9c568-de60-4ea5-a791-d1ef6ef9926b",
    "url": "/v2/shared_domains/94c9c568-de60-4ea5-a791-d1ef6ef9926b",
    "created_at": "2015-11-03T00:54:17Z",
    "updated_at": null
  },
  "entity": {
    "name": "example.com",
    "router_group_guid": "my-random-guid"
  }
}

Headers

Content-Type: application/json;charset=utf-8
Location: /v2/shared_domains/94c9c568-de60-4ea5-a791-d1ef6ef9926b
X-VCAP-Request-ID: 7b07d029-3433-4b0b-a59e-7d30cea2ed44
Content-Length: 298
X-Content-Type-Options: nosniff