Take a source snapshot

POST
/v1/agents/{id}/source/snapshots

Copies the working copy into a snapshot. Pass version to tie it to a hosted version of the agent (each version has one snapshot; a second is refused with 409 snapshot_exists_for_version). A file changed while the copy ran fails it with 409 changed_during_snapshot: take it again. An empty working copy is refused with 422. Deleting the version, the agent or the workspace deletes its snapshots.

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

id*string

The agent id.

Request Body

application/json
  1. body
version?integer

Tie the snapshot to this version number of the agent. Leave it out for a free-standing snapshot.

Range1 <= value
note?string

A line kept with the snapshot (up to 500 characters).

Lengthlength <= 500

Response Body

The snapshot taken

application/json
  1. response
snapshot*
Example Request
curl -X POST "https://api.vlayers.ai/v1/agents/$AGENT_ID/source/snapshots" \  -H "Authorization: Bearer $VOICELAYER_API_KEY" \  -H "Content-Type: application/json" \  -d '{    "note": "Before the refund change"  }'
Example Response
{  "snapshot": {    "id": "0192f5c1-5e6f-7a8b-9c0d-1e2f3a4b5c67",    "agentId": "0192f5c2-6f7a-7b9c-8d1e-2f3a4b5c6d78",    "versionId": null,    "version": null,    "note": "Before the refund change",    "fileCount": 1,    "totalBytes": 1204,    "manifestHash": "0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef",    "createdAt": "2026-10-20T15:04:05.000Z",    "createdBy": "user_2abc"  }}