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.eyJ1c2VyX2lkIjoidWFhLWlkLTM3IiwiZW1haWwiOiJlbWFpbC0zMEBzb21lZG9tYWluLmNvbSIsInNjb3BlIjpbImNsb3VkX2NvbnRyb2xsZXIuYWRtaW4iXSwiYXVkIjpbImNsb3VkX2NvbnRyb2xsZXIiXSwiZXhwIjoxNDE3NDYyMzUxfQ.08SRjKcMUVLJOpA5_PabakisHotVG8x_WB6_8tllktQ
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.eyJ1c2VyX2lkIjoidWFhLWlkLTM3IiwiZW1haWwiOiJlbWFpbC0zMEBzb21lZG9tYWluLmNvbSIsInNjb3BlIjpbImNsb3VkX2NvbnRyb2xsZXIuYWRtaW4iXSwiYXVkIjpbImNsb3VkX2NvbnRyb2xsZXIiXSwiZXhwIjoxNDE3NDYyMzUxfQ.08SRjKcMUVLJOpA5_PabakisHotVG8x_WB6_8tllktQ" \
	-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/bc534dd6-8f07-4a57-a841-b7c7ddf6932a
X-VCAP-Request-ID: fec1c5fb-df55-48b2-9a73-8562da6afb09
X-Cf-Warnings: Endpoint+deprecated
Content-Length: 291
X-Content-Type-Options: nosniff

Status

201 Created

Body

{
  "metadata": {
    "guid": "bc534dd6-8f07-4a57-a841-b7c7ddf6932a",
    "url": "/v2/domains/bc534dd6-8f07-4a57-a841-b7c7ddf6932a",
    "created_at": "2014-11-24T19:32:31+00:00",
    "updated_at": null
  },
  "entity": {
    "name": "example.com",
    "owning_organization_guid": null
  }
}