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

Response

Status

201 Created

Body

{
  "metadata": {
    "guid": "d6c7d452-70bb-4edd-bbf1-a925dd51732c",
    "url": "/v2/shared_domains/d6c7d452-70bb-4edd-bbf1-a925dd51732c",
    "created_at": "2016-04-22T19:33:17Z",
    "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/d6c7d452-70bb-4edd-bbf1-a925dd51732c
X-VCAP-Request-ID: 393ac96a-1e7c-4c6e-8c14-0ab3eebb206e
Content-Length: 330
X-Content-Type-Options: nosniff