Home
Version 3
Routes API

Routes API

Update a Route

PUT /v2/routes/:guid

Request

Route

PUT /v2/routes/85625d0c-5a3c-4263-ab48-cfa2a66ee857

Body

Name Description Default Valid Values Example Values
guid The guid of the route.
domain_guid The guid of the associated domain
  • guid-7a0766b0-361d-4e2c-a5ac-9275aaea568d
space_guid The guid of the associated space
  • guid-375900b8-4a7e-464d-8922-71063ef23594
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.eyJ1c2VyX2lkIjoidWFhLWlkLTEyNyIsImVtYWlsIjoiZW1haWwtODJAc29tZWRvbWFpbi5jb20iLCJzY29wZSI6WyJjbG91ZF9jb250cm9sbGVyLmFkbWluIl0sImF1ZCI6WyJjbG91ZF9jb250cm9sbGVyIl0sImV4cCI6MTQzODY0MTc5Mn0.RnzXBpB11xkn_GjYvfoKy516wpB9k2RN2erlE5MzagY
Host: example.org
Content-Type: application/x-www-form-urlencoded
Cookie: 

cURL

curl "https://api.[your-domain.com]/v2/routes/85625d0c-5a3c-4263-ab48-cfa2a66ee857" -d '{
  "host": "new_host",
  "path": "/apps/v1/path"
}' -X PUT \
	-H "Authorization: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoidWFhLWlkLTEyNyIsImVtYWlsIjoiZW1haWwtODJAc29tZWRvbWFpbi5jb20iLCJzY29wZSI6WyJjbG91ZF9jb250cm9sbGVyLmFkbWluIl0sImF1ZCI6WyJjbG91ZF9jb250cm9sbGVyIl0sImV4cCI6MTQzODY0MTc5Mn0.RnzXBpB11xkn_GjYvfoKy516wpB9k2RN2erlE5MzagY" \
	-H "Host: example.org" \
	-H "Content-Type: application/x-www-form-urlencoded" \
	-H "Cookie: "

Response

Status

201 Created

Body

{
  "metadata": {
    "guid": "85625d0c-5a3c-4263-ab48-cfa2a66ee857",
    "url": "/v2/routes/85625d0c-5a3c-4263-ab48-cfa2a66ee857",
    "created_at": "2015-07-27T22:43:12Z",
    "updated_at": "2015-07-27T22:43:12Z"
  },
  "entity": {
    "host": "new_host",
    "path": "/apps/v1/path",
    "domain_guid": "c2dc22bc-0010-443c-a5fb-497f9b5c873c",
    "space_guid": "70e6c5d5-d243-4116-b767-40140ee1b195",
    "domain_url": "/v2/domains/c2dc22bc-0010-443c-a5fb-497f9b5c873c",
    "space_url": "/v2/spaces/70e6c5d5-d243-4116-b767-40140ee1b195",
    "apps_url": "/v2/routes/85625d0c-5a3c-4263-ab48-cfa2a66ee857/apps"
  }
}

Headers

Content-Type: application/json;charset=utf-8
X-VCAP-Request-ID: 9a5fb493-b5a2-41a9-85b0-1aaa9cf268d8
Content-Length: 618
X-Content-Type-Options: nosniff