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": "fc754fd2-fbeb-42b7-b75c-178f38855a31"
}

Headers

Authorization: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoidWFhLWlkLTMxMiIsImVtYWlsIjoiZW1haWwtMjQ0QHNvbWVkb21haW4uY29tIiwic2NvcGUiOlsiY2xvdWRfY29udHJvbGxlci5hZG1pbiJdLCJhdWQiOlsiY2xvdWRfY29udHJvbGxlciJdLCJleHAiOjE0Mjc0ODA4NjZ9.R1MbYtmqO6LWxPS9DZWBCfozlLxnvO-FD009CVJsIPY
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": "fc754fd2-fbeb-42b7-b75c-178f38855a31"
}' -X POST \
	-H "Authorization: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoidWFhLWlkLTMxMiIsImVtYWlsIjoiZW1haWwtMjQ0QHNvbWVkb21haW4uY29tIiwic2NvcGUiOlsiY2xvdWRfY29udHJvbGxlci5hZG1pbiJdLCJhdWQiOlsiY2xvdWRfY29udHJvbGxlciJdLCJleHAiOjE0Mjc0ODA4NjZ9.R1MbYtmqO6LWxPS9DZWBCfozlLxnvO-FD009CVJsIPY" \
	-H "Host: example.org" \
	-H "Content-Type: application/x-www-form-urlencoded" \
	-H "Cookie: "

Response

Status

201 Created

Body

{
  "metadata": {
    "guid": "be98f4f3-3549-4e78-ba98-e5207ee82187",
    "url": "/v2/domains/be98f4f3-3549-4e78-ba98-e5207ee82187",
    "created_at": "2015-03-20T18:27:46Z",
    "updated_at": null
  },
  "entity": {
    "name": "exmaple.com",
    "owning_organization_guid": "fc754fd2-fbeb-42b7-b75c-178f38855a31",
    "shared_organizations": [

    ],
    "owning_organization_url": "/v2/organizations/fc754fd2-fbeb-42b7-b75c-178f38855a31",
    "spaces_url": "/v2/domains/be98f4f3-3549-4e78-ba98-e5207ee82187/spaces"
  }
}

Headers

Content-Type: application/json;charset=utf-8
Location: /v2/domains/be98f4f3-3549-4e78-ba98-e5207ee82187
X-VCAP-Request-ID: f17f61ff-6254-4035-a70e-1e8d0379a3e0
X-Cf-Warnings: Endpoint+deprecated
Content-Length: 524
X-Content-Type-Options: nosniff