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-343a32e6-0d50-4dff-92e7-e80ac88cd18f
space_guid The guid of the associated space
  • guid-85428652-6acd-4412-b638-3b2a853613a0
host The host portion of the route

Request

Headers

Authorization: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoidWFhLWlkLTI5MSIsImVtYWlsIjoiZW1haWwtMjE2QHNvbWVkb21haW4uY29tIiwic2NvcGUiOlsiY2xvdWRfY29udHJvbGxlci5hZG1pbiJdLCJhdWQiOlsiY2xvdWRfY29udHJvbGxlciJdLCJleHAiOjE0MTY1MjY3MTR9.stFIC_rQ5TcIx0W9THuEhXOcA53-yhy_1NTbwz9G0xE
Host: example.org
Content-Type: application/x-www-form-urlencoded
Cookie: 

Route

PUT /v2/routes/ccfb4cf3-fd26-40b4-b618-56e75b66e6b7

Body

{
  "host": "new_host"
}

cURL

curl "https://api.[your-domain.com]/v2/routes/ccfb4cf3-fd26-40b4-b618-56e75b66e6b7" -d '{
  "host": "new_host"
}' -X PUT \
	-H "Authorization: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoidWFhLWlkLTI5MSIsImVtYWlsIjoiZW1haWwtMjE2QHNvbWVkb21haW4uY29tIiwic2NvcGUiOlsiY2xvdWRfY29udHJvbGxlci5hZG1pbiJdLCJhdWQiOlsiY2xvdWRfY29udHJvbGxlciJdLCJleHAiOjE0MTY1MjY3MTR9.stFIC_rQ5TcIx0W9THuEhXOcA53-yhy_1NTbwz9G0xE" \
	-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: d738ab9f-9fb3-4691-9230-4892477afd2c
Content-Length: 599
X-Content-Type-Options: nosniff

Status

201 Created

Body

{
  "metadata": {
    "guid": "ccfb4cf3-fd26-40b4-b618-56e75b66e6b7",
    "url": "/v2/routes/ccfb4cf3-fd26-40b4-b618-56e75b66e6b7",
    "created_at": "2014-11-13T23:38:33+00:00",
    "updated_at": "2014-11-13T23:38:33+00:00"
  },
  "entity": {
    "host": "new_host",
    "domain_guid": "ec209305-074a-4023-ba69-448f32846aa7",
    "space_guid": "88db011f-7e34-43ca-9c29-c5a3c8bb183e",
    "domain_url": "/v2/domains/ec209305-074a-4023-ba69-448f32846aa7",
    "space_url": "/v2/spaces/88db011f-7e34-43ca-9c29-c5a3c8bb183e",
    "apps_url": "/v2/routes/ccfb4cf3-fd26-40b4-b618-56e75b66e6b7/apps"
  }
}