Skip to main content

Mount a Memory Store to an Identity

Mount a Memory Store to an Identity and Template.

Mounts an existing Memory Store to an (identity, template) pair. Sessions created by that Identity with the Template then receive the Store's Memory content automatically. Repeated mounts: Calling again for the same Store updates its permission when access is supplied and preserves it when omitted. No duplicate mount is created; created_at remains the original mount time.

Path

POST /api/v1/forward/identities/{identity_id}/templates/{template_id}/memory_stores

Headers

HeaderRequiredDescription
AuthorizationYesBearer <PAT, admin SAT, or SAT for this Identity>
Content-TypeYesapplication/json
An Identity-level Service Account Token can only operate on its own Identity. Operating on another Identity returns 403.

Path parameters

ParameterTypeRequiredDescription
identity_idstringYesIdentity ID (idn_...).
template_idstringYesTemplate ID (tmpl_...).

Request body

FieldTypeRequiredDescription
memory_store_idstringYesID of the Memory Store to mount (memstore_...). It must be an active Store visible to the caller.
accessstringNoread_only or read_write. If omitted, new mounts default to read_only and existing mounts retain their current permission.

Example request

curl -X POST "https://api.qoder.com/api/v1/forward/identities/idn_63ee28747a35cff93771c491/templates/tmpl_eb3377fb74ad413e17b3d755/memory_stores" \
  -H "Authorization: Bearer $QODER_ACCESS_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "memory_store_id": "memstore_00mc7mukn7lkxr454tjd",
    "access": "read_write"
  }'

Example response

HTTP 200 OK
{
  "memory_store_id": "memstore_00mc7mukn7lkxr454tjd",
  "identity_id": "idn_63ee28747a35cff93771c491",
  "template_id": "tmpl_eb3377fb74ad413e17b3d755",
  "access": "read_write",
  "system_managed": false,
  "name": "team-a",
  "status": "active",
  "entry_count": 12,
  "created_at": "2026-08-14T10:00:00Z"
}

Response

Returns a Memory Store mount object.

Notes

When multiple Stores are mounted, the Agent sees the Memories from all Stores merged into a flat namespace by path. Identical paths can shadow each other. See Visibility in a Session. Mount and permission changes apply to Sessions created afterward; existing Sessions are not updated automatically.

Errors

HTTPTypeTrigger
400invalid_request_errorInvalid memory_store_id or access, an archived Store, or an attempt to make the system-managed default Store read-only.
401authentication_errorThe authentication token is missing or invalid.
403permission_errorAn Identity-level SAT tried to operate on another Identity.
404not_found_errorThe Identity, Template, or Memory Store does not exist or is not visible.
500/502/503api_errorForward or a dependent service failed.