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": "551a736d-ea7e-4c80-b2bc-c9b1e5b985bb"
}

Headers

Authorization: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoidWFhLWlkLTEyNSIsImVtYWlsIjoiZW1haWwtNzFAc29tZWRvbWFpbi5jb20iLCJzY29wZSI6WyJjbG91ZF9jb250cm9sbGVyLmFkbWluIl0sImF1ZCI6WyJjbG91ZF9jb250cm9sbGVyIl0sImV4cCI6MTQ0MTY2MjU5OH0.IlyrFC7UifiT47YNjMotHy6AP3bSpOI2N5Kb0DAUTyk
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": "551a736d-ea7e-4c80-b2bc-c9b1e5b985bb"
}' -X POST \
	-H "Authorization: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoidWFhLWlkLTEyNSIsImVtYWlsIjoiZW1haWwtNzFAc29tZWRvbWFpbi5jb20iLCJzY29wZSI6WyJjbG91ZF9jb250cm9sbGVyLmFkbWluIl0sImF1ZCI6WyJjbG91ZF9jb250cm9sbGVyIl0sImV4cCI6MTQ0MTY2MjU5OH0.IlyrFC7UifiT47YNjMotHy6AP3bSpOI2N5Kb0DAUTyk" \
	-H "Host: example.org" \
	-H "Content-Type: application/x-www-form-urlencoded" \
	-H "Cookie: "

Response

Status

201 Created

Body

{
  "metadata": {
    "guid": "25e6e635-3750-4f9c-b9dd-c62bb7ebdbb8",
    "url": "/v2/domains/25e6e635-3750-4f9c-b9dd-c62bb7ebdbb8",
    "created_at": "2015-08-31T21:49:58Z",
    "updated_at": null
  },
  "entity": {
    "name": "exmaple.com",
    "owning_organization_guid": "551a736d-ea7e-4c80-b2bc-c9b1e5b985bb",
    "shared_organizations": [

    ],
    "owning_organization_url": "/v2/organizations/551a736d-ea7e-4c80-b2bc-c9b1e5b985bb",
    "spaces_url": "/v2/domains/25e6e635-3750-4f9c-b9dd-c62bb7ebdbb8/spaces"
  }
}

Headers

Content-Type: application/json;charset=utf-8
Location: /v2/domains/25e6e635-3750-4f9c-b9dd-c62bb7ebdbb8
X-VCAP-Request-ID: 9ce4cee3-b0c2-4cc3-9e0f-55d1fb6aab4e
X-Cf-Warnings: Endpoint+deprecated
Content-Length: 524
X-Content-Type-Options: nosniff