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.eyJ1c2VyX2lkIjoidWFhLWlkLTI5IiwiZW1haWwiOiJlbWFpbC0yMkBzb21lZG9tYWluLmNvbSIsInNjb3BlIjpbImNsb3VkX2NvbnRyb2xsZXIuYWRtaW4iXSwiYXVkIjpbImNsb3VkX2NvbnRyb2xsZXIiXSwiZXhwIjoxNDE2NTI2Njk2fQ.viMgiJHyGctGP05tQbKytmrYMIounVc4WZ8U_1Fxf-E
Host: example.org
Content-Type: application/x-www-form-urlencoded
Cookie: 

Route

POST /v2/domains

Body

{
  "name": "exmaple.com",
  "wildcard": true,
  "owning_organization_guid": "6e8bf22b-a6e2-45c9-b954-99ca563dcc39"
}

cURL

curl "https://api.[your-domain.com]/v2/domains" -d '{
  "name": "exmaple.com",
  "wildcard": true,
  "owning_organization_guid": "6e8bf22b-a6e2-45c9-b954-99ca563dcc39"
}' -X POST \
	-H "Authorization: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoidWFhLWlkLTI5IiwiZW1haWwiOiJlbWFpbC0yMkBzb21lZG9tYWluLmNvbSIsInNjb3BlIjpbImNsb3VkX2NvbnRyb2xsZXIuYWRtaW4iXSwiYXVkIjpbImNsb3VkX2NvbnRyb2xsZXIiXSwiZXhwIjoxNDE2NTI2Njk2fQ.viMgiJHyGctGP05tQbKytmrYMIounVc4WZ8U_1Fxf-E" \
	-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/6a9d87a8-f704-48ca-a08a-940073a91801
X-VCAP-Request-ID: f30c83fd-9ba3-48bf-bda2-26eb09b41f40
X-Cf-Warnings: Endpoint+deprecated
Content-Length: 491
X-Content-Type-Options: nosniff

Status

201 Created

Body

{
  "metadata": {
    "guid": "6a9d87a8-f704-48ca-a08a-940073a91801",
    "url": "/v2/domains/6a9d87a8-f704-48ca-a08a-940073a91801",
    "created_at": "2014-11-13T23:38:16+00:00",
    "updated_at": null
  },
  "entity": {
    "name": "exmaple.com",
    "owning_organization_guid": "6e8bf22b-a6e2-45c9-b954-99ca563dcc39",
    "owning_organization_url": "/v2/organizations/6e8bf22b-a6e2-45c9-b954-99ca563dcc39",
    "spaces_url": "/v2/domains/6a9d87a8-f704-48ca-a08a-940073a91801/spaces"
  }
}