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.eyJ1c2VyX2lkIjoidWFhLWlkLTExMiIsImVtYWlsIjoiZW1haWwtODJAc29tZWRvbWFpbi5jb20iLCJzY29wZSI6WyJjbG91ZF9jb250cm9sbGVyLmFkbWluIl0sImF1ZCI6WyJjbG91ZF9jb250cm9sbGVyIl0sImV4cCI6MTQyMjk5MDg3MX0.mpAqVOeZfwZX4KQTkQzQkc3iUJ5nQuBL7jZd0hfkwpE
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.eyJ1c2VyX2lkIjoidWFhLWlkLTExMiIsImVtYWlsIjoiZW1haWwtODJAc29tZWRvbWFpbi5jb20iLCJzY29wZSI6WyJjbG91ZF9jb250cm9sbGVyLmFkbWluIl0sImF1ZCI6WyJjbG91ZF9jb250cm9sbGVyIl0sImV4cCI6MTQyMjk5MDg3MX0.mpAqVOeZfwZX4KQTkQzQkc3iUJ5nQuBL7jZd0hfkwpE" \
	-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/9a4fcf12-712b-43d9-884a-8711a3ed8404
X-VCAP-Request-ID: cb7128b7-8ad4-40f3-95b0-8ca17f856dbb
Content-Length: 255
X-Content-Type-Options: nosniff

Status

201 Created

Body

{
  "metadata": {
    "guid": "9a4fcf12-712b-43d9-884a-8711a3ed8404",
    "url": "/v2/shared_domains/9a4fcf12-712b-43d9-884a-8711a3ed8404",
    "created_at": "2015-01-27T19:14:31Z",
    "updated_at": null
  },
  "entity": {
    "name": "example.com"
  }
}