Home
Version 3
Domains (deprecated) API

Domains (deprecated) API

creates 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": "0988aafb-5cd5-4dd6-acad-f05796ffb151"
}

Headers

Authorization: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoidWFhLWlkLTExMiIsImVtYWlsIjoiZW1haWwtODNAc29tZWRvbWFpbi5jb20iLCJzY29wZSI6WyJjbG91ZF9jb250cm9sbGVyLmFkbWluIl0sImF1ZCI6WyJjbG91ZF9jb250cm9sbGVyIl0sImV4cCI6MTQyNjE4Nzc0Mn0.9B3vgv_QUPRDcpI1C5RC-rbjFmL_d7B9T9BKPZRUqx4
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": "0988aafb-5cd5-4dd6-acad-f05796ffb151"
}' -X POST \
	-H "Authorization: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoidWFhLWlkLTExMiIsImVtYWlsIjoiZW1haWwtODNAc29tZWRvbWFpbi5jb20iLCJzY29wZSI6WyJjbG91ZF9jb250cm9sbGVyLmFkbWluIl0sImF1ZCI6WyJjbG91ZF9jb250cm9sbGVyIl0sImV4cCI6MTQyNjE4Nzc0Mn0.9B3vgv_QUPRDcpI1C5RC-rbjFmL_d7B9T9BKPZRUqx4" \
	-H "Host: example.org" \
	-H "Content-Type: application/x-www-form-urlencoded" \
	-H "Cookie: "

Response

Status

201 Created

Body

{
  "metadata": {
    "guid": "3332d67c-f60d-4c3f-acd7-cc27400fce55",
    "url": "/v2/domains/3332d67c-f60d-4c3f-acd7-cc27400fce55",
    "created_at": "2015-03-05T19:15:42Z",
    "updated_at": null
  },
  "entity": {
    "name": "exmaple.com",
    "owning_organization_guid": "0988aafb-5cd5-4dd6-acad-f05796ffb151",
    "shared_organizations": [

    ],
    "owning_organization_url": "/v2/organizations/0988aafb-5cd5-4dd6-acad-f05796ffb151",
    "spaces_url": "/v2/domains/3332d67c-f60d-4c3f-acd7-cc27400fce55/spaces"
  }
}

Headers

Content-Type: application/json;charset=utf-8
Location: /v2/domains/3332d67c-f60d-4c3f-acd7-cc27400fce55
X-VCAP-Request-ID: 8b1f4de5-0638-4c4e-8909-9269100074cd
X-Cf-Warnings: Endpoint+deprecated
Content-Length: 524
X-Content-Type-Options: nosniff