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
name The name of the domain.
  • example.com
  • foo.example.com
router_group_guid The guid of the router group.
{
  "name": "example.com",
  "router_group_guid": "my-random-guid"
}

Headers

Authorization: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoidWFhLWlkLTI2MCIsImVtYWlsIjoiZW1haWwtMTYyQHNvbWVkb21haW4uY29tIiwic2NvcGUiOlsiY2xvdWRfY29udHJvbGxlci5hZG1pbiJdLCJhdWQiOlsiY2xvdWRfY29udHJvbGxlciJdLCJleHAiOjE0NjEzNzQ2MzN9.yKszYsN9W2RY9mq1lOJWwVtJqA0RKt5xGEh5oT8KlYI
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.eyJ1c2VyX2lkIjoidWFhLWlkLTI2MCIsImVtYWlsIjoiZW1haWwtMTYyQHNvbWVkb21haW4uY29tIiwic2NvcGUiOlsiY2xvdWRfY29udHJvbGxlci5hZG1pbiJdLCJhdWQiOlsiY2xvdWRfY29udHJvbGxlciJdLCJleHAiOjE0NjEzNzQ2MzN9.yKszYsN9W2RY9mq1lOJWwVtJqA0RKt5xGEh5oT8KlYI" \
	-H "Host: example.org" \
	-H "Content-Type: application/x-www-form-urlencoded" \
	-H "Cookie: "

Response

Status

201 Created

Body

{
  "metadata": {
    "guid": "9cdf535c-eb22-4802-86fe-16edb2860a11",
    "url": "/v2/shared_domains/9cdf535c-eb22-4802-86fe-16edb2860a11",
    "created_at": "2016-04-16T01:23:53Z",
    "updated_at": null
  },
  "entity": {
    "name": "example.com",
    "router_group_guid": "my-random-guid",
    "router_group_type": "tcp"
  }
}

Headers

Content-Type: application/json;charset=utf-8
Location: /v2/shared_domains/9cdf535c-eb22-4802-86fe-16edb2860a11
X-VCAP-Request-ID: e4bcef65-8d4a-4ca1-80b2-cabe92206956
Content-Length: 330
X-Content-Type-Options: nosniff