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-6207e9cf-6d9a-4f15-b2c7-588b7ff27e40
space_guid The guid of the associated space
  • guid-d2097709-118f-4702-9399-b7c1921562d1
host The host portion of the route

Request

Headers

Authorization: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoidWFhLWlkLTkwIiwiZW1haWwiOiJlbWFpbC02MEBzb21lZG9tYWluLmNvbSIsInNjb3BlIjpbImNsb3VkX2NvbnRyb2xsZXIuYWRtaW4iXSwiYXVkIjpbImNsb3VkX2NvbnRyb2xsZXIiXSwiZXhwIjoxNDIyMzIzNTM0fQ.9Co0iZK-G0_zdr0d5r2yO2MVc-UBQe1_cJcxhX50qws
Host: example.org
Content-Type: application/x-www-form-urlencoded
Cookie: 

Route

POST /v2/routes

Body

{
  "domain_guid": "c128d888-6161-40d5-bd09-9dc312bba6e3",
  "space_guid": "3b9a21f0-de39-44c2-bbad-47e79a40689e"
}

cURL

curl "https://api.[your-domain.com]/v2/routes" -d '{
  "domain_guid": "c128d888-6161-40d5-bd09-9dc312bba6e3",
  "space_guid": "3b9a21f0-de39-44c2-bbad-47e79a40689e"
}' -X POST \
	-H "Authorization: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoidWFhLWlkLTkwIiwiZW1haWwiOiJlbWFpbC02MEBzb21lZG9tYWluLmNvbSIsInNjb3BlIjpbImNsb3VkX2NvbnRyb2xsZXIuYWRtaW4iXSwiYXVkIjpbImNsb3VkX2NvbnRyb2xsZXIiXSwiZXhwIjoxNDIyMzIzNTM0fQ.9Co0iZK-G0_zdr0d5r2yO2MVc-UBQe1_cJcxhX50qws" \
	-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/ec466073-3665-44f2-848b-e9fbb29fc35c
X-VCAP-Request-ID: c353ce65-f058-48c3-a837-5f953dce697e
Content-Length: 568
X-Content-Type-Options: nosniff

Status

201 Created

Body

{
  "metadata": {
    "guid": "ec466073-3665-44f2-848b-e9fbb29fc35c",
    "url": "/v2/routes/ec466073-3665-44f2-848b-e9fbb29fc35c",
    "created_at": "2015-01-20T01:52:14+00:00",
    "updated_at": null
  },
  "entity": {
    "host": "",
    "domain_guid": "c128d888-6161-40d5-bd09-9dc312bba6e3",
    "space_guid": "3b9a21f0-de39-44c2-bbad-47e79a40689e",
    "domain_url": "/v2/domains/c128d888-6161-40d5-bd09-9dc312bba6e3",
    "space_url": "/v2/spaces/3b9a21f0-de39-44c2-bbad-47e79a40689e",
    "apps_url": "/v2/routes/ec466073-3665-44f2-848b-e9fbb29fc35c/apps"
  }
}