Home
Version 3
Routes API

Routes API

Update a Route

PUT /v2/routes/:guid

Request

Route

PUT /v2/routes/21bbe53f-df11-4892-a0e8-a118f8a7bd2b

Body

Name Description Default Valid Values Example Values
guid The guid of the route.
domain_guid The guid of the associated domain
  • guid-f8c8b010-cab8-4803-8222-267a32690f11
space_guid The guid of the associated space
  • guid-fc08914d-525f-4980-8b28-f37930dabc5b
host The host portion of the route
{
  "host": "new_host"
}

Headers

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

cURL

curl "https://api.[your-domain.com]/v2/routes/21bbe53f-df11-4892-a0e8-a118f8a7bd2b" -d '{
  "host": "new_host"
}' -X PUT \
	-H "Authorization: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoidWFhLWlkLTIiLCJlbWFpbCI6ImVtYWlsLTJAc29tZWRvbWFpbi5jb20iLCJzY29wZSI6WyJjbG91ZF9jb250cm9sbGVyLmFkbWluIl0sImF1ZCI6WyJjbG91ZF9jb250cm9sbGVyIl0sImV4cCI6MTQyNzMyMzk1NH0.tAS67FHRxve_fIUeOqoHZGxkbRrBaIL7qA4ShxPvyZ0" \
	-H "Host: example.org" \
	-H "Content-Type: application/x-www-form-urlencoded" \
	-H "Cookie: "

Response

Status

201 Created

Body

{
  "metadata": {
    "guid": "21bbe53f-df11-4892-a0e8-a118f8a7bd2b",
    "url": "/v2/routes/21bbe53f-df11-4892-a0e8-a118f8a7bd2b",
    "created_at": "2015-03-18T22:52:34Z",
    "updated_at": "2015-03-18T22:52:34Z"
  },
  "entity": {
    "host": "new_host",
    "domain_guid": "8cdd3fae-46be-4ba2-b153-5ba8442e6d5a",
    "space_guid": "f15b3ffd-eb2c-4e7c-b4be-169eef5a88a2",
    "domain_url": "/v2/domains/8cdd3fae-46be-4ba2-b153-5ba8442e6d5a",
    "space_url": "/v2/spaces/f15b3ffd-eb2c-4e7c-b4be-169eef5a88a2",
    "apps_url": "/v2/routes/21bbe53f-df11-4892-a0e8-a118f8a7bd2b/apps"
  }
}

Headers

Content-Type: application/json;charset=utf-8
X-VCAP-Request-ID: 01175bb2-dfc9-4413-9b9f-c32ccc0c1888
Content-Length: 589
X-Content-Type-Options: nosniff