Home
Version 3
Domains (deprecated) API

Domains (deprecated) API

creates a domain owned by the given organization (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": "exmaple.com",
  "wildcard": true,
  "owning_organization_guid": "4839b027-1f19-4131-b4f5-f7b8933c4800"
}

Headers

Authorization: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoidWFhLWlkLTM4MCIsImVtYWlsIjoiZW1haWwtMjgyQHNvbWVkb21haW4uY29tIiwic2NvcGUiOlsiY2xvdWRfY29udHJvbGxlci5hZG1pbiJdLCJhdWQiOlsiY2xvdWRfY29udHJvbGxlciJdLCJleHAiOjE0MjU5NDg2Nzl9.SbTgyPpqhz584rvkNYogAmGZUpZi9HvO04DjjLGCzfk
Host: example.org
Content-Type: application/x-www-form-urlencoded
Cookie: 

cURL

curl "https://api.[your-domain.com]/v2/domains" -d '{
  "name": "exmaple.com",
  "wildcard": true,
  "owning_organization_guid": "4839b027-1f19-4131-b4f5-f7b8933c4800"
}' -X POST \
	-H "Authorization: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoidWFhLWlkLTM4MCIsImVtYWlsIjoiZW1haWwtMjgyQHNvbWVkb21haW4uY29tIiwic2NvcGUiOlsiY2xvdWRfY29udHJvbGxlci5hZG1pbiJdLCJhdWQiOlsiY2xvdWRfY29udHJvbGxlciJdLCJleHAiOjE0MjU5NDg2Nzl9.SbTgyPpqhz584rvkNYogAmGZUpZi9HvO04DjjLGCzfk" \
	-H "Host: example.org" \
	-H "Content-Type: application/x-www-form-urlencoded" \
	-H "Cookie: "

Response

Status

201 Created

Body

{
  "metadata": {
    "guid": "65ee3f30-9e9a-4241-9b51-7a7ffd707796",
    "url": "/v2/domains/65ee3f30-9e9a-4241-9b51-7a7ffd707796",
    "created_at": "2015-03-03T00:51:19Z",
    "updated_at": null
  },
  "entity": {
    "name": "exmaple.com",
    "owning_organization_guid": "4839b027-1f19-4131-b4f5-f7b8933c4800",
    "shared_organizations": [

    ],
    "owning_organization_url": "/v2/organizations/4839b027-1f19-4131-b4f5-f7b8933c4800",
    "spaces_url": "/v2/domains/65ee3f30-9e9a-4241-9b51-7a7ffd707796/spaces"
  }
}

Headers

Content-Type: application/json;charset=utf-8
Location: /v2/domains/65ee3f30-9e9a-4241-9b51-7a7ffd707796
X-VCAP-Request-ID: 8fe61896-93ab-44c7-bca8-3aabba13bb9f
X-Cf-Warnings: Endpoint+deprecated
Content-Length: 524
X-Content-Type-Options: nosniff