Home
Version 3
Routes API

Routes API

Update a Route

PUT /v2/routes/:guid

Fields

Name Description Default Valid Values Example Values
guid The guid of the route.
domain_guid The guid of the associated domain
  • guid-1927853b-e8d8-4600-b8a8-f1acef5dd005
space_guid The guid of the associated space
  • guid-472bd678-d9ef-4d3a-b5ee-f174563faf48
host The host portion of the route

Request

Headers

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

Route

PUT /v2/routes/23898400-9087-4521-8ba2-892043587560

Body

{
  "host": "new_host"
}

cURL

curl "https://api.[your-domain.com]/v2/routes/23898400-9087-4521-8ba2-892043587560" -d '{
  "host": "new_host"
}' -X PUT \
	-H "Authorization: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoidWFhLWlkLTEzNSIsImVtYWlsIjoiZW1haWwtODdAc29tZWRvbWFpbi5jb20iLCJzY29wZSI6WyJjbG91ZF9jb250cm9sbGVyLmFkbWluIl0sImF1ZCI6WyJjbG91ZF9jb250cm9sbGVyIl0sImV4cCI6MTQyNDEzNzM2Nn0.ROptgtNwy21_f_rMpTwFrQ_5d0tpDDHHYRFIK5mDwH4" \
	-H "Host: example.org" \
	-H "Content-Type: application/x-www-form-urlencoded" \
	-H "Cookie: "

Response

Headers

Content-Type: application/json;charset=utf-8
X-VCAP-Request-ID: 7a25e9a3-9a3a-4f23-baf1-cbb60c814731
Content-Length: 589
X-Content-Type-Options: nosniff

Status

201 Created

Body

{
  "metadata": {
    "guid": "23898400-9087-4521-8ba2-892043587560",
    "url": "/v2/routes/23898400-9087-4521-8ba2-892043587560",
    "created_at": "2015-02-10T01:42:46Z",
    "updated_at": "2015-02-10T01:42:46Z"
  },
  "entity": {
    "host": "new_host",
    "domain_guid": "53016789-208d-4ebc-9f20-a1a4b69749e2",
    "space_guid": "a2cc74d0-6d28-4af7-9a8c-3c32d6e4464d",
    "domain_url": "/v2/domains/53016789-208d-4ebc-9f20-a1a4b69749e2",
    "space_url": "/v2/spaces/a2cc74d0-6d28-4af7-9a8c-3c32d6e4464d",
    "apps_url": "/v2/routes/23898400-9087-4521-8ba2-892043587560/apps"
  }
}