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.eyJ1c2VyX2lkIjoidWFhLWlkLTM1OSIsImVtYWlsIjoiZW1haWwtMjYxQHNvbWVkb21haW4uY29tIiwic2NvcGUiOlsiY2xvdWRfY29udHJvbGxlci5hZG1pbiJdLCJhdWQiOlsiY2xvdWRfY29udHJvbGxlciJdLCJleHAiOjE0NDUzNjIzMTd9.NoN4qbnIBiHyvrjKDxrtbZZNKDj5cseT02lfZUgU_CM
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.eyJ1c2VyX2lkIjoidWFhLWlkLTM1OSIsImVtYWlsIjoiZW1haWwtMjYxQHNvbWVkb21haW4uY29tIiwic2NvcGUiOlsiY2xvdWRfY29udHJvbGxlci5hZG1pbiJdLCJhdWQiOlsiY2xvdWRfY29udHJvbGxlciJdLCJleHAiOjE0NDUzNjIzMTd9.NoN4qbnIBiHyvrjKDxrtbZZNKDj5cseT02lfZUgU_CM" \
	-H "Host: example.org" \
	-H "Content-Type: application/x-www-form-urlencoded" \
	-H "Cookie: "

Response

Status

201 Created

Body

{
  "metadata": {
    "guid": "483f3e8d-b420-4d88-9d1b-7913207eeef2",
    "url": "/v2/shared_domains/483f3e8d-b420-4d88-9d1b-7913207eeef2",
    "created_at": "2015-10-13T17:31:57Z",
    "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/483f3e8d-b420-4d88-9d1b-7913207eeef2
X-VCAP-Request-ID: 79b72ed3-00c5-4df1-801d-b9e99166533d
Content-Length: 298
X-Content-Type-Options: nosniff