Home
Version 3
Routes API

Routes API

Update a Route

PUT /v2/routes/:guid

Request

Route

PUT /v2/routes/86782f19-3f3d-408e-80e4-25cd01aaf882

Body

Name Description Default Valid Values Example Values
guid The guid of the route.
domain_guid The guid of the associated domain
  • guid-e54c786e-9460-4016-b72b-cf520f2e50b1
space_guid The guid of the associated space
  • guid-917ac4a2-fa99-4620-8738-163b60f77c0d
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
service_instance_guid Guid of the bound service instance. Requests for the route will be forwarded to this service instance.
{
  "host": "new_host",
  "path": "/apps/v1/path",
  "service_instance_guid": "fde6275d-de4c-477e-b2f0-17a16fe1a3f4"
}

Headers

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

cURL

curl "https://api.[your-domain.com]/v2/routes/86782f19-3f3d-408e-80e4-25cd01aaf882" -d '{
  "host": "new_host",
  "path": "/apps/v1/path",
  "service_instance_guid": "fde6275d-de4c-477e-b2f0-17a16fe1a3f4"
}' -X PUT \
	-H "Authorization: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoidWFhLWlkLTM2MiIsImVtYWlsIjoiZW1haWwtMjUzQHNvbWVkb21haW4uY29tIiwic2NvcGUiOlsiY2xvdWRfY29udHJvbGxlci5hZG1pbiJdLCJhdWQiOlsiY2xvdWRfY29udHJvbGxlciJdLCJleHAiOjE0NDE2NjI2MTV9.y3lCFye4phWUT0uqGdEHKWklDbrmjFm_j8JaZjwyk4g" \
	-H "Host: example.org" \
	-H "Content-Type: application/x-www-form-urlencoded" \
	-H "Cookie: "

Response

Status

201 Created

Body

{
  "metadata": {
    "guid": "86782f19-3f3d-408e-80e4-25cd01aaf882",
    "url": "/v2/routes/86782f19-3f3d-408e-80e4-25cd01aaf882",
    "created_at": "2015-08-31T21:50:15Z",
    "updated_at": "2015-08-31T21:50:15Z"
  },
  "entity": {
    "host": "new_host",
    "path": "/apps/v1/path",
    "domain_guid": "412bf939-25b9-4ba6-b270-2cae72ec2437",
    "space_guid": "9cea485a-08a9-4f72-8706-779017948853",
    "service_instance_guid": "fde6275d-de4c-477e-b2f0-17a16fe1a3f4",
    "domain_url": "/v2/domains/412bf939-25b9-4ba6-b270-2cae72ec2437",
    "space_url": "/v2/spaces/9cea485a-08a9-4f72-8706-779017948853",
    "service_instance_url": "/v2/service_instances/fde6275d-de4c-477e-b2f0-17a16fe1a3f4",
    "apps_url": "/v2/routes/86782f19-3f3d-408e-80e4-25cd01aaf882/apps"
  }
}

Headers

Content-Type: application/json;charset=utf-8
X-VCAP-Request-ID: f97857b6-f17a-4c52-8c10-8fafec2a4759
Content-Length: 777
X-Content-Type-Options: nosniff