End a preview

DELETE
/v1/endpoints/{endpoint}/previews/{preview}

Ends a preview now: its address stops answering, its sessions stop working and its room (if awake) is drained. The record stays, with the reason, in the list.

Requires an API key with the workspace:write scope.

Authorization

apiKey
headerAuthorizationBearer <token>

A secret API key from the dashboard (Developers → API keys): vl_live_…, or vl_test_… for test mode. Each operation says which scope the key needs.

Path Parameters

endpoint*string

The endpoint id: the first segment of its run.vlayers.ai URL.

preview*string

The preview id from GET /v1/endpoints/{endpoint}/previews.

Response Body

The preview, now ended

application/json
  1. response
id*string
Formatuuid
endpointId*string
agentId*string
Formatuuid
environment*string
Value in"dev""stg""prd"
versionId*string
Formatuuid
state*string
Value in"awake""asleep""ended"
createdAt*string
Formatdate-time
expiresAt*string
Formatdate-time
lastRequestAt*|
Formatdate-time
sleepsAt*|
Formatdate-time
endedAt*|
Formatdate-time
endedReason*|
Value in"expired""cap""customer""endpoint_gone"null
endedMessage*string|null
routes*array<>
Example Request
curl -X DELETE "https://api.vlayers.ai/v1/endpoints/$ENDPOINT_ID/previews/$PREVIEW_ID" \  -H "Authorization: Bearer $VOICELAYER_API_KEY"
Example Response
{  "id": "0192f5c1-5e6f-7a8b-9c0d-1e2f3a4b5c67",  "endpointId": "x7k2p4q9m3vd",  "agentId": "0192f5c2-6f7a-7b9c-8d1e-2f3a4b5c6d78",  "environment": "dev",  "versionId": "0192f5c2-6f7a-7b9c-8d1e-2f3a4b5c6d78",  "state": "ended",  "createdAt": "2026-10-20T15:04:05.000Z",  "expiresAt": "2026-10-20T15:04:05.000Z",  "lastRequestAt": "2026-10-20T15:04:05.000Z",  "sleepsAt": null,  "endedAt": "2026-10-20T15:04:05.000Z",  "endedReason": "customer",  "endedMessage": "This preview was ended.",  "routes": [    {      "kind": "api",      "url": "https://run.vlayers.ai/x7k2p4q9m3vd--0e9d8c7b6a5f4e3d2c1b0a9f8e7d6c5b/api"    }  ]}