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": "ae8057d9-77b1-4c4a-be0c-15ff7986ccc6"
}

Headers

Authorization: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoidWFhLWlkLTIwMiIsImVtYWlsIjoiZW1haWwtMTM1QHNvbWVkb21haW4uY29tIiwic2NvcGUiOlsiY2xvdWRfY29udHJvbGxlci5hZG1pbiJdLCJhdWQiOlsiY2xvdWRfY29udHJvbGxlciJdLCJleHAiOjE0NDQ3ODI5MzR9.CS8NBtsz_gCfwtfGFdtrbUCgQUOQD55_pV7Kwb9l45E
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": "ae8057d9-77b1-4c4a-be0c-15ff7986ccc6"
}' -X POST \
	-H "Authorization: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoidWFhLWlkLTIwMiIsImVtYWlsIjoiZW1haWwtMTM1QHNvbWVkb21haW4uY29tIiwic2NvcGUiOlsiY2xvdWRfY29udHJvbGxlci5hZG1pbiJdLCJhdWQiOlsiY2xvdWRfY29udHJvbGxlciJdLCJleHAiOjE0NDQ3ODI5MzR9.CS8NBtsz_gCfwtfGFdtrbUCgQUOQD55_pV7Kwb9l45E" \
	-H "Host: example.org" \
	-H "Content-Type: application/x-www-form-urlencoded" \
	-H "Cookie: "

Response

Status

201 Created

Body

{
  "metadata": {
    "guid": "cc678b4f-7978-41be-b967-665431239941",
    "url": "/v2/domains/cc678b4f-7978-41be-b967-665431239941",
    "created_at": "2015-10-07T00:35:34Z",
    "updated_at": null
  },
  "entity": {
    "name": "exmaple.com",
    "owning_organization_guid": "ae8057d9-77b1-4c4a-be0c-15ff7986ccc6",
    "shared_organizations": [

    ],
    "owning_organization_url": "/v2/organizations/ae8057d9-77b1-4c4a-be0c-15ff7986ccc6",
    "spaces_url": "/v2/domains/cc678b4f-7978-41be-b967-665431239941/spaces"
  }
}

Headers

Content-Type: application/json;charset=utf-8
Location: /v2/domains/cc678b4f-7978-41be-b967-665431239941
X-VCAP-Request-ID: f3646c24-6be5-46dd-a8f4-043ae839e653
X-Cf-Warnings: Endpoint+deprecated
Content-Length: 524
X-Content-Type-Options: nosniff