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-32ae4be9-37cc-4d1e-8955-adefaccf12ea
space_guid The guid of the associated space
  • guid-f5f901b4-d9c9-4d0b-bcfe-98a6dddefe5d
host The host portion of the route
path The path of a route
  • /apps/v1/path
  • /apps/v2/path
{
  "domain_guid": "df15a9d5-baa8-4ae1-9a24-06d0dbc79bd7",
  "space_guid": "f946d695-b563-423e-a337-a9b33194cf64",
  "path": "/apps/v1/path"
}

Headers

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

cURL

curl "https://api.[your-domain.com]/v2/routes" -d '{
  "domain_guid": "df15a9d5-baa8-4ae1-9a24-06d0dbc79bd7",
  "space_guid": "f946d695-b563-423e-a337-a9b33194cf64",
  "path": "/apps/v1/path"
}' -X POST \
	-H "Authorization: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoidWFhLWlkLTEyMyIsImVtYWlsIjoiZW1haWwtNzJAc29tZWRvbWFpbi5jb20iLCJzY29wZSI6WyJjbG91ZF9jb250cm9sbGVyLmFkbWluIl0sImF1ZCI6WyJjbG91ZF9jb250cm9sbGVyIl0sImV4cCI6MTQzMTY0NjYzMX0.drJFMkB40jdkxFXSm44hQxPMOy2ITnMCbVS4iG1VJ_4" \
	-H "Host: example.org" \
	-H "Content-Type: application/x-www-form-urlencoded" \
	-H "Cookie: "

Response

Status

201 Created

Body

{
  "metadata": {
    "guid": "dc08cb98-6fa2-4b4c-a701-587ee66d8763",
    "url": "/v2/routes/dc08cb98-6fa2-4b4c-a701-587ee66d8763",
    "created_at": "2015-05-07T23:37:11Z",
    "updated_at": null
  },
  "entity": {
    "host": "",
    "domain_guid": "df15a9d5-baa8-4ae1-9a24-06d0dbc79bd7",
    "space_guid": "f946d695-b563-423e-a337-a9b33194cf64",
    "path": "/apps/v1/path",
    "domain_url": "/v2/domains/df15a9d5-baa8-4ae1-9a24-06d0dbc79bd7",
    "space_url": "/v2/spaces/f946d695-b563-423e-a337-a9b33194cf64",
    "apps_url": "/v2/routes/dc08cb98-6fa2-4b4c-a701-587ee66d8763/apps"
  }
}

Headers

Content-Type: application/json;charset=utf-8
Location: /v2/routes/dc08cb98-6fa2-4b4c-a701-587ee66d8763
X-VCAP-Request-ID: 159b102b-2f43-4724-8ce1-1549cab4778e
Content-Length: 592
X-Content-Type-Options: nosniff