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-66287ee9-ea75-4ea8-80fc-9147822c7081
space_guid The guid of the associated space
  • guid-e5321e52-3a32-4776-aa5e-16395990a07b
host The host portion of the route
{
  "domain_guid": "7e7d10c6-3a32-49d4-b0f5-02f59c701232",
  "space_guid": "be35270a-e962-4ef9-b043-12d948a09cf4"
}

Headers

Authorization: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoidWFhLWlkLTI3OSIsImVtYWlsIjoiZW1haWwtMjAwQHNvbWVkb21haW4uY29tIiwic2NvcGUiOlsiY2xvdWRfY29udHJvbGxlci5hZG1pbiJdLCJhdWQiOlsiY2xvdWRfY29udHJvbGxlciJdLCJleHAiOjE0Mjk2NjQxNDd9.N-r3ii2RgbTjx1iPChaacxVo4nNFE8EXvjLRfJfPosQ
Host: example.org
Content-Type: application/x-www-form-urlencoded
Cookie: 

cURL

curl "https://api.[your-domain.com]/v2/routes" -d '{
  "domain_guid": "7e7d10c6-3a32-49d4-b0f5-02f59c701232",
  "space_guid": "be35270a-e962-4ef9-b043-12d948a09cf4"
}' -X POST \
	-H "Authorization: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoidWFhLWlkLTI3OSIsImVtYWlsIjoiZW1haWwtMjAwQHNvbWVkb21haW4uY29tIiwic2NvcGUiOlsiY2xvdWRfY29udHJvbGxlci5hZG1pbiJdLCJhdWQiOlsiY2xvdWRfY29udHJvbGxlciJdLCJleHAiOjE0Mjk2NjQxNDd9.N-r3ii2RgbTjx1iPChaacxVo4nNFE8EXvjLRfJfPosQ" \
	-H "Host: example.org" \
	-H "Content-Type: application/x-www-form-urlencoded" \
	-H "Cookie: "

Response

Status

201 Created

Body

{
  "metadata": {
    "guid": "992e27b2-f8c1-4589-9a3a-c76f84b91d8a",
    "url": "/v2/routes/992e27b2-f8c1-4589-9a3a-c76f84b91d8a",
    "created_at": "2015-04-15T00:55:47Z",
    "updated_at": null
  },
  "entity": {
    "host": "",
    "domain_guid": "7e7d10c6-3a32-49d4-b0f5-02f59c701232",
    "space_guid": "be35270a-e962-4ef9-b043-12d948a09cf4",
    "domain_url": "/v2/domains/7e7d10c6-3a32-49d4-b0f5-02f59c701232",
    "space_url": "/v2/spaces/be35270a-e962-4ef9-b043-12d948a09cf4",
    "apps_url": "/v2/routes/992e27b2-f8c1-4589-9a3a-c76f84b91d8a/apps"
  }
}

Headers

Content-Type: application/json;charset=utf-8
Location: /v2/routes/992e27b2-f8c1-4589-9a3a-c76f84b91d8a
X-VCAP-Request-ID: 174903cf-39a4-4f5a-a22b-8f00d2b55fbe
Content-Length: 563
X-Content-Type-Options: nosniff