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

Response

Status

201 Created

Body

{
  "metadata": {
    "guid": "58b95784-d7e0-4e79-a957-85eb6a60deef",
    "url": "/v2/shared_domains/58b95784-d7e0-4e79-a957-85eb6a60deef",
    "created_at": "2015-08-06T00:36:49Z",
    "updated_at": null
  },
  "entity": {
    "name": "example.com"
  }
}

Headers

Content-Type: application/json;charset=utf-8
Location: /v2/shared_domains/58b95784-d7e0-4e79-a957-85eb6a60deef
X-VCAP-Request-ID: 66dae20a-b8eb-4f5e-b242-aa8113910e2b
Content-Length: 255
X-Content-Type-Options: nosniff