End a preview
DELETE
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.
apiKeyheader
AuthorizationBearer <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.
endpoint*stringThe endpoint id: the first segment of its run.vlayers.ai URL.
preview*stringThe preview id from GET /v1/endpoints/{endpoint}/previews.
The preview, now ended
application/json- response
id*stringFormat
uuidendpointId*stringagentId*stringFormat
uuidenvironment*stringValue in
"dev""stg""prd"versionId*stringFormat
uuidstate*stringValue in
"awake""asleep""ended"createdAt*stringFormat
date-timeexpiresAt*stringFormat
date-timelastRequestAt*|Format
date-timesleepsAt*|Format
date-timeendedAt*|Format
date-timeendedReason*|Value in
"expired""cap""customer""endpoint_gone"nullendedMessage*string|nullroutes*array<>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" } ]}