Home
Version 3
Routes API

Routes API

Update a Route

PUT /v2/routes/:guid

Request

Route

PUT /v2/routes/39f32916-1629-4779-8195-ea751236b0c8

Body

Name Description Default Valid Values Example Values
guid The guid of the route.
domain_guid The guid of the associated domain
  • guid-df9f527b-245e-4fd7-a9b6-5e6f9a87032e
space_guid The guid of the associated space
  • guid-dd823870-decf-49b6-bcd5-9de3da0f994a
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.eyJ1c2VyX2lkIjoidWFhLWlkLTIzNSIsImVtYWlsIjoiZW1haWwtMTgxQHNvbWVkb21haW4uY29tIiwic2NvcGUiOlsiY2xvdWRfY29udHJvbGxlci5hZG1pbiJdLCJhdWQiOlsiY2xvdWRfY29udHJvbGxlciJdLCJleHAiOjE0MzI3NzQ5OTJ9.UbBTPNmUGEXMwfddrzsZZFFR8lftbpZegoAxB-qpuHQ
Host: example.org
Content-Type: application/x-www-form-urlencoded
Cookie: 

cURL

curl "https://api.[your-domain.com]/v2/routes/39f32916-1629-4779-8195-ea751236b0c8" -d '{
  "host": "new_host",
  "path": "/apps/v1/path"
}' -X PUT \
	-H "Authorization: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoidWFhLWlkLTIzNSIsImVtYWlsIjoiZW1haWwtMTgxQHNvbWVkb21haW4uY29tIiwic2NvcGUiOlsiY2xvdWRfY29udHJvbGxlci5hZG1pbiJdLCJhdWQiOlsiY2xvdWRfY29udHJvbGxlciJdLCJleHAiOjE0MzI3NzQ5OTJ9.UbBTPNmUGEXMwfddrzsZZFFR8lftbpZegoAxB-qpuHQ" \
	-H "Host: example.org" \
	-H "Content-Type: application/x-www-form-urlencoded" \
	-H "Cookie: "

Response

Status

201 Created

Body

{
  "metadata": {
    "guid": "39f32916-1629-4779-8195-ea751236b0c8",
    "url": "/v2/routes/39f32916-1629-4779-8195-ea751236b0c8",
    "created_at": "2015-05-21T01:03:12Z",
    "updated_at": "2015-05-21T01:03:12Z"
  },
  "entity": {
    "host": "new_host",
    "path": "/apps/v1/path",
    "domain_guid": "4938895d-43b4-4f98-beb1-78e584ca47b2",
    "space_guid": "54fad726-5378-490d-8721-e621ad47011c",
    "domain_url": "/v2/domains/4938895d-43b4-4f98-beb1-78e584ca47b2",
    "space_url": "/v2/spaces/54fad726-5378-490d-8721-e621ad47011c",
    "apps_url": "/v2/routes/39f32916-1629-4779-8195-ea751236b0c8/apps"
  }
}

Headers

Content-Type: application/json;charset=utf-8
X-VCAP-Request-ID: 42d58fdd-49b5-4cf8-833e-857e2ba42a07
Content-Length: 618
X-Content-Type-Options: nosniff