Home
Version 3
Routes API

Routes API

Update a Route

PUT /v2/routes/:guid

Request

Route

PUT /v2/routes/e46ae87c-745e-457d-acbc-67dbd5a15bba

Body

Name Description Default Valid Values Example Values
guid The guid of the route.
domain_guid The guid of the associated domain
  • guid-63e8afd3-16d8-47ac-86f0-4172cb653084
space_guid The guid of the associated space
  • guid-207f2892-c0f3-4d0a-8205-b972cca92020
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.eyJ1c2VyX2lkIjoidWFhLWlkLTg0IiwiZW1haWwiOiJlbWFpbC04M0Bzb21lZG9tYWluLmNvbSIsInNjb3BlIjpbImNsb3VkX2NvbnRyb2xsZXIuYWRtaW4iXSwiYXVkIjpbImNsb3VkX2NvbnRyb2xsZXIiXSwiZXhwIjoxNDM1MTAyODUwfQ.KCP9YCLwkj9Hwipg4e-A-gFfux49PqHqvyjcJICjyCM
Host: example.org
Content-Type: application/x-www-form-urlencoded
Cookie: 

cURL

curl "https://api.[your-domain.com]/v2/routes/e46ae87c-745e-457d-acbc-67dbd5a15bba" -d '{
  "host": "new_host",
  "path": "/apps/v1/path"
}' -X PUT \
	-H "Authorization: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoidWFhLWlkLTg0IiwiZW1haWwiOiJlbWFpbC04M0Bzb21lZG9tYWluLmNvbSIsInNjb3BlIjpbImNsb3VkX2NvbnRyb2xsZXIuYWRtaW4iXSwiYXVkIjpbImNsb3VkX2NvbnRyb2xsZXIiXSwiZXhwIjoxNDM1MTAyODUwfQ.KCP9YCLwkj9Hwipg4e-A-gFfux49PqHqvyjcJICjyCM" \
	-H "Host: example.org" \
	-H "Content-Type: application/x-www-form-urlencoded" \
	-H "Cookie: "

Response

Status

201 Created

Body

{
  "metadata": {
    "guid": "e46ae87c-745e-457d-acbc-67dbd5a15bba",
    "url": "/v2/routes/e46ae87c-745e-457d-acbc-67dbd5a15bba",
    "created_at": "2015-06-16T23:40:49Z",
    "updated_at": "2015-06-16T23:40:49Z"
  },
  "entity": {
    "host": "new_host",
    "path": "/apps/v1/path",
    "domain_guid": "56a0e1b2-b5dc-4136-8689-6ad58debe78c",
    "space_guid": "a1c14080-f05a-4dac-a9db-a644673534c2",
    "domain_url": "/v2/domains/56a0e1b2-b5dc-4136-8689-6ad58debe78c",
    "space_url": "/v2/spaces/a1c14080-f05a-4dac-a9db-a644673534c2",
    "apps_url": "/v2/routes/e46ae87c-745e-457d-acbc-67dbd5a15bba/apps"
  }
}

Headers

Content-Type: application/json;charset=utf-8
X-VCAP-Request-ID: f199cd6f-baf6-472a-a5b9-0314b0c8259b
Content-Length: 618
X-Content-Type-Options: nosniff