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-2b294faf-eeb0-4d28-984a-1862da7a8fbe
space_guid The guid of the associated space
  • guid-818a9ebe-6a19-435e-927f-d48365a7e30b
host The host portion of the route

Request

Headers

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

Route

PUT /v2/routes/47f7bfa4-fc8d-4851-8258-e47d51efa697

Body

{
  "host": "new_host"
}

cURL

curl "https://api.[your-domain.com]/v2/routes/47f7bfa4-fc8d-4851-8258-e47d51efa697" -d '{
  "host": "new_host"
}' -X PUT \
	-H "Authorization: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoidWFhLWlkLTIwNCIsImVtYWlsIjoiZW1haWwtMTU2QHNvbWVkb21haW4uY29tIiwic2NvcGUiOlsiY2xvdWRfY29udHJvbGxlci5hZG1pbiJdLCJhdWQiOlsiY2xvdWRfY29udHJvbGxlciJdLCJleHAiOjE0MTk5ODk5NzN9.rJZzHQmKBH3BDvOk5TExbZu5b5xYitkovkSQYNGYUUc" \
	-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: 94812672-2009-4afc-9eaa-b80703567052
Content-Length: 599
X-Content-Type-Options: nosniff

Status

201 Created

Body

{
  "metadata": {
    "guid": "47f7bfa4-fc8d-4851-8258-e47d51efa697",
    "url": "/v2/routes/47f7bfa4-fc8d-4851-8258-e47d51efa697",
    "created_at": "2014-12-24T01:39:33+00:00",
    "updated_at": "2014-12-24T01:39:33+00:00"
  },
  "entity": {
    "host": "new_host",
    "domain_guid": "ad18b2ea-f3d0-41f2-b54e-b36917dc8605",
    "space_guid": "2ce16563-f94b-4f8d-a240-0902501f95e8",
    "domain_url": "/v2/domains/ad18b2ea-f3d0-41f2-b54e-b36917dc8605",
    "space_url": "/v2/spaces/2ce16563-f94b-4f8d-a240-0902501f95e8",
    "apps_url": "/v2/routes/47f7bfa4-fc8d-4851-8258-e47d51efa697/apps"
  }
}