Skip to main content

Session store

Sellable product

This capability is granted by an API key scoped to the `` product (product face). See the product reference below.

Cross-modal conversation/session + transcript + recording-ref store as a shared capability. Consumers: voice (call history/transcript) + aakhara/anjaan (chat/roleplay session history) = >=2. INTERNAL (no product-face). Recording BYTES live in media-transcode/cdn; this cap stores the transcript + recording REFS only. Fail-closed: writes/reads return 503 when the store is unavailable.

  • Group: Voice & AI
  • Contract: contracts/session-store/v1/openapi.yaml
  • Public base: https://api.vagarylabs.com (the consolidated API gateway — one host, per-brand sibling api.<zone>)
  • Auth: a product API key (vgk_…) issued from the console — Authorization: Bearer vgk_…
  • Product face (customer-keyed):
    • https://api.vagarylabs.com/product/v1/session-store/sessions

Endpoints

MethodPathSummary
POST/v1/sessionsCreate a conversation/session (any modality)
GET/v1/sessionsList a tenant's sessions (keyset-paginated, most-recent first)
GET/v1/sessions/&#123;session_id&#125;Full session + ordered transcript + recording refs
DELETE/v1/sessions/&#123;session_id&#125;GDPR (Art.17) erasure — forget the session + transcript + recording REFS (IDOR-safe)
POST/v1/sessions/erase-subjectGDPR Art-17 SUBJECT-scoped erasure — forget every session belonging to one data subject
POST/v1/sessions/&#123;session_id&#125;/turnsAppend ordered transcript turns (server-assigned monotonic sequence)
GET/v1/sessions/&#123;session_id&#125;/transcriptTranscript export — the ordered turns of the session
POST/v1/sessions/&#123;session_id&#125;/recordingAttach a recording REF (pointer into media-transcode/cdn — never the bytes)
GET/v1/privacy/policyTHIS tenant's EFFECTIVE privacy policy and the features it voids. READ-ONLY by design — config-flags owns the WRITE (PUT /v1/settings/privacy/policy) and re-exposing a write here would create a second authority for one fact. This answers what the store will ACTUALLY do with the policy.
GET/healthliveness (db)
GET/metricsPrometheus exposition

Schemas

EraseSubjectResult

matched (sessions belonging to the subject) is reported separately from the deleted counts so a zero-match is visible to the compliance fan-out rather than reading as a successful erasure.

FieldTypeDescription
successboolean
capabilitystring
organization_idstring
dispositionstring
selectorstring
matchedintegersessions belonging to the subject
sessions_deletedinteger
turns_deletedintegertranscript rows removed with those sessions
recordings_deletedintegerrecording REFERENCES; blobs are purged by media-transcode/cdn
dry_runboolean
would_deleteobjectdry-run preview only

Error

FieldTypeDescription
errorstringstable machine code (slug), e.g. validation_error, not_found, unauthorized, internal
reasonstringhuman-readable one-line explanation (no secrets/PII)
detailobject
request_idstring

CreateSessionRequest

FieldTypeDescription
organization_idstringproduct-tier tenant (I6); resolved anti-spoof when identity is wired
modalitystringvoice
external_refstringproduct's own id (call_id / thread_id)
metadataobject

Session

FieldTypeDescription
idstring
organization_idstring
modalitystring
external_refstring
statusstringopen
turn_countinteger
metadataobject
created_atstring
updated_atstring

Turn

FieldTypeDescription
rolestringspeaker — user/assistant/system/caller/agent/…
contentstring
tsstringcaller event-time (ISO-8601); not the sort key
audio_refstringpointer to a media-transcode/cdn segment
seqintegerserver-assigned monotonic per-session order (response only)
metadataobject
created_atstring

AppendTurnsRequest

FieldTypeDescription
organization_idstring
turnsarray

AppendTurnsResponse

FieldTypeDescription
session_idstring
appendedinteger
turnsarray

Recording

FieldTypeDescription
idstring
recording_refstringref/URI into media-transcode/cdn (NOT the bytes)
media_typestring
duration_msinteger
provider_refstringprovider-side id (e.g. Twilio Recording SID)
metadataobject
created_atstring

Generated by scripts/gen-capability-docs.py from contracts/session-store/v1/openapi.yaml — the contract IS the source of truth; edit the contract, not this page.