Home
Version 3
Routes API

Routes API

Creating a Route

POST /v2/routes/

Fields

Name Description Default Valid Values Example Values
guid The guid of the route.
domain_guid The guid of the associated domain
  • guid-7ec59de4-2fe9-45a8-bac5-014202787952
space_guid The guid of the associated space
  • guid-7917a46c-e2f4-4b98-9930-5f2238c1086e
host The host portion of the route

Request

Headers

Authorization: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoidWFhLWlkLTI5MSIsImVtYWlsIjoiZW1haWwtMjE2QHNvbWVkb21haW4uY29tIiwic2NvcGUiOlsiY2xvdWRfY29udHJvbGxlci5hZG1pbiJdLCJhdWQiOlsiY2xvdWRfY29udHJvbGxlciJdLCJleHAiOjE0MTU3NTQxNTB9.Sxo_e-5kGiCxNcGAA-Z68QdIQaiNjP-_NGI20Qzjc5w
Host: example.org
Content-Type: application/x-www-form-urlencoded
Cookie: 

Route

POST /v2/routes

Body

{
  "domain_guid": "55bdbe93-e3fc-4c6b-984c-7846448e4b79",
  "space_guid": "410469d5-ed42-435b-8e71-80e1cc7d7ad8"
}

cURL

curl "https://api.[your-domain.com]/v2/routes" -d '{
  "domain_guid": "55bdbe93-e3fc-4c6b-984c-7846448e4b79",
  "space_guid": "410469d5-ed42-435b-8e71-80e1cc7d7ad8"
}' -X POST \
	-H "Authorization: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoidWFhLWlkLTI5MSIsImVtYWlsIjoiZW1haWwtMjE2QHNvbWVkb21haW4uY29tIiwic2NvcGUiOlsiY2xvdWRfY29udHJvbGxlci5hZG1pbiJdLCJhdWQiOlsiY2xvdWRfY29udHJvbGxlciJdLCJleHAiOjE0MTU3NTQxNTB9.Sxo_e-5kGiCxNcGAA-Z68QdIQaiNjP-_NGI20Qzjc5w" \
	-H "Host: example.org" \
	-H "Content-Type: application/x-www-form-urlencoded" \
	-H "Cookie: "

Response

Headers

Content-Type: application/json;charset=utf-8
Location: /v2/routes/65d14009-8ddf-4fa1-88bd-f25751d1a3a6
X-VCAP-Request-ID: c4fa6d8f-884a-4d2b-b646-f02cefed0d82
Content-Length: 568
X-Content-Type-Options: nosniff

Status

201 Created

Body

{
  "metadata": {
    "guid": "65d14009-8ddf-4fa1-88bd-f25751d1a3a6",
    "url": "/v2/routes/65d14009-8ddf-4fa1-88bd-f25751d1a3a6",
    "created_at": "2014-11-05T01:02:30+00:00",
    "updated_at": null
  },
  "entity": {
    "host": "",
    "domain_guid": "55bdbe93-e3fc-4c6b-984c-7846448e4b79",
    "space_guid": "410469d5-ed42-435b-8e71-80e1cc7d7ad8",
    "domain_url": "/v2/domains/55bdbe93-e3fc-4c6b-984c-7846448e4b79",
    "space_url": "/v2/spaces/410469d5-ed42-435b-8e71-80e1cc7d7ad8",
    "apps_url": "/v2/routes/65d14009-8ddf-4fa1-88bd-f25751d1a3a6/apps"
  }
}