Home
Version 3
Routes API

Routes API

Update a Route

PUT /v2/routes/:guid

Request

Route

PUT /v2/routes/d6769044-f65f-44ae-ab94-111030f9d3e7

Body

Name Description Default Valid Values Example Values
guid The guid of the route.
domain_guid The guid of the associated domain
  • guid-daa0eed7-c038-4d14-8cbd-698313911334
space_guid The guid of the associated space
  • guid-5183d8be-00be-4a3d-86c2-c9bc32c3de40
host The host portion of the route
path The path for a route as raw text. 1) Paths must be between 2 and 128 characters 2) Paths must start with a / 3) Paths must not contain a "?"
  • /apps/v1/path
  • /apps/v2/path
{
  "host": "new_host",
  "path": "/apps/v1/path"
}

Headers

Authorization: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoidWFhLWlkLTM3MyIsImVtYWlsIjoiZW1haWwtMjQxQHNvbWVkb21haW4uY29tIiwic2NvcGUiOlsiY2xvdWRfY29udHJvbGxlci5hZG1pbiJdLCJhdWQiOlsiY2xvdWRfY29udHJvbGxlciJdLCJleHAiOjE0NDQyNjA2NTR9.-oxXk_cZGGFvx-Qa607_Lhjn3FLL9CCTFUncHVZDFLw
Host: example.org
Content-Type: application/x-www-form-urlencoded
Cookie: 

cURL

curl "https://api.[your-domain.com]/v2/routes/d6769044-f65f-44ae-ab94-111030f9d3e7" -d '{
  "host": "new_host",
  "path": "/apps/v1/path"
}' -X PUT \
	-H "Authorization: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoidWFhLWlkLTM3MyIsImVtYWlsIjoiZW1haWwtMjQxQHNvbWVkb21haW4uY29tIiwic2NvcGUiOlsiY2xvdWRfY29udHJvbGxlci5hZG1pbiJdLCJhdWQiOlsiY2xvdWRfY29udHJvbGxlciJdLCJleHAiOjE0NDQyNjA2NTR9.-oxXk_cZGGFvx-Qa607_Lhjn3FLL9CCTFUncHVZDFLw" \
	-H "Host: example.org" \
	-H "Content-Type: application/x-www-form-urlencoded" \
	-H "Cookie: "

Response

Status

201 Created

Body

{
  "metadata": {
    "guid": "d6769044-f65f-44ae-ab94-111030f9d3e7",
    "url": "/v2/routes/d6769044-f65f-44ae-ab94-111030f9d3e7",
    "created_at": "2015-09-30T23:30:54Z",
    "updated_at": "2015-09-30T23:30:54Z"
  },
  "entity": {
    "host": "new_host",
    "path": "/apps/v1/path",
    "domain_guid": "ca7a9427-1afa-4075-8c0d-e7efa2d314e6",
    "space_guid": "9cec305b-c56a-474b-b205-fcda9c26a0a8",
    "service_instance_guid": null,
    "domain_url": "/v2/domains/ca7a9427-1afa-4075-8c0d-e7efa2d314e6",
    "space_url": "/v2/spaces/9cec305b-c56a-474b-b205-fcda9c26a0a8",
    "apps_url": "/v2/routes/d6769044-f65f-44ae-ab94-111030f9d3e7/apps"
  }
}

Headers

Content-Type: application/json;charset=utf-8
X-VCAP-Request-ID: 5ba8ed36-eb51-4bf7-b4db-8bb19f739f91
Content-Length: 653
X-Content-Type-Options: nosniff