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": "09e0d56f-4e50-4bff-af83-9bd87a7d7f00"
}

Headers

Authorization: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoidWFhLWlkLTM5MiIsImVtYWlsIjoiZW1haWwtMjgyQHNvbWVkb21haW4uY29tIiwic2NvcGUiOlsiY2xvdWRfY29udHJvbGxlci5hZG1pbiJdLCJhdWQiOlsiY2xvdWRfY29udHJvbGxlciJdLCJleHAiOjE0Mzg2NDE4MTN9.RVP2zDhTvtePX8ZlBmotx9qoJtSegn0PXdbdglUQvn4
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": "09e0d56f-4e50-4bff-af83-9bd87a7d7f00"
}' -X POST \
	-H "Authorization: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoidWFhLWlkLTM5MiIsImVtYWlsIjoiZW1haWwtMjgyQHNvbWVkb21haW4uY29tIiwic2NvcGUiOlsiY2xvdWRfY29udHJvbGxlci5hZG1pbiJdLCJhdWQiOlsiY2xvdWRfY29udHJvbGxlciJdLCJleHAiOjE0Mzg2NDE4MTN9.RVP2zDhTvtePX8ZlBmotx9qoJtSegn0PXdbdglUQvn4" \
	-H "Host: example.org" \
	-H "Content-Type: application/x-www-form-urlencoded" \
	-H "Cookie: "

Response

Status

201 Created

Body

{
  "metadata": {
    "guid": "abb8338f-eaea-4149-85c0-61888bac0737",
    "url": "/v2/domains/abb8338f-eaea-4149-85c0-61888bac0737",
    "created_at": "2015-07-27T22:43:33Z",
    "updated_at": null
  },
  "entity": {
    "name": "exmaple.com",
    "owning_organization_guid": "09e0d56f-4e50-4bff-af83-9bd87a7d7f00",
    "shared_organizations": [

    ],
    "owning_organization_url": "/v2/organizations/09e0d56f-4e50-4bff-af83-9bd87a7d7f00",
    "spaces_url": "/v2/domains/abb8338f-eaea-4149-85c0-61888bac0737/spaces"
  }
}

Headers

Content-Type: application/json;charset=utf-8
Location: /v2/domains/abb8338f-eaea-4149-85c0-61888bac0737
X-VCAP-Request-ID: 66c8101c-6746-4bbd-9491-89038670ec8a
X-Cf-Warnings: Endpoint+deprecated
Content-Length: 524
X-Content-Type-Options: nosniff