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-cf9c50c3-2f3a-4eaf-8591-9b3748b8fcae
space_guid The guid of the associated space
  • guid-cb71a741-8c7e-4ac3-83a3-afe0034394a7
host The host portion of the route

Request

Headers

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

Route

PUT /v2/routes/7fc313c6-aac0-4a03-88e5-48c802198f26

Body

{
  "host": "new_host"
}

cURL

curl "https://api.[your-domain.com]/v2/routes/7fc313c6-aac0-4a03-88e5-48c802198f26" -d '{
  "host": "new_host"
}' -X PUT \
	-H "Authorization: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoidWFhLWlkLTEzOCIsImVtYWlsIjoiZW1haWwtMTA5QHNvbWVkb21haW4uY29tIiwic2NvcGUiOlsiY2xvdWRfY29udHJvbGxlci5hZG1pbiJdLCJhdWQiOlsiY2xvdWRfY29udHJvbGxlciJdLCJleHAiOjE0MjQzMTAxMjd9.kT6kVh0hlxVHBKkv5kK4INVU1G1DzBxW3Zbgswn0DUA" \
	-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: 0d336e1f-8d39-4fd9-bdea-59053b987ba6
Content-Length: 589
X-Content-Type-Options: nosniff

Status

201 Created

Body

{
  "metadata": {
    "guid": "7fc313c6-aac0-4a03-88e5-48c802198f26",
    "url": "/v2/routes/7fc313c6-aac0-4a03-88e5-48c802198f26",
    "created_at": "2015-02-12T01:42:06Z",
    "updated_at": "2015-02-12T01:42:06Z"
  },
  "entity": {
    "host": "new_host",
    "domain_guid": "845981a6-1011-4e67-a7d7-7111f107d0f4",
    "space_guid": "97044f2d-0fa0-40f7-8843-b4f21135c783",
    "domain_url": "/v2/domains/845981a6-1011-4e67-a7d7-7111f107d0f4",
    "space_url": "/v2/spaces/97044f2d-0fa0-40f7-8843-b4f21135c783",
    "apps_url": "/v2/routes/7fc313c6-aac0-4a03-88e5-48c802198f26/apps"
  }
}