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-a7d2bd70-2673-4c58-815b-72cfc42553e2
space_guid The guid of the associated space
  • guid-ef15f2a2-3024-47ef-ae39-aa8f2e2d912e
host The host portion of the route

Request

Headers

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

Route

POST /v2/routes

Body

{
  "domain_guid": "c5f805de-806f-47a5-9352-bcbb3d16d0f4",
  "space_guid": "e96bad28-2f14-4869-a74f-8dd283ec3c3e"
}

cURL

curl "https://api.[your-domain.com]/v2/routes" -d '{
  "domain_guid": "c5f805de-806f-47a5-9352-bcbb3d16d0f4",
  "space_guid": "e96bad28-2f14-4869-a74f-8dd283ec3c3e"
}' -X POST \
	-H "Authorization: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoidWFhLWlkLTM3MCIsImVtYWlsIjoiZW1haWwtMjcyQHNvbWVkb21haW4uY29tIiwic2NvcGUiOlsiY2xvdWRfY29udHJvbGxlci5hZG1pbiJdLCJhdWQiOlsiY2xvdWRfY29udHJvbGxlciJdLCJleHAiOjE0MjQ0NzE3MDl9.Gp1plZUCHi61xEAeDY5Sqx3ZH6FB1zu1pGH5wTayTTc" \
	-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/6422db72-f6f4-4fcc-a3c1-49c265d23ec7
X-VCAP-Request-ID: 8f50d235-6295-4442-bacd-01b5924f7eec
Content-Length: 563
X-Content-Type-Options: nosniff

Status

201 Created

Body

{
  "metadata": {
    "guid": "6422db72-f6f4-4fcc-a3c1-49c265d23ec7",
    "url": "/v2/routes/6422db72-f6f4-4fcc-a3c1-49c265d23ec7",
    "created_at": "2015-02-13T22:35:09Z",
    "updated_at": null
  },
  "entity": {
    "host": "",
    "domain_guid": "c5f805de-806f-47a5-9352-bcbb3d16d0f4",
    "space_guid": "e96bad28-2f14-4869-a74f-8dd283ec3c3e",
    "domain_url": "/v2/domains/c5f805de-806f-47a5-9352-bcbb3d16d0f4",
    "space_url": "/v2/spaces/e96bad28-2f14-4869-a74f-8dd283ec3c3e",
    "apps_url": "/v2/routes/6422db72-f6f4-4fcc-a3c1-49c265d23ec7/apps"
  }
}