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": "60823521-61f7-44bd-abe1-32954300e8bd"
}

Headers

Authorization: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoidWFhLWlkLTE0OCIsImVtYWlsIjoiZW1haWwtODZAc29tZWRvbWFpbi5jb20iLCJzY29wZSI6WyJjbG91ZF9jb250cm9sbGVyLmFkbWluIl0sImF1ZCI6WyJjbG91ZF9jb250cm9sbGVyIl0sImV4cCI6MTQzMzk4MTEwNX0.RUYF9ZwaKgoFv4ZZ-Q4YC9p8qR2EmbK5opcNE8tZeVU
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": "60823521-61f7-44bd-abe1-32954300e8bd"
}' -X POST \
	-H "Authorization: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoidWFhLWlkLTE0OCIsImVtYWlsIjoiZW1haWwtODZAc29tZWRvbWFpbi5jb20iLCJzY29wZSI6WyJjbG91ZF9jb250cm9sbGVyLmFkbWluIl0sImF1ZCI6WyJjbG91ZF9jb250cm9sbGVyIl0sImV4cCI6MTQzMzk4MTEwNX0.RUYF9ZwaKgoFv4ZZ-Q4YC9p8qR2EmbK5opcNE8tZeVU" \
	-H "Host: example.org" \
	-H "Content-Type: application/x-www-form-urlencoded" \
	-H "Cookie: "

Response

Status

201 Created

Body

{
  "metadata": {
    "guid": "5293e19c-dda4-44e8-aee8-b526f930eee3",
    "url": "/v2/domains/5293e19c-dda4-44e8-aee8-b526f930eee3",
    "created_at": "2015-06-04T00:05:05Z",
    "updated_at": null
  },
  "entity": {
    "name": "exmaple.com",
    "owning_organization_guid": "60823521-61f7-44bd-abe1-32954300e8bd",
    "shared_organizations": [

    ],
    "owning_organization_url": "/v2/organizations/60823521-61f7-44bd-abe1-32954300e8bd",
    "spaces_url": "/v2/domains/5293e19c-dda4-44e8-aee8-b526f930eee3/spaces"
  }
}

Headers

Content-Type: application/json;charset=utf-8
Location: /v2/domains/5293e19c-dda4-44e8-aee8-b526f930eee3
X-VCAP-Request-ID: 31cb0183-a09e-4a8e-ac64-a8ea24edd9a3
X-Cf-Warnings: Endpoint+deprecated
Content-Length: 524
X-Content-Type-Options: nosniff