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.eyJ1c2VyX2lkIjoidWFhLWlkLTMyNiIsImVtYWlsIjoiZW1haWwtMjI5QHNvbWVkb21haW4uY29tIiwic2NvcGUiOlsiY2xvdWRfY29udHJvbGxlci5hZG1pbiJdLCJhdWQiOlsiY2xvdWRfY29udHJvbGxlciJdLCJleHAiOjE0MjQxMzczNzV9.7lDPTEY04itI2YG-DG6kgYxWBs0NUCD2xGMXrK4rmrs
Host: example.org
Content-Type: application/x-www-form-urlencoded
Cookie: 

Route

POST /v2/domains

Body

{
  "name": "exmaple.com",
  "wildcard": true,
  "owning_organization_guid": "2eb9db11-a4b3-4f8e-a864-9815a3085b09"
}

cURL

curl "https://api.[your-domain.com]/v2/domains" -d '{
  "name": "exmaple.com",
  "wildcard": true,
  "owning_organization_guid": "2eb9db11-a4b3-4f8e-a864-9815a3085b09"
}' -X POST \
	-H "Authorization: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoidWFhLWlkLTMyNiIsImVtYWlsIjoiZW1haWwtMjI5QHNvbWVkb21haW4uY29tIiwic2NvcGUiOlsiY2xvdWRfY29udHJvbGxlci5hZG1pbiJdLCJhdWQiOlsiY2xvdWRfY29udHJvbGxlciJdLCJleHAiOjE0MjQxMzczNzV9.7lDPTEY04itI2YG-DG6kgYxWBs0NUCD2xGMXrK4rmrs" \
	-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/23c71ce2-b4f6-4c46-85fa-1113e3f3b60e
X-VCAP-Request-ID: 1fe25309-3250-42ee-bf94-228117c5ba6b
X-Cf-Warnings: Endpoint+deprecated
Content-Length: 486
X-Content-Type-Options: nosniff

Status

201 Created

Body

{
  "metadata": {
    "guid": "23c71ce2-b4f6-4c46-85fa-1113e3f3b60e",
    "url": "/v2/domains/23c71ce2-b4f6-4c46-85fa-1113e3f3b60e",
    "created_at": "2015-02-10T01:42:55Z",
    "updated_at": null
  },
  "entity": {
    "name": "exmaple.com",
    "owning_organization_guid": "2eb9db11-a4b3-4f8e-a864-9815a3085b09",
    "owning_organization_url": "/v2/organizations/2eb9db11-a4b3-4f8e-a864-9815a3085b09",
    "spaces_url": "/v2/domains/23c71ce2-b4f6-4c46-85fa-1113e3f3b60e/spaces"
  }
}