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-b6975926-d70c-4526-8bb1-84868b10d660
space_guid The guid of the associated space
  • guid-820d3cc5-c72d-4bfc-b2f2-8d64d2741db6
host The host portion of the route
{
  "domain_guid": "f3fbc321-c6a4-404a-baae-9a27df76aa7a",
  "space_guid": "9d5cd98e-c0a6-4846-ad23-4bd92536cf26"
}

Headers

Authorization: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoidWFhLWlkLTMiLCJlbWFpbCI6ImVtYWlsLTNAc29tZWRvbWFpbi5jb20iLCJzY29wZSI6WyJjbG91ZF9jb250cm9sbGVyLmFkbWluIl0sImF1ZCI6WyJjbG91ZF9jb250cm9sbGVyIl0sImV4cCI6MTQyNzMyMzk1NH0.eQt36-GDsJikf4ulPqe_LPXoDdoWGvIBIiS8R4Duv1g
Host: example.org
Content-Type: application/x-www-form-urlencoded
Cookie: 

cURL

curl "https://api.[your-domain.com]/v2/routes" -d '{
  "domain_guid": "f3fbc321-c6a4-404a-baae-9a27df76aa7a",
  "space_guid": "9d5cd98e-c0a6-4846-ad23-4bd92536cf26"
}' -X POST \
	-H "Authorization: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoidWFhLWlkLTMiLCJlbWFpbCI6ImVtYWlsLTNAc29tZWRvbWFpbi5jb20iLCJzY29wZSI6WyJjbG91ZF9jb250cm9sbGVyLmFkbWluIl0sImF1ZCI6WyJjbG91ZF9jb250cm9sbGVyIl0sImV4cCI6MTQyNzMyMzk1NH0.eQt36-GDsJikf4ulPqe_LPXoDdoWGvIBIiS8R4Duv1g" \
	-H "Host: example.org" \
	-H "Content-Type: application/x-www-form-urlencoded" \
	-H "Cookie: "

Response

Status

201 Created

Body

{
  "metadata": {
    "guid": "d3a66a07-8f80-4225-825b-90d066db5764",
    "url": "/v2/routes/d3a66a07-8f80-4225-825b-90d066db5764",
    "created_at": "2015-03-18T22:52:34Z",
    "updated_at": null
  },
  "entity": {
    "host": "",
    "domain_guid": "f3fbc321-c6a4-404a-baae-9a27df76aa7a",
    "space_guid": "9d5cd98e-c0a6-4846-ad23-4bd92536cf26",
    "domain_url": "/v2/domains/f3fbc321-c6a4-404a-baae-9a27df76aa7a",
    "space_url": "/v2/spaces/9d5cd98e-c0a6-4846-ad23-4bd92536cf26",
    "apps_url": "/v2/routes/d3a66a07-8f80-4225-825b-90d066db5764/apps"
  }
}

Headers

Content-Type: application/json;charset=utf-8
Location: /v2/routes/d3a66a07-8f80-4225-825b-90d066db5764
X-VCAP-Request-ID: 9f551de8-91b5-463a-b081-bf2c7686b1a0
Content-Length: 563
X-Content-Type-Options: nosniff