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-8955e073-48dd-458d-b943-2a72d278d1bb
space_guid The guid of the associated space
  • guid-6b2fa32f-8d7f-4fe0-a9ba-40c4b913380d
host The host portion of the route
path The path for a route as raw text. 1) Paths must be between 2 and 128 characters 2) Paths must start with a / 3) Paths must not contain a "?"
  • /apps/v1/path
  • /apps/v2/path
{
  "domain_guid": "9b18a3f5-f4ec-4a35-b633-ff1abbc8acff",
  "space_guid": "75556476-f79a-41ff-abe3-93eab04a5537",
  "path": "/apps/v1/path"
}

Headers

Authorization: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoidWFhLWlkLTg2IiwiZW1haWwiOiJlbWFpbC04NUBzb21lZG9tYWluLmNvbSIsInNjb3BlIjpbImNsb3VkX2NvbnRyb2xsZXIuYWRtaW4iXSwiYXVkIjpbImNsb3VkX2NvbnRyb2xsZXIiXSwiZXhwIjoxNDM1MTAyODUwfQ.egOo3kzVxBlrNgtSQ93vgmE9EnUvW_yAUUFY48QvvXg
Host: example.org
Content-Type: application/x-www-form-urlencoded
Cookie: 

cURL

curl "https://api.[your-domain.com]/v2/routes" -d '{
  "domain_guid": "9b18a3f5-f4ec-4a35-b633-ff1abbc8acff",
  "space_guid": "75556476-f79a-41ff-abe3-93eab04a5537",
  "path": "/apps/v1/path"
}' -X POST \
	-H "Authorization: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoidWFhLWlkLTg2IiwiZW1haWwiOiJlbWFpbC04NUBzb21lZG9tYWluLmNvbSIsInNjb3BlIjpbImNsb3VkX2NvbnRyb2xsZXIuYWRtaW4iXSwiYXVkIjpbImNsb3VkX2NvbnRyb2xsZXIiXSwiZXhwIjoxNDM1MTAyODUwfQ.egOo3kzVxBlrNgtSQ93vgmE9EnUvW_yAUUFY48QvvXg" \
	-H "Host: example.org" \
	-H "Content-Type: application/x-www-form-urlencoded" \
	-H "Cookie: "

Response

Status

201 Created

Body

{
  "metadata": {
    "guid": "6ca089bf-15eb-40dd-9e55-3d736fe6ad2b",
    "url": "/v2/routes/6ca089bf-15eb-40dd-9e55-3d736fe6ad2b",
    "created_at": "2015-06-16T23:40:50Z",
    "updated_at": null
  },
  "entity": {
    "host": "",
    "path": "/apps/v1/path",
    "domain_guid": "9b18a3f5-f4ec-4a35-b633-ff1abbc8acff",
    "space_guid": "75556476-f79a-41ff-abe3-93eab04a5537",
    "domain_url": "/v2/domains/9b18a3f5-f4ec-4a35-b633-ff1abbc8acff",
    "space_url": "/v2/spaces/75556476-f79a-41ff-abe3-93eab04a5537",
    "apps_url": "/v2/routes/6ca089bf-15eb-40dd-9e55-3d736fe6ad2b/apps"
  }
}

Headers

Content-Type: application/json;charset=utf-8
Location: /v2/routes/6ca089bf-15eb-40dd-9e55-3d736fe6ad2b
X-VCAP-Request-ID: 4f224b0c-ded4-4b4e-8327-83a23a3d67c2
Content-Length: 592
X-Content-Type-Options: nosniff