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-9dbb27f9-8ade-4fcd-b8b1-3111ba9d2077
space_guid The guid of the associated space
  • guid-028ffcbf-3070-44c6-8e30-a106c2428568
host The host portion of the route

Request

Headers

Authorization: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoidWFhLWlkLTk1IiwiZW1haWwiOiJlbWFpbC02NkBzb21lZG9tYWluLmNvbSIsInNjb3BlIjpbImNsb3VkX2NvbnRyb2xsZXIuYWRtaW4iXSwiYXVkIjpbImNsb3VkX2NvbnRyb2xsZXIiXSwiZXhwIjoxNDIyOTkwODY5fQ.LqtdE-HRvbNQtIZIEWLxnvadTrMFE4jRKQ0NqCLQwMw
Host: example.org
Content-Type: application/x-www-form-urlencoded
Cookie: 

Route

POST /v2/routes

Body

{
  "domain_guid": "fcd17f27-b07a-4c0b-b7b0-2d6cb98196cc",
  "space_guid": "f4f78582-0fcd-45be-a7b1-3c4651bdd175"
}

cURL

curl "https://api.[your-domain.com]/v2/routes" -d '{
  "domain_guid": "fcd17f27-b07a-4c0b-b7b0-2d6cb98196cc",
  "space_guid": "f4f78582-0fcd-45be-a7b1-3c4651bdd175"
}' -X POST \
	-H "Authorization: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoidWFhLWlkLTk1IiwiZW1haWwiOiJlbWFpbC02NkBzb21lZG9tYWluLmNvbSIsInNjb3BlIjpbImNsb3VkX2NvbnRyb2xsZXIuYWRtaW4iXSwiYXVkIjpbImNsb3VkX2NvbnRyb2xsZXIiXSwiZXhwIjoxNDIyOTkwODY5fQ.LqtdE-HRvbNQtIZIEWLxnvadTrMFE4jRKQ0NqCLQwMw" \
	-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/6b99f711-006f-407e-8ac8-6de4dffb8f68
X-VCAP-Request-ID: b7dc6ea7-7f92-4d24-afef-e25f35678726
Content-Length: 563
X-Content-Type-Options: nosniff

Status

201 Created

Body

{
  "metadata": {
    "guid": "6b99f711-006f-407e-8ac8-6de4dffb8f68",
    "url": "/v2/routes/6b99f711-006f-407e-8ac8-6de4dffb8f68",
    "created_at": "2015-01-27T19:14:29Z",
    "updated_at": null
  },
  "entity": {
    "host": "",
    "domain_guid": "fcd17f27-b07a-4c0b-b7b0-2d6cb98196cc",
    "space_guid": "f4f78582-0fcd-45be-a7b1-3c4651bdd175",
    "domain_url": "/v2/domains/fcd17f27-b07a-4c0b-b7b0-2d6cb98196cc",
    "space_url": "/v2/spaces/f4f78582-0fcd-45be-a7b1-3c4651bdd175",
    "apps_url": "/v2/routes/6b99f711-006f-407e-8ac8-6de4dffb8f68/apps"
  }
}