Home
Version 3
Domains (deprecated) API

Domains (deprecated) API

creates a domain owned by the given organization (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.eyJ1c2VyX2lkIjoidWFhLWlkLTI0MCIsImVtYWlsIjoiZW1haWwtMTgwQHNvbWVkb21haW4uY29tIiwic2NvcGUiOlsiY2xvdWRfY29udHJvbGxlci5hZG1pbiJdLCJhdWQiOlsiY2xvdWRfY29udHJvbGxlciJdLCJleHAiOjE0MjIzMjM1NDh9.ccbNWh2q32j4i160AFtGeJwRYw_0cSw-AI1DRM8yELI
Host: example.org
Content-Type: application/x-www-form-urlencoded
Cookie: 

Route

POST /v2/domains

Body

{
  "name": "exmaple.com",
  "wildcard": true,
  "owning_organization_guid": "1581c71c-a4bc-4599-ab32-b7b041577e34"
}

cURL

curl "https://api.[your-domain.com]/v2/domains" -d '{
  "name": "exmaple.com",
  "wildcard": true,
  "owning_organization_guid": "1581c71c-a4bc-4599-ab32-b7b041577e34"
}' -X POST \
	-H "Authorization: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoidWFhLWlkLTI0MCIsImVtYWlsIjoiZW1haWwtMTgwQHNvbWVkb21haW4uY29tIiwic2NvcGUiOlsiY2xvdWRfY29udHJvbGxlci5hZG1pbiJdLCJhdWQiOlsiY2xvdWRfY29udHJvbGxlciJdLCJleHAiOjE0MjIzMjM1NDh9.ccbNWh2q32j4i160AFtGeJwRYw_0cSw-AI1DRM8yELI" \
	-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/27c0c388-ec46-46dc-b132-4e8481326fdd
X-VCAP-Request-ID: 0e9c89d1-4ae6-4c43-a133-906a3a6a4e2d
X-Cf-Warnings: Endpoint+deprecated
Content-Length: 491
X-Content-Type-Options: nosniff

Status

201 Created

Body

{
  "metadata": {
    "guid": "27c0c388-ec46-46dc-b132-4e8481326fdd",
    "url": "/v2/domains/27c0c388-ec46-46dc-b132-4e8481326fdd",
    "created_at": "2015-01-20T01:52:28+00:00",
    "updated_at": null
  },
  "entity": {
    "name": "exmaple.com",
    "owning_organization_guid": "1581c71c-a4bc-4599-ab32-b7b041577e34",
    "owning_organization_url": "/v2/organizations/1581c71c-a4bc-4599-ab32-b7b041577e34",
    "spaces_url": "/v2/domains/27c0c388-ec46-46dc-b132-4e8481326fdd/spaces"
  }
}