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-95c9b327-6d79-438c-b35b-39e20bd59082
space_guid The guid of the associated space
  • guid-c7fb7a63-c2ae-4bab-9cbf-290021915fa3
host The host portion of the route

Request

Headers

Authorization: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoidWFhLWlkLTEzNyIsImVtYWlsIjoiZW1haWwtMTA4QHNvbWVkb21haW4uY29tIiwic2NvcGUiOlsiY2xvdWRfY29udHJvbGxlci5hZG1pbiJdLCJhdWQiOlsiY2xvdWRfY29udHJvbGxlciJdLCJleHAiOjE0MjQzMTAxMjZ9.eRs3j3gTxBXaFjR-GMuwfYqVxYO6tKhZzfFDqbBP4AU
Host: example.org
Content-Type: application/x-www-form-urlencoded
Cookie: 

Route

POST /v2/routes

Body

{
  "domain_guid": "359e2fc4-a236-4d11-b36b-20e3d5ac2be2",
  "space_guid": "78c5f242-ccc2-4a9d-9185-ed4e3a978a81"
}

cURL

curl "https://api.[your-domain.com]/v2/routes" -d '{
  "domain_guid": "359e2fc4-a236-4d11-b36b-20e3d5ac2be2",
  "space_guid": "78c5f242-ccc2-4a9d-9185-ed4e3a978a81"
}' -X POST \
	-H "Authorization: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoidWFhLWlkLTEzNyIsImVtYWlsIjoiZW1haWwtMTA4QHNvbWVkb21haW4uY29tIiwic2NvcGUiOlsiY2xvdWRfY29udHJvbGxlci5hZG1pbiJdLCJhdWQiOlsiY2xvdWRfY29udHJvbGxlciJdLCJleHAiOjE0MjQzMTAxMjZ9.eRs3j3gTxBXaFjR-GMuwfYqVxYO6tKhZzfFDqbBP4AU" \
	-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/57cfe5d1-4b8b-4e26-b747-c3c8105abd2a
X-VCAP-Request-ID: 81fc2273-ec53-4e34-aacd-c558340f4241
Content-Length: 563
X-Content-Type-Options: nosniff

Status

201 Created

Body

{
  "metadata": {
    "guid": "57cfe5d1-4b8b-4e26-b747-c3c8105abd2a",
    "url": "/v2/routes/57cfe5d1-4b8b-4e26-b747-c3c8105abd2a",
    "created_at": "2015-02-12T01:42:06Z",
    "updated_at": null
  },
  "entity": {
    "host": "",
    "domain_guid": "359e2fc4-a236-4d11-b36b-20e3d5ac2be2",
    "space_guid": "78c5f242-ccc2-4a9d-9185-ed4e3a978a81",
    "domain_url": "/v2/domains/359e2fc4-a236-4d11-b36b-20e3d5ac2be2",
    "space_url": "/v2/spaces/78c5f242-ccc2-4a9d-9185-ed4e3a978a81",
    "apps_url": "/v2/routes/57cfe5d1-4b8b-4e26-b747-c3c8105abd2a/apps"
  }
}