Home
Version 3
Domains (deprecated) API

Domains (deprecated) API

creates a shared domain (deprecated)

POST /v2/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
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.

Request

Headers

Authorization: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoidWFhLWlkLTI4IiwiZW1haWwiOiJlbWFpbC0yMUBzb21lZG9tYWluLmNvbSIsInNjb3BlIjpbImNsb3VkX2NvbnRyb2xsZXIuYWRtaW4iXSwiYXVkIjpbImNsb3VkX2NvbnRyb2xsZXIiXSwiZXhwIjoxNDE2NTI2Njk2fQ.k__f6GRT2_lIiyw3-DPqxAs8s-oPfvTC7WZj-vI-sGk
Host: example.org
Content-Type: application/x-www-form-urlencoded
Cookie: 

Route

POST /v2/domains

Body

{
  "name": "example.com",
  "wildcard": true
}

cURL

curl "https://api.[your-domain.com]/v2/domains" -d '{
  "name": "example.com",
  "wildcard": true
}' -X POST \
	-H "Authorization: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoidWFhLWlkLTI4IiwiZW1haWwiOiJlbWFpbC0yMUBzb21lZG9tYWluLmNvbSIsInNjb3BlIjpbImNsb3VkX2NvbnRyb2xsZXIuYWRtaW4iXSwiYXVkIjpbImNsb3VkX2NvbnRyb2xsZXIiXSwiZXhwIjoxNDE2NTI2Njk2fQ.k__f6GRT2_lIiyw3-DPqxAs8s-oPfvTC7WZj-vI-sGk" \
	-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/domains/cbf47a3c-9e31-494c-bc29-9cc81094b4db
X-VCAP-Request-ID: 9065621d-0c4d-4668-adc7-3ca19accddce
X-Cf-Warnings: Endpoint+deprecated
Content-Length: 291
X-Content-Type-Options: nosniff

Status

201 Created

Body

{
  "metadata": {
    "guid": "cbf47a3c-9e31-494c-bc29-9cc81094b4db",
    "url": "/v2/domains/cbf47a3c-9e31-494c-bc29-9cc81094b4db",
    "created_at": "2014-11-13T23:38:16+00:00",
    "updated_at": null
  },
  "entity": {
    "name": "example.com",
    "owning_organization_guid": null
  }
}