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-58ebeb16-e545-42c6-aeca-34e9ed89f9b1
space_guid The guid of the associated space
  • guid-c17922b9-0030-4e2f-9151-0438fc901736
host The host portion of the route
{
  "domain_guid": "1835aa52-aefc-48b0-816d-a2fbcf54120a",
  "space_guid": "4523b3ff-7e3e-4d2e-a531-0968e4b6ac00"
}

Headers

Authorization: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoidWFhLWlkLTE5MSIsImVtYWlsIjoiZW1haWwtMTQzQHNvbWVkb21haW4uY29tIiwic2NvcGUiOlsiY2xvdWRfY29udHJvbGxlci5hZG1pbiJdLCJhdWQiOlsiY2xvdWRfY29udHJvbGxlciJdLCJleHAiOjE0MjYxODc3NDd9.YxBOuwUa37CdajO-EK1SXiDQyhT7GfRQx6Y0UbmO62Q
Host: example.org
Content-Type: application/x-www-form-urlencoded
Cookie: 

cURL

curl "https://api.[your-domain.com]/v2/routes" -d '{
  "domain_guid": "1835aa52-aefc-48b0-816d-a2fbcf54120a",
  "space_guid": "4523b3ff-7e3e-4d2e-a531-0968e4b6ac00"
}' -X POST \
	-H "Authorization: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoidWFhLWlkLTE5MSIsImVtYWlsIjoiZW1haWwtMTQzQHNvbWVkb21haW4uY29tIiwic2NvcGUiOlsiY2xvdWRfY29udHJvbGxlci5hZG1pbiJdLCJhdWQiOlsiY2xvdWRfY29udHJvbGxlciJdLCJleHAiOjE0MjYxODc3NDd9.YxBOuwUa37CdajO-EK1SXiDQyhT7GfRQx6Y0UbmO62Q" \
	-H "Host: example.org" \
	-H "Content-Type: application/x-www-form-urlencoded" \
	-H "Cookie: "

Response

Status

201 Created

Body

{
  "metadata": {
    "guid": "0d7aa5a8-91f0-4aa7-a5c5-dba08fd86c96",
    "url": "/v2/routes/0d7aa5a8-91f0-4aa7-a5c5-dba08fd86c96",
    "created_at": "2015-03-05T19:15:46Z",
    "updated_at": null
  },
  "entity": {
    "host": "",
    "domain_guid": "1835aa52-aefc-48b0-816d-a2fbcf54120a",
    "space_guid": "4523b3ff-7e3e-4d2e-a531-0968e4b6ac00",
    "domain_url": "/v2/domains/1835aa52-aefc-48b0-816d-a2fbcf54120a",
    "space_url": "/v2/spaces/4523b3ff-7e3e-4d2e-a531-0968e4b6ac00",
    "apps_url": "/v2/routes/0d7aa5a8-91f0-4aa7-a5c5-dba08fd86c96/apps"
  }
}

Headers

Content-Type: application/json;charset=utf-8
Location: /v2/routes/0d7aa5a8-91f0-4aa7-a5c5-dba08fd86c96
X-VCAP-Request-ID: 77f958e8-9b5f-4497-b270-a685f5c2008c
Content-Length: 563
X-Content-Type-Options: nosniff