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.
name The name of the domain.
  • example.com
  • foo.example.com
{
  "name": "example.com"
}

Headers

Authorization: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoidWFhLWlkLTI4NyIsImVtYWlsIjoiZW1haWwtMTg0QHNvbWVkb21haW4uY29tIiwic2NvcGUiOlsiY2xvdWRfY29udHJvbGxlci5hZG1pbiJdLCJhdWQiOlsiY2xvdWRfY29udHJvbGxlciJdLCJleHAiOjE0NDQyNjA2NDl9.hx7DtZtUT1Hnjcg90x_cbqk1qQ6IJZ8J775LuZYWms4
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"
}' -X POST \
	-H "Authorization: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoidWFhLWlkLTI4NyIsImVtYWlsIjoiZW1haWwtMTg0QHNvbWVkb21haW4uY29tIiwic2NvcGUiOlsiY2xvdWRfY29udHJvbGxlci5hZG1pbiJdLCJhdWQiOlsiY2xvdWRfY29udHJvbGxlciJdLCJleHAiOjE0NDQyNjA2NDl9.hx7DtZtUT1Hnjcg90x_cbqk1qQ6IJZ8J775LuZYWms4" \
	-H "Host: example.org" \
	-H "Content-Type: application/x-www-form-urlencoded" \
	-H "Cookie: "

Response

Status

201 Created

Body

{
  "metadata": {
    "guid": "7fa136f7-9215-4bb5-b4b1-d4b2d7ad1760",
    "url": "/v2/shared_domains/7fa136f7-9215-4bb5-b4b1-d4b2d7ad1760",
    "created_at": "2015-09-30T23:30:49Z",
    "updated_at": null
  },
  "entity": {
    "name": "example.com"
  }
}

Headers

Content-Type: application/json;charset=utf-8
Location: /v2/shared_domains/7fa136f7-9215-4bb5-b4b1-d4b2d7ad1760
X-VCAP-Request-ID: 3225786f-a391-4b34-8183-16936b4ec4ef
Content-Length: 255
X-Content-Type-Options: nosniff