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-927655fa-226e-4ea5-85b6-44d21c46002a
space_guid The guid of the associated space
  • guid-9dc5c17a-6fd7-4a21-b09f-ade660299778
host The host portion of the route

Request

Headers

Authorization: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoidWFhLWlkLTI5NCIsImVtYWlsIjoiZW1haWwtMjE5QHNvbWVkb21haW4uY29tIiwic2NvcGUiOlsiY2xvdWRfY29udHJvbGxlci5hZG1pbiJdLCJhdWQiOlsiY2xvdWRfY29udHJvbGxlciJdLCJleHAiOjE0MTU3NTQxNTF9.YjM2vu29kf8df3Tto-VfYn1TXT7yyR89TjwDo9Z9zLE
Host: example.org
Content-Type: application/x-www-form-urlencoded
Cookie: 

Route

PUT /v2/routes/a870689b-1f5e-4886-94cd-78186598ef44

Body

{
  "host": "new_host"
}

cURL

curl "https://api.[your-domain.com]/v2/routes/a870689b-1f5e-4886-94cd-78186598ef44" -d '{
  "host": "new_host"
}' -X PUT \
	-H "Authorization: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoidWFhLWlkLTI5NCIsImVtYWlsIjoiZW1haWwtMjE5QHNvbWVkb21haW4uY29tIiwic2NvcGUiOlsiY2xvdWRfY29udHJvbGxlci5hZG1pbiJdLCJhdWQiOlsiY2xvdWRfY29udHJvbGxlciJdLCJleHAiOjE0MTU3NTQxNTF9.YjM2vu29kf8df3Tto-VfYn1TXT7yyR89TjwDo9Z9zLE" \
	-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: 5958ee9d-916b-43e3-801f-a3fea9bd8f1a
Content-Length: 599
X-Content-Type-Options: nosniff

Status

201 Created

Body

{
  "metadata": {
    "guid": "a870689b-1f5e-4886-94cd-78186598ef44",
    "url": "/v2/routes/a870689b-1f5e-4886-94cd-78186598ef44",
    "created_at": "2014-11-05T01:02:31+00:00",
    "updated_at": "2014-11-05T01:02:31+00:00"
  },
  "entity": {
    "host": "new_host",
    "domain_guid": "ac28ec12-23ca-490e-8c60-5a98fc7020fe",
    "space_guid": "28f25efb-849a-45d6-921c-17db68526f92",
    "domain_url": "/v2/domains/ac28ec12-23ca-490e-8c60-5a98fc7020fe",
    "space_url": "/v2/spaces/28f25efb-849a-45d6-921c-17db68526f92",
    "apps_url": "/v2/routes/a870689b-1f5e-4886-94cd-78186598ef44/apps"
  }
}