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

Response

Status

201 Created

Body

{
  "metadata": {
    "guid": "5442fe9c-2c3e-4aae-b957-0b98576dd4d2",
    "url": "/v2/shared_domains/5442fe9c-2c3e-4aae-b957-0b98576dd4d2",
    "created_at": "2015-10-07T00:35:48Z",
    "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/5442fe9c-2c3e-4aae-b957-0b98576dd4d2
X-VCAP-Request-ID: f84fc364-77a7-4402-837d-e4e39b76c967
Content-Length: 298
X-Content-Type-Options: nosniff