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-60af821a-4c94-45ba-8fb9-2cd1fb21294f
space_guid The guid of the associated space
  • guid-e529b3d1-d4e5-4c16-94aa-e8ab5a148d60
host The host portion of the route
{
  "domain_guid": "6c7d132c-1415-4d9f-a3ec-bb11d9183f1b",
  "space_guid": "17dc3935-9263-41e6-b241-9df6f2dd28a1"
}

Headers

Authorization: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoidWFhLWlkLTM4MSIsImVtYWlsIjoiZW1haWwtMjg0QHNvbWVkb21haW4uY29tIiwic2NvcGUiOlsiY2xvdWRfY29udHJvbGxlci5hZG1pbiJdLCJhdWQiOlsiY2xvdWRfY29udHJvbGxlciJdLCJleHAiOjE0Mjc0ODA4NzB9.epdmShSybLu-7RLyhtktbd1SftSDHTzuiQEAtBe_Pic
Host: example.org
Content-Type: application/x-www-form-urlencoded
Cookie: 

cURL

curl "https://api.[your-domain.com]/v2/routes" -d '{
  "domain_guid": "6c7d132c-1415-4d9f-a3ec-bb11d9183f1b",
  "space_guid": "17dc3935-9263-41e6-b241-9df6f2dd28a1"
}' -X POST \
	-H "Authorization: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoidWFhLWlkLTM4MSIsImVtYWlsIjoiZW1haWwtMjg0QHNvbWVkb21haW4uY29tIiwic2NvcGUiOlsiY2xvdWRfY29udHJvbGxlci5hZG1pbiJdLCJhdWQiOlsiY2xvdWRfY29udHJvbGxlciJdLCJleHAiOjE0Mjc0ODA4NzB9.epdmShSybLu-7RLyhtktbd1SftSDHTzuiQEAtBe_Pic" \
	-H "Host: example.org" \
	-H "Content-Type: application/x-www-form-urlencoded" \
	-H "Cookie: "

Response

Status

201 Created

Body

{
  "metadata": {
    "guid": "bc45a409-fbbe-40da-9112-8130668a9294",
    "url": "/v2/routes/bc45a409-fbbe-40da-9112-8130668a9294",
    "created_at": "2015-03-20T18:27:50Z",
    "updated_at": null
  },
  "entity": {
    "host": "",
    "domain_guid": "6c7d132c-1415-4d9f-a3ec-bb11d9183f1b",
    "space_guid": "17dc3935-9263-41e6-b241-9df6f2dd28a1",
    "domain_url": "/v2/domains/6c7d132c-1415-4d9f-a3ec-bb11d9183f1b",
    "space_url": "/v2/spaces/17dc3935-9263-41e6-b241-9df6f2dd28a1",
    "apps_url": "/v2/routes/bc45a409-fbbe-40da-9112-8130668a9294/apps"
  }
}

Headers

Content-Type: application/json;charset=utf-8
Location: /v2/routes/bc45a409-fbbe-40da-9112-8130668a9294
X-VCAP-Request-ID: 33d92980-ba20-4f15-baef-b8a497c33bbe
Content-Length: 563
X-Content-Type-Options: nosniff