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-36bb9a74-ddd3-45b8-9c0b-e9b040a3a1b7
space_guid The guid of the associated space
  • guid-42c699f9-08c1-44e8-bb1a-a7931fb5f167
host The host portion of the route

Request

Headers

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

Route

PUT /v2/routes/d3afe2bd-ab7b-49ad-a541-4ab5b593772a

Body

{
  "host": "new_host"
}

cURL

curl "https://api.[your-domain.com]/v2/routes/d3afe2bd-ab7b-49ad-a541-4ab5b593772a" -d '{
  "host": "new_host"
}' -X PUT \
	-H "Authorization: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoidWFhLWlkLTE1OCIsImVtYWlsIjoiZW1haWwtMTMxQHNvbWVkb21haW4uY29tIiwic2NvcGUiOlsiY2xvdWRfY29udHJvbGxlci5hZG1pbiJdLCJhdWQiOlsiY2xvdWRfY29udHJvbGxlciJdLCJleHAiOjE0MTc0NjIzNjB9.Ow94prNDmUDbOyueXsF46WKAIjem00KRkB9S_npPrOU" \
	-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: 98412838-f2a6-4cd7-9925-2d8407624885
Content-Length: 599
X-Content-Type-Options: nosniff

Status

201 Created

Body

{
  "metadata": {
    "guid": "d3afe2bd-ab7b-49ad-a541-4ab5b593772a",
    "url": "/v2/routes/d3afe2bd-ab7b-49ad-a541-4ab5b593772a",
    "created_at": "2014-11-24T19:32:40+00:00",
    "updated_at": "2014-11-24T19:32:40+00:00"
  },
  "entity": {
    "host": "new_host",
    "domain_guid": "5160dd14-94a0-4dcf-a9e8-c65b8ee187cf",
    "space_guid": "25aa5fe6-1012-46e4-8f23-ce1e1b412184",
    "domain_url": "/v2/domains/5160dd14-94a0-4dcf-a9e8-c65b8ee187cf",
    "space_url": "/v2/spaces/25aa5fe6-1012-46e4-8f23-ce1e1b412184",
    "apps_url": "/v2/routes/d3afe2bd-ab7b-49ad-a541-4ab5b593772a/apps"
  }
}