Write a stored document

PUT
/v1/agents/{id}/store/{collection}/docs/{docId}

Creates or replaces one document. Each field the manifest declares must have its type. A document over the plan's size limit, a collection over its document limit or a workspace over its store limit is refused with 413 and the limit named. Fields the manifest marks indexed are also kept so you can query on them; one marked personal is indexed only as a keyed hash.

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.

collection*string

The collection id.

docId*string

The document id.

Request Body

application/json
  1. body
value*

The document: a JSON object. It may not hold a key named $spans.

Response Body

The document replaced

application/json
  1. response
document*
created*boolean
Example Request
curl -X PUT "https://api.vlayers.ai/v1/agents/$AGENT_ID/store/$COLLECTION/docs/$DOC_ID" \  -H "Authorization: Bearer $VOICELAYER_API_KEY" \  -H "Content-Type: application/json" \  -d '{    "value": {      "status": "open",      "total": 42    }  }'
Example Response
{  "document": {    "collection": "orders",    "id": "order-1001",    "value": {      "status": "open",      "total": 42    },    "updatedAt": "2026-10-20T15:04:05.000Z"  },  "created": true}