Home
Version 3
Domains (deprecated) API

Domains (deprecated) API

Create a Shared Domain (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": "example.com",
  "wildcard": true
}

Headers

Authorization: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoidWFhLWlkLTMzMCIsImVtYWlsIjoiZW1haWwtMjMyQHNvbWVkb21haW4uY29tIiwic2NvcGUiOlsiY2xvdWRfY29udHJvbGxlci5hZG1pbiJdLCJhdWQiOlsiY2xvdWRfY29udHJvbGxlciJdLCJleHAiOjE0NjE5NTg0MDh9.7pbwmgF2Y-etvuA61ukX6E6m3F7PAW_33Iu2tSb9ys8
Host: example.org
Content-Type: application/x-www-form-urlencoded
Cookie: 

cURL

curl "https://api.[your-domain.com]/v2/domains" -d '{
  "name": "example.com",
  "wildcard": true
}' -X POST \
	-H "Authorization: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoidWFhLWlkLTMzMCIsImVtYWlsIjoiZW1haWwtMjMyQHNvbWVkb21haW4uY29tIiwic2NvcGUiOlsiY2xvdWRfY29udHJvbGxlci5hZG1pbiJdLCJhdWQiOlsiY2xvdWRfY29udHJvbGxlciJdLCJleHAiOjE0NjE5NTg0MDh9.7pbwmgF2Y-etvuA61ukX6E6m3F7PAW_33Iu2tSb9ys8" \
	-H "Host: example.org" \
	-H "Content-Type: application/x-www-form-urlencoded" \
	-H "Cookie: "

Response

Status

201 Created

Body

{
  "metadata": {
    "guid": "6351eaaa-c26f-456e-a4b6-984ef789da2f",
    "url": "/v2/domains/6351eaaa-c26f-456e-a4b6-984ef789da2f",
    "created_at": "2016-04-22T19:33:28Z",
    "updated_at": null
  },
  "entity": {
    "name": "example.com",
    "owning_organization_guid": null,
    "shared_organizations": [

    ]
  }
}

Headers

Content-Type: application/json;charset=utf-8
Location: /v2/domains/6351eaaa-c26f-456e-a4b6-984ef789da2f
X-VCAP-Request-ID: 316f2370-8d18-4bdf-93e6-373c800ee7cd
X-Cf-Warnings: Endpoint+deprecated
Content-Length: 324
X-Content-Type-Options: nosniff