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
name The name of the domain.
  • example.com
  • foo.example.com
internal Flag that sets the domain as an internal domain. Internal domains are used for internal app to app networking only. false
  • true
  • false
router_group_guid The guid of the router group. Not used with internal domains.
{
  "name": "example.com",
  "router_group_guid": "my-random-guid"
}

Headers

Authorization: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoidWFhLWlkLTMyMiIsImVtYWlsIjoiZW1haWwtMjE3QHNvbWVkb21haW4uY29tIiwic2NvcGUiOlsiY2xvdWRfY29udHJvbGxlci5hZG1pbiJdLCJhdWQiOlsiY2xvdWRfY29udHJvbGxlciJdLCJleHAiOjE0NjYwMDg4OTd9.D722Jh8vyqN7FX-Cz5ySht2wlRci3-UJ_4S5HIL1BSY
Host: example.org
Content-Type: application/json
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.eyJ1c2VyX2lkIjoidWFhLWlkLTMyMiIsImVtYWlsIjoiZW1haWwtMjE3QHNvbWVkb21haW4uY29tIiwic2NvcGUiOlsiY2xvdWRfY29udHJvbGxlci5hZG1pbiJdLCJhdWQiOlsiY2xvdWRfY29udHJvbGxlciJdLCJleHAiOjE0NjYwMDg4OTd9.D722Jh8vyqN7FX-Cz5ySht2wlRci3-UJ_4S5HIL1BSY" \
	-H "Host: example.org" \
	-H "Content-Type: application/json" \
	-H "Cookie: "

Response

Status

201 Created

Body

{
  "metadata": {
    "guid": "43436c2d-2b4f-45c2-9f50-e530e1cedba6",
    "url": "/v2/shared_domains/43436c2d-2b4f-45c2-9f50-e530e1cedba6",
    "created_at": "2016-06-08T16:41:37Z",
    "updated_at": "2016-06-08T16:41:26Z"
  },
  "entity": {
    "name": "example.com",
    "internal": false,
    "router_group_guid": "my-random-guid",
    "router_group_type": "tcp"
  }
}

Headers

Content-Type: application/json;charset=utf-8
Location: /v2/shared_domains/43436c2d-2b4f-45c2-9f50-e530e1cedba6
X-VCAP-Request-ID: eb7ceb98-ff19-454e-9f09-892de28f74e1
Content-Length: 330
X-Content-Type-Options: nosniff