Home
Version 3
Domains (deprecated) API

Domains (deprecated) API

creates a shared domain (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.eyJ1c2VyX2lkIjoidWFhLWlkLTI4OCIsImVtYWlsIjoiZW1haWwtMjI4QHNvbWVkb21haW4uY29tIiwic2NvcGUiOlsiY2xvdWRfY29udHJvbGxlci5hZG1pbiJdLCJhdWQiOlsiY2xvdWRfY29udHJvbGxlciJdLCJleHAiOjE0MjQzMTAxMzl9._u1GBwF2sUp401yXNULVBwogW3jKIN1hKSB88_GZdaw
Host: example.org
Content-Type: application/x-www-form-urlencoded
Cookie: 

Route

POST /v2/domains

Body

{
  "name": "example.com",
  "wildcard": true
}

cURL

curl "https://api.[your-domain.com]/v2/domains" -d '{
  "name": "example.com",
  "wildcard": true
}' -X POST \
	-H "Authorization: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoidWFhLWlkLTI4OCIsImVtYWlsIjoiZW1haWwtMjI4QHNvbWVkb21haW4uY29tIiwic2NvcGUiOlsiY2xvdWRfY29udHJvbGxlci5hZG1pbiJdLCJhdWQiOlsiY2xvdWRfY29udHJvbGxlciJdLCJleHAiOjE0MjQzMTAxMzl9._u1GBwF2sUp401yXNULVBwogW3jKIN1hKSB88_GZdaw" \
	-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/f38f4a5f-8d77-4c54-a214-a27c3fae4ecc
X-VCAP-Request-ID: 9fc3ff3a-834f-4739-a9f0-c4f48bed9135
X-Cf-Warnings: Endpoint+deprecated
Content-Length: 286
X-Content-Type-Options: nosniff

Status

201 Created

Body

{
  "metadata": {
    "guid": "f38f4a5f-8d77-4c54-a214-a27c3fae4ecc",
    "url": "/v2/domains/f38f4a5f-8d77-4c54-a214-a27c3fae4ecc",
    "created_at": "2015-02-12T01:42:19Z",
    "updated_at": null
  },
  "entity": {
    "name": "example.com",
    "owning_organization_guid": null
  }
}