Home
Version 3
Routes API

Routes API

Update a Route

PUT /v2/routes/:guid

Request

Route

PUT /v2/routes/0f6f851a-d81b-4e13-a414-70bb6f1420af

Body

Name Description Default Valid Values Example Values
guid The guid of the route.
domain_guid The guid of the associated domain
  • guid-93b41040-064f-47bc-9dd9-e1e926c5e4b6
space_guid The guid of the associated space
  • guid-2b8e52ea-8b29-4ad3-9715-e27a8803c020
host The host portion of the route
{
  "host": "new_host"
}

Headers

Authorization: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoidWFhLWlkLTM4NSIsImVtYWlsIjoiZW1haWwtMjg4QHNvbWVkb21haW4uY29tIiwic2NvcGUiOlsiY2xvdWRfY29udHJvbGxlci5hZG1pbiJdLCJhdWQiOlsiY2xvdWRfY29udHJvbGxlciJdLCJleHAiOjE0Mjc0ODA4NzB9.tuJf-nmSovv9QowEVyTB5foSEwRWrlyWP5WIMR0w2a8
Host: example.org
Content-Type: application/x-www-form-urlencoded
Cookie: 

cURL

curl "https://api.[your-domain.com]/v2/routes/0f6f851a-d81b-4e13-a414-70bb6f1420af" -d '{
  "host": "new_host"
}' -X PUT \
	-H "Authorization: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoidWFhLWlkLTM4NSIsImVtYWlsIjoiZW1haWwtMjg4QHNvbWVkb21haW4uY29tIiwic2NvcGUiOlsiY2xvdWRfY29udHJvbGxlci5hZG1pbiJdLCJhdWQiOlsiY2xvdWRfY29udHJvbGxlciJdLCJleHAiOjE0Mjc0ODA4NzB9.tuJf-nmSovv9QowEVyTB5foSEwRWrlyWP5WIMR0w2a8" \
	-H "Host: example.org" \
	-H "Content-Type: application/x-www-form-urlencoded" \
	-H "Cookie: "

Response

Status

201 Created

Body

{
  "metadata": {
    "guid": "0f6f851a-d81b-4e13-a414-70bb6f1420af",
    "url": "/v2/routes/0f6f851a-d81b-4e13-a414-70bb6f1420af",
    "created_at": "2015-03-20T18:27:50Z",
    "updated_at": "2015-03-20T18:27:50Z"
  },
  "entity": {
    "host": "new_host",
    "domain_guid": "0c520257-b155-4f39-a065-325d565f387d",
    "space_guid": "9a1b488b-14d1-4132-a4f1-49aad1f6845e",
    "domain_url": "/v2/domains/0c520257-b155-4f39-a065-325d565f387d",
    "space_url": "/v2/spaces/9a1b488b-14d1-4132-a4f1-49aad1f6845e",
    "apps_url": "/v2/routes/0f6f851a-d81b-4e13-a414-70bb6f1420af/apps"
  }
}

Headers

Content-Type: application/json;charset=utf-8
X-VCAP-Request-ID: 78b4a948-98e2-40f4-81bb-f73cf56b95a0
Content-Length: 589
X-Content-Type-Options: nosniff