Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.vocobase.com/llms.txt

Use this file to discover all available pages before exploring further.

Post-call Extraction

Post-call extraction lets you define a Custom Analysis schema (a free-form prompt + typed keys) once on the agent. After every completed call, the platform runs a structured-output LLM over the transcript and ships the extracted values inline in the same session.completed webhook — no second webhook to handle.
Partner API (v2) only for the endpoints below.

1. Define the Custom Analysis schema

PUT /api/v2/agent/{id}
Authorization: Bearer rg_live_...
Content-Type: application/json

{
  "extraction_config": {
    "prompt": "Analyze the conversation and extract the caller's intent, sentiment, and any commitments made.",
    "keys": [
      { "name": "interested", "type": "boolean", "description": "Did the user express interest in our offering?" },
      { "name": "callback_at", "type": "datetime", "description": "ISO timestamp if the user requested a callback; null otherwise." },
      { "name": "outcome", "type": "string", "description": "One of: callback_requested, sale_made, not_interested, voicemail, no_answer." }
    ],
    "includeToolLogs": false
  }
}
Pass extraction_config: null to disable extraction.

Supported types

TypeMaps toNotes
stringtextDefault.
numberfloat
integerint
booleantrue / false
arraystring[]v1: array of strings.
dateISO 8601 dateYYYY-MM-DD
datetimeISO 8601 timestampYYYY-MM-DDTHH:MM:SSZ
Each configured key is returned in the extraction result. When a value cannot be found, Vocobase returns null for that key so partners receive a consistent object shape.

2. Receive results in the webhook

After every completed call where the agent has an extraction_config, Vocobase runs extraction and ships the result inline in session.completed:
{
  "event": "session.completed",
  "data": {
    "session_id": "...",
    "transcript": [...],
    "recording_url": "...",
    "variables": {...},
    "extraction": {
      "status": "success",
      "values": {
        "interested": true,
        "callback_at": "2026-05-01T15:00:00Z",
        "outcome": "callback_requested"
      },
      "model": "vocobase-managed",
      "extractedAt": "2026-03-15T14:32:09.840Z",
      "latencyMs": 1840,
      "attempts": 1
    }
  }
}
See Webhook Payloads for the full payload shape.

3. Read results via the API

GET /api/v2/calls/{call_id}
Returns the same extraction object on data.session.extraction. Useful for partners that prefer polling over webhooks, or for backfilling values into a CRM after the fact.

4. Replay extraction against past calls

Edited the prompt or added a new key? Backfill any past session by replaying the extractor:
POST /api/v2/calls/{call_id}/extract
Authorization: Bearer rg_live_...
Content-Type: application/json

{ "dry_run": false }
dry_run: true returns the values without persisting and without re-firing the partner webhook (useful for prompt iteration). The replay always uses the agent’s current extraction_config, not the config at original-call time. Returns 400 when the agent has no extraction_config defined.

Failure semantics

Extraction failures never block webhook delivery. The session.completed payload always ships, with extraction.status indicating outcome:
StatusMeaning
successExtraction completed; values is present and typed per keys.
failedExtraction could not be completed; error field describes what broke.
skippedNo transcript available (e.g., no-answer call, instant disconnect).
Partners that need extracted values can branch on status === 'success'; partners that just need transcript + recording can ignore the field entirely.

Next steps

Pre-call Variables

Template the agent’s prompt and greeting with per-call values via {{name}} placeholders.

Webhook Payloads

Full reference for the session.completed payload, including the extraction block.