Home
Version 3
Routes API

Routes API

Creating a Route

POST /v2/routes/

Request

Route

POST /v2/routes

Body

Name Description Default Valid Values Example Values
guid The guid of the route.
domain_guid The guid of the associated domain
  • guid-677f66b0-08b3-4a01-91ff-9205bcdeaee6
space_guid The guid of the associated space
  • guid-ac8cc8ce-590f-495a-9486-291037f31d2b
host The host portion of the route
{
  "domain_guid": "d9ea84db-3ab7-4fb3-bb0e-ffd2220ea81a",
  "space_guid": "9572c740-0450-4ab5-85ad-ca596529ad10"
}

Headers

Authorization: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoidWFhLWlkLTQyIiwiZW1haWwiOiJlbWFpbC00MEBzb21lZG9tYWluLmNvbSIsInNjb3BlIjpbImNsb3VkX2NvbnRyb2xsZXIuYWRtaW4iXSwiYXVkIjpbImNsb3VkX2NvbnRyb2xsZXIiXSwiZXhwIjoxNDI2NjMzODk3fQ.FVa-OkeqwVUgwoexSsO4bUPxybRkkzDVe8D1WqHv9gs
Host: example.org
Content-Type: application/x-www-form-urlencoded
Cookie: 

cURL

curl "https://api.[your-domain.com]/v2/routes" -d '{
  "domain_guid": "d9ea84db-3ab7-4fb3-bb0e-ffd2220ea81a",
  "space_guid": "9572c740-0450-4ab5-85ad-ca596529ad10"
}' -X POST \
	-H "Authorization: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoidWFhLWlkLTQyIiwiZW1haWwiOiJlbWFpbC00MEBzb21lZG9tYWluLmNvbSIsInNjb3BlIjpbImNsb3VkX2NvbnRyb2xsZXIuYWRtaW4iXSwiYXVkIjpbImNsb3VkX2NvbnRyb2xsZXIiXSwiZXhwIjoxNDI2NjMzODk3fQ.FVa-OkeqwVUgwoexSsO4bUPxybRkkzDVe8D1WqHv9gs" \
	-H "Host: example.org" \
	-H "Content-Type: application/x-www-form-urlencoded" \
	-H "Cookie: "

Response

Status

201 Created

Body

{
  "metadata": {
    "guid": "c1543b7b-42a7-40f4-943d-a6a89f253aeb",
    "url": "/v2/routes/c1543b7b-42a7-40f4-943d-a6a89f253aeb",
    "created_at": "2015-03-10T23:11:36Z",
    "updated_at": null
  },
  "entity": {
    "host": "",
    "domain_guid": "d9ea84db-3ab7-4fb3-bb0e-ffd2220ea81a",
    "space_guid": "9572c740-0450-4ab5-85ad-ca596529ad10",
    "domain_url": "/v2/domains/d9ea84db-3ab7-4fb3-bb0e-ffd2220ea81a",
    "space_url": "/v2/spaces/9572c740-0450-4ab5-85ad-ca596529ad10",
    "apps_url": "/v2/routes/c1543b7b-42a7-40f4-943d-a6a89f253aeb/apps"
  }
}

Headers

Content-Type: application/json;charset=utf-8
Location: /v2/routes/c1543b7b-42a7-40f4-943d-a6a89f253aeb
X-VCAP-Request-ID: edbc1ecb-6531-4700-9605-23b376bb97c2
Content-Length: 563
X-Content-Type-Options: nosniff