Creating a Route
POST /v2/routes/
Fields
Name |
Description |
Default |
Valid Values |
Example Values |
guid
|
The guid of the route.
|
|
|
|
domain_guid
|
The guid of the associated domain
|
|
|
- guid-f1af3503-1da5-4ded-998a-9eb6eebb77e1
|
space_guid
|
The guid of the associated space
|
|
|
- guid-fc64ebe9-bca8-4ab0-a72d-0754aa5bf66a
|
host
|
The host portion of the route
|
|
|
|
Request
Headers
Route
POST /v2/routes
Body
{
"domain_guid": "8792cf0a-e445-40c5-90d0-e76f3cf14d8c",
"space_guid": "329637ce-69e5-4da5-81c3-284772d4be7e"
}
cURL
curl "https://api.[your-domain.com]/v2/routes" -d '{
"domain_guid": "8792cf0a-e445-40c5-90d0-e76f3cf14d8c",
"space_guid": "329637ce-69e5-4da5-81c3-284772d4be7e"
}' -X POST \
-H "Authorization: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoidWFhLWlkLTE1NiIsImVtYWlsIjoiZW1haWwtMTI5QHNvbWVkb21haW4uY29tIiwic2NvcGUiOlsiY2xvdWRfY29udHJvbGxlci5hZG1pbiJdLCJhdWQiOlsiY2xvdWRfY29udHJvbGxlciJdLCJleHAiOjE0MTc0NjIzNjB9.fankeu7K8mtUFpxT5kAEn-JD0caqUEI8XpPwDXGU_GQ" \
-H "Host: example.org" \
-H "Content-Type: application/x-www-form-urlencoded" \
-H "Cookie: "
Response
Headers
Status
201 Created
Body
{
"metadata": {
"guid": "6916315b-496f-4960-8886-81e17ce50874",
"url": "/v2/routes/6916315b-496f-4960-8886-81e17ce50874",
"created_at": "2014-11-24T19:32:40+00:00",
"updated_at": null
},
"entity": {
"host": "",
"domain_guid": "8792cf0a-e445-40c5-90d0-e76f3cf14d8c",
"space_guid": "329637ce-69e5-4da5-81c3-284772d4be7e",
"domain_url": "/v2/domains/8792cf0a-e445-40c5-90d0-e76f3cf14d8c",
"space_url": "/v2/spaces/329637ce-69e5-4da5-81c3-284772d4be7e",
"apps_url": "/v2/routes/6916315b-496f-4960-8886-81e17ce50874/apps"
}
}