Home
Version 3
Routes API

Routes API

Update a Route

PUT /v2/routes/:guid

Request

Route

PUT /v2/routes/a932a91e-7eeb-4e28-9270-8226500170c1

Body

Name Description Default Valid Values Example Values
guid The guid of the route.
domain_guid The guid of the associated domain
  • guid-5a17b681-4272-41eb-a42f-7497e70fdb43
space_guid The guid of the associated space
  • guid-cea0c43d-c04d-4606-96fd-89057e5ad955
host The host portion of the route
path The path for a route as raw text. 1) Paths must be between 2 and 128 characters 2) Paths must start with a / 3) Paths must not contain a "?"
  • /apps/v1/path
  • /apps/v2/path
{
  "host": "new_host",
  "path": "/apps/v1/path"
}

Headers

Authorization: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoidWFhLWlkLTQxNCIsImVtYWlsIjoiZW1haWwtMzA0QHNvbWVkb21haW4uY29tIiwic2NvcGUiOlsiY2xvdWRfY29udHJvbGxlci5hZG1pbiJdLCJhdWQiOlsiY2xvdWRfY29udHJvbGxlciJdLCJleHAiOjE0Mzk0MjYyMTd9.1t6ikK2KrszSDTo8xjVdYDhmGjvm_Vj0yrSob_e_NJc
Host: example.org
Content-Type: application/x-www-form-urlencoded
Cookie: 

cURL

curl "https://api.[your-domain.com]/v2/routes/a932a91e-7eeb-4e28-9270-8226500170c1" -d '{
  "host": "new_host",
  "path": "/apps/v1/path"
}' -X PUT \
	-H "Authorization: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoidWFhLWlkLTQxNCIsImVtYWlsIjoiZW1haWwtMzA0QHNvbWVkb21haW4uY29tIiwic2NvcGUiOlsiY2xvdWRfY29udHJvbGxlci5hZG1pbiJdLCJhdWQiOlsiY2xvdWRfY29udHJvbGxlciJdLCJleHAiOjE0Mzk0MjYyMTd9.1t6ikK2KrszSDTo8xjVdYDhmGjvm_Vj0yrSob_e_NJc" \
	-H "Host: example.org" \
	-H "Content-Type: application/x-www-form-urlencoded" \
	-H "Cookie: "

Response

Status

201 Created

Body

{
  "metadata": {
    "guid": "a932a91e-7eeb-4e28-9270-8226500170c1",
    "url": "/v2/routes/a932a91e-7eeb-4e28-9270-8226500170c1",
    "created_at": "2015-08-06T00:36:57Z",
    "updated_at": "2015-08-06T00:36:57Z"
  },
  "entity": {
    "host": "new_host",
    "path": "/apps/v1/path",
    "domain_guid": "cc1971a9-fdba-49e4-b396-603af8081a0a",
    "space_guid": "e549693e-edb1-47b6-b232-7d80dfdccafc",
    "domain_url": "/v2/domains/cc1971a9-fdba-49e4-b396-603af8081a0a",
    "space_url": "/v2/spaces/e549693e-edb1-47b6-b232-7d80dfdccafc",
    "apps_url": "/v2/routes/a932a91e-7eeb-4e28-9270-8226500170c1/apps"
  }
}

Headers

Content-Type: application/json;charset=utf-8
X-VCAP-Request-ID: b3b48962-3ce3-4334-a278-0883a6c33473
Content-Length: 618
X-Content-Type-Options: nosniff