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.eyJ1c2VyX2lkIjoidWFhLWlkLTMzNyIsImVtYWlsIjoiZW1haWwtMjU4QHNvbWVkb21haW4uY29tIiwic2NvcGUiOlsiY2xvdWRfY29udHJvbGxlci5hZG1pbiJdLCJhdWQiOlsiY2xvdWRfY29udHJvbGxlciJdLCJleHAiOjE0MjI5OTA4ODR9.3q7dx08jgveYy_MgV0Juy-_cJCWCKdi50d06CHIusxw
Host: example.org
Content-Type: application/x-www-form-urlencoded
Cookie: 

Route

POST /v2/domains

Body

{
  "name": "exmaple.com",
  "wildcard": true,
  "owning_organization_guid": "3b55e85f-4702-4669-8c39-c05d25a6ced0"
}

cURL

curl "https://api.[your-domain.com]/v2/domains" -d '{
  "name": "exmaple.com",
  "wildcard": true,
  "owning_organization_guid": "3b55e85f-4702-4669-8c39-c05d25a6ced0"
}' -X POST \
	-H "Authorization: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoidWFhLWlkLTMzNyIsImVtYWlsIjoiZW1haWwtMjU4QHNvbWVkb21haW4uY29tIiwic2NvcGUiOlsiY2xvdWRfY29udHJvbGxlci5hZG1pbiJdLCJhdWQiOlsiY2xvdWRfY29udHJvbGxlciJdLCJleHAiOjE0MjI5OTA4ODR9.3q7dx08jgveYy_MgV0Juy-_cJCWCKdi50d06CHIusxw" \
	-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/aeb1aaf3-218a-42d8-837f-23d2db49e69f
X-VCAP-Request-ID: 4959103c-f1ae-457f-a0ea-3f6b7df9f5c4
X-Cf-Warnings: Endpoint+deprecated
Content-Length: 486
X-Content-Type-Options: nosniff

Status

201 Created

Body

{
  "metadata": {
    "guid": "aeb1aaf3-218a-42d8-837f-23d2db49e69f",
    "url": "/v2/domains/aeb1aaf3-218a-42d8-837f-23d2db49e69f",
    "created_at": "2015-01-27T19:14:44Z",
    "updated_at": null
  },
  "entity": {
    "name": "exmaple.com",
    "owning_organization_guid": "3b55e85f-4702-4669-8c39-c05d25a6ced0",
    "owning_organization_url": "/v2/organizations/3b55e85f-4702-4669-8c39-c05d25a6ced0",
    "spaces_url": "/v2/domains/aeb1aaf3-218a-42d8-837f-23d2db49e69f/spaces"
  }
}