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.eyJ1c2VyX2lkIjoidWFhLWlkLTMzNyIsImVtYWlsIjoiZW1haWwtMjM5QHNvbWVkb21haW4uY29tIiwic2NvcGUiOlsiY2xvdWRfY29udHJvbGxlci5hZG1pbiJdLCJhdWQiOlsiY2xvdWRfY29udHJvbGxlciJdLCJleHAiOjE0MjQ0NzE3MDd9.E-Emadj5utD1MtfQOTVIBj1YSWM5g5weoJiPlcTFAzs
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.eyJ1c2VyX2lkIjoidWFhLWlkLTMzNyIsImVtYWlsIjoiZW1haWwtMjM5QHNvbWVkb21haW4uY29tIiwic2NvcGUiOlsiY2xvdWRfY29udHJvbGxlci5hZG1pbiJdLCJhdWQiOlsiY2xvdWRfY29udHJvbGxlciJdLCJleHAiOjE0MjQ0NzE3MDd9.E-Emadj5utD1MtfQOTVIBj1YSWM5g5weoJiPlcTFAzs" \
	-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/14c810ad-b023-40f6-8477-6c26e0400f63
X-VCAP-Request-ID: 234e1f86-3e87-4567-a1d4-f730b3d92fd9
Content-Length: 255
X-Content-Type-Options: nosniff

Status

201 Created

Body

{
  "metadata": {
    "guid": "14c810ad-b023-40f6-8477-6c26e0400f63",
    "url": "/v2/shared_domains/14c810ad-b023-40f6-8477-6c26e0400f63",
    "created_at": "2015-02-13T22:35:07Z",
    "updated_at": null
  },
  "entity": {
    "name": "example.com"
  }
}