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.eyJ1c2VyX2lkIjoidWFhLWlkLTgiLCJlbWFpbCI6ImVtYWlsLThAc29tZWRvbWFpbi5jb20iLCJzY29wZSI6WyJjbG91ZF9jb250cm9sbGVyLmFkbWluIl0sImF1ZCI6WyJjbG91ZF9jb250cm9sbGVyIl0sImV4cCI6MTQxOTk4OTk2MX0.f9bOvdIuupy37KWT_wVgNE9-YNMmCysJpmfBbs92l74
Host: example.org
Content-Type: application/x-www-form-urlencoded
Cookie: 

Route

POST /v2/domains

Body

{
  "name": "exmaple.com",
  "wildcard": true,
  "owning_organization_guid": "4e12a791-32fc-4fb3-93e0-f50330ed494f"
}

cURL

curl "https://api.[your-domain.com]/v2/domains" -d '{
  "name": "exmaple.com",
  "wildcard": true,
  "owning_organization_guid": "4e12a791-32fc-4fb3-93e0-f50330ed494f"
}' -X POST \
	-H "Authorization: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoidWFhLWlkLTgiLCJlbWFpbCI6ImVtYWlsLThAc29tZWRvbWFpbi5jb20iLCJzY29wZSI6WyJjbG91ZF9jb250cm9sbGVyLmFkbWluIl0sImF1ZCI6WyJjbG91ZF9jb250cm9sbGVyIl0sImV4cCI6MTQxOTk4OTk2MX0.f9bOvdIuupy37KWT_wVgNE9-YNMmCysJpmfBbs92l74" \
	-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/fe3ff073-ad9d-4e8f-b23e-9de1371bae60
X-VCAP-Request-ID: 3d48f6bf-a852-4bb0-962c-759829004335
X-Cf-Warnings: Endpoint+deprecated
Content-Length: 491
X-Content-Type-Options: nosniff

Status

201 Created

Body

{
  "metadata": {
    "guid": "fe3ff073-ad9d-4e8f-b23e-9de1371bae60",
    "url": "/v2/domains/fe3ff073-ad9d-4e8f-b23e-9de1371bae60",
    "created_at": "2014-12-24T01:39:20+00:00",
    "updated_at": null
  },
  "entity": {
    "name": "exmaple.com",
    "owning_organization_guid": "4e12a791-32fc-4fb3-93e0-f50330ed494f",
    "owning_organization_url": "/v2/organizations/4e12a791-32fc-4fb3-93e0-f50330ed494f",
    "spaces_url": "/v2/domains/fe3ff073-ad9d-4e8f-b23e-9de1371bae60/spaces"
  }
}