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.eyJ1c2VyX2lkIjoidWFhLWlkLTEzOCIsImVtYWlsIjoiZW1haWwtMTAwQHNvbWVkb21haW4uY29tIiwic2NvcGUiOlsiY2xvdWRfY29udHJvbGxlci5hZG1pbiJdLCJhdWQiOlsiY2xvdWRfY29udHJvbGxlciJdLCJleHAiOjE0MjQ0NzE2OTF9.JO63xW3krxzy3R7_uHbXUraVr-7JA2FYK53fa2OZe9g
Host: example.org
Content-Type: application/x-www-form-urlencoded
Cookie: 

Route

POST /v2/domains

Body

{
  "name": "exmaple.com",
  "wildcard": true,
  "owning_organization_guid": "0cc675c0-c24b-494f-8ba6-6c2022f79c40"
}

cURL

curl "https://api.[your-domain.com]/v2/domains" -d '{
  "name": "exmaple.com",
  "wildcard": true,
  "owning_organization_guid": "0cc675c0-c24b-494f-8ba6-6c2022f79c40"
}' -X POST \
	-H "Authorization: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoidWFhLWlkLTEzOCIsImVtYWlsIjoiZW1haWwtMTAwQHNvbWVkb21haW4uY29tIiwic2NvcGUiOlsiY2xvdWRfY29udHJvbGxlci5hZG1pbiJdLCJhdWQiOlsiY2xvdWRfY29udHJvbGxlciJdLCJleHAiOjE0MjQ0NzE2OTF9.JO63xW3krxzy3R7_uHbXUraVr-7JA2FYK53fa2OZe9g" \
	-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/59c653e5-2ec1-44db-a7a4-031330f76f7e
X-VCAP-Request-ID: 921eb112-2139-4215-a568-9f784ba3d942
X-Cf-Warnings: Endpoint+deprecated
Content-Length: 486
X-Content-Type-Options: nosniff

Status

201 Created

Body

{
  "metadata": {
    "guid": "59c653e5-2ec1-44db-a7a4-031330f76f7e",
    "url": "/v2/domains/59c653e5-2ec1-44db-a7a4-031330f76f7e",
    "created_at": "2015-02-13T22:34:51Z",
    "updated_at": null
  },
  "entity": {
    "name": "exmaple.com",
    "owning_organization_guid": "0cc675c0-c24b-494f-8ba6-6c2022f79c40",
    "owning_organization_url": "/v2/organizations/0cc675c0-c24b-494f-8ba6-6c2022f79c40",
    "spaces_url": "/v2/domains/59c653e5-2ec1-44db-a7a4-031330f76f7e/spaces"
  }
}