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.eyJ1c2VyX2lkIjoidWFhLWlkLTU3IiwiZW1haWwiOiJlbWFpbC01MEBzb21lZG9tYWluLmNvbSIsInNjb3BlIjpbImNsb3VkX2NvbnRyb2xsZXIuYWRtaW4iXSwiYXVkIjpbImNsb3VkX2NvbnRyb2xsZXIiXSwiZXhwIjoxNDE2NTI2Njk4fQ.rrWUvmwQaF5lAiWwp0fHYiqkujskA9WqwXS5YBLuFd0
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.eyJ1c2VyX2lkIjoidWFhLWlkLTU3IiwiZW1haWwiOiJlbWFpbC01MEBzb21lZG9tYWluLmNvbSIsInNjb3BlIjpbImNsb3VkX2NvbnRyb2xsZXIuYWRtaW4iXSwiYXVkIjpbImNsb3VkX2NvbnRyb2xsZXIiXSwiZXhwIjoxNDE2NTI2Njk4fQ.rrWUvmwQaF5lAiWwp0fHYiqkujskA9WqwXS5YBLuFd0" \
	-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/4b89aa20-a1fc-43d2-b66b-21d53085bd58
X-VCAP-Request-ID: 3f3e8ef1-6f39-4396-be62-d58c8a41995c
Content-Length: 260
X-Content-Type-Options: nosniff

Status

201 Created

Body

{
  "metadata": {
    "guid": "4b89aa20-a1fc-43d2-b66b-21d53085bd58",
    "url": "/v2/shared_domains/4b89aa20-a1fc-43d2-b66b-21d53085bd58",
    "created_at": "2014-11-13T23:38:18+00:00",
    "updated_at": null
  },
  "entity": {
    "name": "example.com"
  }
}