Home
Version 3
Shared Domains API

Shared Domains API

Create a Shared Domain

POST /v2/shared_domains

Fields

Name Description Default Valid Values Example Values
guid The guid of the domain.
name The name of the domain.
  • example.com
  • foo.example.com

Request

Headers

Authorization: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoidWFhLWlkLTE0OCIsImVtYWlsIjoiZW1haWwtMTIxQHNvbWVkb21haW4uY29tIiwic2NvcGUiOlsiY2xvdWRfY29udHJvbGxlci5hZG1pbiJdLCJhdWQiOlsiY2xvdWRfY29udHJvbGxlciJdLCJleHAiOjE0MTc0NjIzNTl9.3CPCzM9aAMCl3s-5CpFD3Hq2pXJB1J97kB_gb8SgQfo
Host: example.org
Content-Type: application/x-www-form-urlencoded
Cookie: 

Route

POST /v2/shared_domains

Body

{
  "name": "example.com"
}

cURL

curl "https://api.[your-domain.com]/v2/shared_domains" -d '{
  "name": "example.com"
}' -X POST \
	-H "Authorization: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoidWFhLWlkLTE0OCIsImVtYWlsIjoiZW1haWwtMTIxQHNvbWVkb21haW4uY29tIiwic2NvcGUiOlsiY2xvdWRfY29udHJvbGxlci5hZG1pbiJdLCJhdWQiOlsiY2xvdWRfY29udHJvbGxlciJdLCJleHAiOjE0MTc0NjIzNTl9.3CPCzM9aAMCl3s-5CpFD3Hq2pXJB1J97kB_gb8SgQfo" \
	-H "Host: example.org" \
	-H "Content-Type: application/x-www-form-urlencoded" \
	-H "Cookie: "

Response

Headers

Content-Type: application/json;charset=utf-8
Location: /v2/shared_domains/db5a7290-e308-45b6-933d-a5d184ad5870
X-VCAP-Request-ID: 7811fa5d-a879-4493-8e23-5839168cba33
Content-Length: 260
X-Content-Type-Options: nosniff

Status

201 Created

Body

{
  "metadata": {
    "guid": "db5a7290-e308-45b6-933d-a5d184ad5870",
    "url": "/v2/shared_domains/db5a7290-e308-45b6-933d-a5d184ad5870",
    "created_at": "2014-11-24T19:32:39+00:00",
    "updated_at": null
  },
  "entity": {
    "name": "example.com"
  }
}