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

Response

Status

201 Created

Body

{
  "metadata": {
    "guid": "8d1ebb76-6808-4c6a-aa8c-e8d8e34400c0",
    "url": "/v2/shared_domains/8d1ebb76-6808-4c6a-aa8c-e8d8e34400c0",
    "created_at": "2015-06-04T00:05:10Z",
    "updated_at": null
  },
  "entity": {
    "name": "example.com"
  }
}

Headers

Content-Type: application/json;charset=utf-8
Location: /v2/shared_domains/8d1ebb76-6808-4c6a-aa8c-e8d8e34400c0
X-VCAP-Request-ID: 1d9347bb-ca22-4616-9dee-0107fdf988aa
Content-Length: 255
X-Content-Type-Options: nosniff