Take a source snapshot
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.
apiKeyAuthorizationBearer <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.
id*stringThe agent id.
application/json- body
version?integerTie the snapshot to this version number of the agent. Leave it out for a free-standing snapshot.
1 <= valuenote?stringA line kept with the snapshot (up to 500 characters).
length <= 500The snapshot taken
application/json- response
snapshot*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" }'{ "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" }}