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-c881413d-d5e7-40ab-9b0e-18dbea356a2b
space_guid The guid of the associated space
  • guid-8be3d197-c885-464d-8342-81039521798c
host The host portion of the route

Request

Headers

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

Route

POST /v2/routes

Body

{
  "domain_guid": "769d22c5-24c3-4f92-aaf6-a53238f09582",
  "space_guid": "27ec2ab5-f09c-4a06-a9d4-f8ed6cc9bdf2"
}

cURL

curl "https://api.[your-domain.com]/v2/routes" -d '{
  "domain_guid": "769d22c5-24c3-4f92-aaf6-a53238f09582",
  "space_guid": "27ec2ab5-f09c-4a06-a9d4-f8ed6cc9bdf2"
}' -X POST \
	-H "Authorization: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoidWFhLWlkLTI5NCIsImVtYWlsIjoiZW1haWwtMjE5QHNvbWVkb21haW4uY29tIiwic2NvcGUiOlsiY2xvdWRfY29udHJvbGxlci5hZG1pbiJdLCJhdWQiOlsiY2xvdWRfY29udHJvbGxlciJdLCJleHAiOjE0MTY1MjY3MTR9.AoV2bui3sMB161sF9tlfgYFiZZvktxYOSWezr4HN48A" \
	-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/7d9f3433-cf11-4cbe-8273-bca98c1d8fba
X-VCAP-Request-ID: 2e022128-ff59-433c-b605-1042da83ee57
Content-Length: 568
X-Content-Type-Options: nosniff

Status

201 Created

Body

{
  "metadata": {
    "guid": "7d9f3433-cf11-4cbe-8273-bca98c1d8fba",
    "url": "/v2/routes/7d9f3433-cf11-4cbe-8273-bca98c1d8fba",
    "created_at": "2014-11-13T23:38:34+00:00",
    "updated_at": null
  },
  "entity": {
    "host": "",
    "domain_guid": "769d22c5-24c3-4f92-aaf6-a53238f09582",
    "space_guid": "27ec2ab5-f09c-4a06-a9d4-f8ed6cc9bdf2",
    "domain_url": "/v2/domains/769d22c5-24c3-4f92-aaf6-a53238f09582",
    "space_url": "/v2/spaces/27ec2ab5-f09c-4a06-a9d4-f8ed6cc9bdf2",
    "apps_url": "/v2/routes/7d9f3433-cf11-4cbe-8273-bca98c1d8fba/apps"
  }
}