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.eyJ1c2VyX2lkIjoidWFhLWlkLTExMiIsImVtYWlsIjoiZW1haWwtODNAc29tZWRvbWFpbi5jb20iLCJzY29wZSI6WyJjbG91ZF9jb250cm9sbGVyLmFkbWluIl0sImF1ZCI6WyJjbG91ZF9jb250cm9sbGVyIl0sImV4cCI6MTQyNDMxMDEyNX0.arSu94-Os8kS22VWkuwze-U6CMBwTeQPLgLML19PN5w
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.eyJ1c2VyX2lkIjoidWFhLWlkLTExMiIsImVtYWlsIjoiZW1haWwtODNAc29tZWRvbWFpbi5jb20iLCJzY29wZSI6WyJjbG91ZF9jb250cm9sbGVyLmFkbWluIl0sImF1ZCI6WyJjbG91ZF9jb250cm9sbGVyIl0sImV4cCI6MTQyNDMxMDEyNX0.arSu94-Os8kS22VWkuwze-U6CMBwTeQPLgLML19PN5w" \
	-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/ced31c8a-c834-493e-a35e-09849adfe7d0
X-VCAP-Request-ID: 0cf9d101-d185-456a-8927-51f1f4abe298
Content-Length: 255
X-Content-Type-Options: nosniff

Status

201 Created

Body

{
  "metadata": {
    "guid": "ced31c8a-c834-493e-a35e-09849adfe7d0",
    "url": "/v2/shared_domains/ced31c8a-c834-493e-a35e-09849adfe7d0",
    "created_at": "2015-02-12T01:42:05Z",
    "updated_at": null
  },
  "entity": {
    "name": "example.com"
  }
}