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

Response

Status

201 Created

Body

{
  "metadata": {
    "guid": "eb305245-6375-430a-8ace-345c1e28d0ad",
    "url": "/v2/shared_domains/eb305245-6375-430a-8ace-345c1e28d0ad",
    "created_at": "2015-03-18T22:52:48Z",
    "updated_at": null
  },
  "entity": {
    "name": "example.com"
  }
}

Headers

Content-Type: application/json;charset=utf-8
Location: /v2/shared_domains/eb305245-6375-430a-8ace-345c1e28d0ad
X-VCAP-Request-ID: 404fc746-51e1-4820-8987-8d85062c56f8
Content-Length: 255
X-Content-Type-Options: nosniff