Home
Version 3
Domains (deprecated) API

Domains (deprecated) API

Create a Domain owned by the given Organization (deprecated)

POST /v2/domains

Request

Route

POST /v2/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
wildcard Allow routes with non-empty hosts
  • true
  • false
owning_organization_guid The organization that owns the domain. If not specified, the domain is shared.
{
  "name": "exmaple.com",
  "wildcard": true,
  "owning_organization_guid": "a0ea6ec5-6cff-4338-917a-f0bcafd7b951"
}

Headers

Authorization: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoidWFhLWlkLTE3IiwiZW1haWwiOiJlbWFpbC0xN0Bzb21lZG9tYWluLmNvbSIsInNjb3BlIjpbImNsb3VkX2NvbnRyb2xsZXIuYWRtaW4iXSwiYXVkIjpbImNsb3VkX2NvbnRyb2xsZXIiXSwiZXhwIjoxNDYwNTA2NjM1fQ.1ZM-DspNmk797qXQvd4KCUymvmGw_3rBe2w8A8Q3imU
Host: example.org
Content-Type: application/x-www-form-urlencoded
Cookie: 

cURL

curl "https://api.[your-domain.com]/v2/domains" -d '{
  "name": "exmaple.com",
  "wildcard": true,
  "owning_organization_guid": "a0ea6ec5-6cff-4338-917a-f0bcafd7b951"
}' -X POST \
	-H "Authorization: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoidWFhLWlkLTE3IiwiZW1haWwiOiJlbWFpbC0xN0Bzb21lZG9tYWluLmNvbSIsInNjb3BlIjpbImNsb3VkX2NvbnRyb2xsZXIuYWRtaW4iXSwiYXVkIjpbImNsb3VkX2NvbnRyb2xsZXIiXSwiZXhwIjoxNDYwNTA2NjM1fQ.1ZM-DspNmk797qXQvd4KCUymvmGw_3rBe2w8A8Q3imU" \
	-H "Host: example.org" \
	-H "Content-Type: application/x-www-form-urlencoded" \
	-H "Cookie: "

Response

Status

201 Created

Body

{
  "metadata": {
    "guid": "796f585a-09aa-4910-9c29-763621558d02",
    "url": "/v2/domains/796f585a-09aa-4910-9c29-763621558d02",
    "created_at": "2016-04-06T00:17:15Z",
    "updated_at": null
  },
  "entity": {
    "name": "exmaple.com",
    "owning_organization_guid": "a0ea6ec5-6cff-4338-917a-f0bcafd7b951",
    "shared_organizations": [

    ],
    "owning_organization_url": "/v2/organizations/a0ea6ec5-6cff-4338-917a-f0bcafd7b951",
    "spaces_url": "/v2/domains/796f585a-09aa-4910-9c29-763621558d02/spaces"
  }
}

Headers

Content-Type: application/json;charset=utf-8
Location: /v2/domains/796f585a-09aa-4910-9c29-763621558d02
X-VCAP-Request-ID: 
X-Cf-Warnings: Endpoint+deprecated
Content-Length: 524
X-Content-Type-Options: nosniff