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": "c5240334-383a-498d-91b4-938ef06dda6c"
}

Headers

Authorization: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoidWFhLWlkLTIzMiIsImVtYWlsIjoiZW1haWwtMTYzQHNvbWVkb21haW4uY29tIiwic2NvcGUiOlsiY2xvdWRfY29udHJvbGxlci5hZG1pbiJdLCJhdWQiOlsiY2xvdWRfY29udHJvbGxlciJdLCJleHAiOjE0MjkwMzg3MDd9.tZvzPARXGSFSQZnZ4Xw1KL6DFLl1kCjedE6C2pOfDiA
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": "c5240334-383a-498d-91b4-938ef06dda6c"
}' -X POST \
	-H "Authorization: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoidWFhLWlkLTIzMiIsImVtYWlsIjoiZW1haWwtMTYzQHNvbWVkb21haW4uY29tIiwic2NvcGUiOlsiY2xvdWRfY29udHJvbGxlci5hZG1pbiJdLCJhdWQiOlsiY2xvdWRfY29udHJvbGxlciJdLCJleHAiOjE0MjkwMzg3MDd9.tZvzPARXGSFSQZnZ4Xw1KL6DFLl1kCjedE6C2pOfDiA" \
	-H "Host: example.org" \
	-H "Content-Type: application/x-www-form-urlencoded" \
	-H "Cookie: "

Response

Status

201 Created

Body

{
  "metadata": {
    "guid": "77074f06-82eb-4349-b7ad-df320a1e265e",
    "url": "/v2/domains/77074f06-82eb-4349-b7ad-df320a1e265e",
    "created_at": "2015-04-07T19:11:47Z",
    "updated_at": null
  },
  "entity": {
    "name": "exmaple.com",
    "owning_organization_guid": "c5240334-383a-498d-91b4-938ef06dda6c",
    "shared_organizations": [

    ],
    "owning_organization_url": "/v2/organizations/c5240334-383a-498d-91b4-938ef06dda6c",
    "spaces_url": "/v2/domains/77074f06-82eb-4349-b7ad-df320a1e265e/spaces"
  }
}

Headers

Content-Type: application/json;charset=utf-8
Location: /v2/domains/77074f06-82eb-4349-b7ad-df320a1e265e
X-VCAP-Request-ID: 1b1f4af9-342d-4bbf-ba2d-5f65eb7b849b
X-Cf-Warnings: Endpoint+deprecated
Content-Length: 524
X-Content-Type-Options: nosniff