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-78c875db-4bff-48d5-aab8-2a382272b1c9
space_guid The guid of the associated space
  • guid-3bd86d50-e29b-48a9-8487-27a6fde78c1c
host The host portion of the route
{
  "domain_guid": "394d2dd3-85e6-4189-99ec-06b95da7676c",
  "space_guid": "375cd661-c6d8-43f3-99d9-4be42a0bafb9"
}

Headers

Authorization: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoidWFhLWlkLTQzIiwiZW1haWwiOiJlbWFpbC00M0Bzb21lZG9tYWluLmNvbSIsInNjb3BlIjpbImNsb3VkX2NvbnRyb2xsZXIuYWRtaW4iXSwiYXVkIjpbImNsb3VkX2NvbnRyb2xsZXIiXSwiZXhwIjoxNDI5MDM4Njk5fQ.JxQ-cvvxZn2W4yarevjv7zQD2exK6TaYHchUWEW01aI
Host: example.org
Content-Type: application/x-www-form-urlencoded
Cookie: 

cURL

curl "https://api.[your-domain.com]/v2/routes" -d '{
  "domain_guid": "394d2dd3-85e6-4189-99ec-06b95da7676c",
  "space_guid": "375cd661-c6d8-43f3-99d9-4be42a0bafb9"
}' -X POST \
	-H "Authorization: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoidWFhLWlkLTQzIiwiZW1haWwiOiJlbWFpbC00M0Bzb21lZG9tYWluLmNvbSIsInNjb3BlIjpbImNsb3VkX2NvbnRyb2xsZXIuYWRtaW4iXSwiYXVkIjpbImNsb3VkX2NvbnRyb2xsZXIiXSwiZXhwIjoxNDI5MDM4Njk5fQ.JxQ-cvvxZn2W4yarevjv7zQD2exK6TaYHchUWEW01aI" \
	-H "Host: example.org" \
	-H "Content-Type: application/x-www-form-urlencoded" \
	-H "Cookie: "

Response

Status

201 Created

Body

{
  "metadata": {
    "guid": "e1a4ac00-6513-4596-ba8b-178d7d743010",
    "url": "/v2/routes/e1a4ac00-6513-4596-ba8b-178d7d743010",
    "created_at": "2015-04-07T19:11:39Z",
    "updated_at": null
  },
  "entity": {
    "host": "",
    "domain_guid": "394d2dd3-85e6-4189-99ec-06b95da7676c",
    "space_guid": "375cd661-c6d8-43f3-99d9-4be42a0bafb9",
    "domain_url": "/v2/domains/394d2dd3-85e6-4189-99ec-06b95da7676c",
    "space_url": "/v2/spaces/375cd661-c6d8-43f3-99d9-4be42a0bafb9",
    "apps_url": "/v2/routes/e1a4ac00-6513-4596-ba8b-178d7d743010/apps"
  }
}

Headers

Content-Type: application/json;charset=utf-8
Location: /v2/routes/e1a4ac00-6513-4596-ba8b-178d7d743010
X-VCAP-Request-ID: 40f03918-eba8-48aa-adf2-2ec70de302b7
Content-Length: 563
X-Content-Type-Options: nosniff