Home
Version 3
Routes API

Routes API

Update a Route

PUT /v2/routes/:guid

Request

Route

PUT /v2/routes/154a038e-3579-4ee8-a08b-fd45b1599a19

Body

Name Description Default Valid Values Example Values
guid The guid of the route.
domain_guid The guid of the associated domain
  • guid-18e78f80-8ad2-42a8-9f58-8bd5b2ba72d2
space_guid The guid of the associated space
  • guid-cc118fd4-1a90-416b-bdc9-bd030e43cf48
host The host portion of the route
path The path of a route
  • /apps/v1/path
  • /apps/v2/path
{
  "host": "new_host",
  "path": "/apps/v1/path"
}

Headers

Authorization: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoidWFhLWlkLTEyNCIsImVtYWlsIjoiZW1haWwtNzNAc29tZWRvbWFpbi5jb20iLCJzY29wZSI6WyJjbG91ZF9jb250cm9sbGVyLmFkbWluIl0sImF1ZCI6WyJjbG91ZF9jb250cm9sbGVyIl0sImV4cCI6MTQzMTY0NjYzMX0.QGcSHgTN9_3C1biVjQP7WKQJSrO22h_-3LmnbtkvI1M
Host: example.org
Content-Type: application/x-www-form-urlencoded
Cookie: 

cURL

curl "https://api.[your-domain.com]/v2/routes/154a038e-3579-4ee8-a08b-fd45b1599a19" -d '{
  "host": "new_host",
  "path": "/apps/v1/path"
}' -X PUT \
	-H "Authorization: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoidWFhLWlkLTEyNCIsImVtYWlsIjoiZW1haWwtNzNAc29tZWRvbWFpbi5jb20iLCJzY29wZSI6WyJjbG91ZF9jb250cm9sbGVyLmFkbWluIl0sImF1ZCI6WyJjbG91ZF9jb250cm9sbGVyIl0sImV4cCI6MTQzMTY0NjYzMX0.QGcSHgTN9_3C1biVjQP7WKQJSrO22h_-3LmnbtkvI1M" \
	-H "Host: example.org" \
	-H "Content-Type: application/x-www-form-urlencoded" \
	-H "Cookie: "

Response

Status

201 Created

Body

{
  "metadata": {
    "guid": "154a038e-3579-4ee8-a08b-fd45b1599a19",
    "url": "/v2/routes/154a038e-3579-4ee8-a08b-fd45b1599a19",
    "created_at": "2015-05-07T23:37:11Z",
    "updated_at": "2015-05-07T23:37:11Z"
  },
  "entity": {
    "host": "new_host",
    "domain_guid": "c36f3cc3-08fe-410d-8c0e-1e05cdca0deb",
    "space_guid": "148e91bf-802a-4e68-bfd8-f820e14689de",
    "path": "/apps/v1/path",
    "domain_url": "/v2/domains/c36f3cc3-08fe-410d-8c0e-1e05cdca0deb",
    "space_url": "/v2/spaces/148e91bf-802a-4e68-bfd8-f820e14689de",
    "apps_url": "/v2/routes/154a038e-3579-4ee8-a08b-fd45b1599a19/apps"
  }
}

Headers

Content-Type: application/json;charset=utf-8
X-VCAP-Request-ID: 2c991d96-9b79-42cb-ac0c-d36bafe66214
Content-Length: 618
X-Content-Type-Options: nosniff