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-bcb0f36f-4c85-4dad-906f-b90564069dfc
space_guid The guid of the associated space
  • guid-371b9e57-d30c-4aae-b8b8-420969b2b3c5
host The host portion of the route

Request

Headers

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

Route

POST /v2/routes

Body

{
  "domain_guid": "8582f468-0a73-4c9d-b99e-8007c9a4b003",
  "space_guid": "c6d239f8-eff2-4ef8-8a7c-227c831d11c0"
}

cURL

curl "https://api.[your-domain.com]/v2/routes" -d '{
  "domain_guid": "8582f468-0a73-4c9d-b99e-8007c9a4b003",
  "space_guid": "c6d239f8-eff2-4ef8-8a7c-227c831d11c0"
}' -X POST \
	-H "Authorization: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoidWFhLWlkLTEzNCIsImVtYWlsIjoiZW1haWwtODZAc29tZWRvbWFpbi5jb20iLCJzY29wZSI6WyJjbG91ZF9jb250cm9sbGVyLmFkbWluIl0sImF1ZCI6WyJjbG91ZF9jb250cm9sbGVyIl0sImV4cCI6MTQyNDEzNzM2Nn0.fw67GxwDBPtXn2qJsqmcjbj0AHuxKimDzjZgLa7I1Xg" \
	-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/adf5eb7c-cd1f-41c6-a461-14a13fb7b73b
X-VCAP-Request-ID: e5c309d9-46e6-497b-a586-58e37cd07e8f
Content-Length: 563
X-Content-Type-Options: nosniff

Status

201 Created

Body

{
  "metadata": {
    "guid": "adf5eb7c-cd1f-41c6-a461-14a13fb7b73b",
    "url": "/v2/routes/adf5eb7c-cd1f-41c6-a461-14a13fb7b73b",
    "created_at": "2015-02-10T01:42:46Z",
    "updated_at": null
  },
  "entity": {
    "host": "",
    "domain_guid": "8582f468-0a73-4c9d-b99e-8007c9a4b003",
    "space_guid": "c6d239f8-eff2-4ef8-8a7c-227c831d11c0",
    "domain_url": "/v2/domains/8582f468-0a73-4c9d-b99e-8007c9a4b003",
    "space_url": "/v2/spaces/c6d239f8-eff2-4ef8-8a7c-227c831d11c0",
    "apps_url": "/v2/routes/adf5eb7c-cd1f-41c6-a461-14a13fb7b73b/apps"
  }
}