> ## 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.

# Run post-call extraction (Test Analysis / replay)

> Re-runs post-call extraction against an existing session's stored transcript using the agent's CURRENT `extraction_config`. Useful after editing the config to backfill old sessions, or to test a config against real conversation data.

- `dry_run: true` — runs extraction, returns values, does NOT persist or re-fire the partner webhook
- `dry_run: false` (default) — persists to the session's `extraction` field; partner webhook is **not** re-fired.

Returns 400 when the agent has no `extraction_config` defined. Subject to the same partner rate-limit as `POST /calls/start`.



## OpenAPI

````yaml /openapi.json post /calls/{id}/extract
openapi: 3.1.0
info:
  title: Vocobase Partner API
  version: '2.0'
  description: >-
    API for managing voice AI agents, documents, and calls on the Vocobase
    platform.
servers:
  - url: https://api.vocobase.com/api/v2
    description: Production
security:
  - bearerAuth: []
tags:
  - name: Config
    description: >-
      Read and update partner configuration, webhook settings, and telephony
      credentials.
  - name: Agents
    description: Create, read, update, and delete voice AI agents.
  - name: Voices
    description: >-
      List voice tiers, available voices, and stream preview audio for agent
      configuration.
  - name: Documents
    description: Upload, manage, and delete knowledge base documents.
  - name: Agent Documents
    description: Link and unlink documents to agents for knowledge base integration.
  - name: Calls
    description: Initiate outbound calls and view call history.
  - name: Phone Numbers
    description: >-
      Import DIDs, assign agents for inbound routing, and re-sync carrier
      Application bindings.
  - name: Inbound Routing Policies
    description: >-
      Define pre-answer routing decisions for inbound calls before AI sessions
      are created.
  - name: Telephony Connections
    description: Create, list, rename, and disconnect named V2 telephony connections.
  - name: VoiceLink Management
    description: Manage VoiceLink reseller clients, DID mapping, and readiness sync.
  - name: Projects
    description: Organize agents into projects. Every agent belongs to exactly one project.
  - name: Dictionaries
    description: Speech-recognition dictionary CRUD and agent attachment.
  - name: Sessions
    description: Browser-initiated WebRTC voice sessions for in-app voice agents.
paths:
  /calls/{id}/extract:
    post:
      tags:
        - Calls
      summary: Run post-call extraction (Test Analysis / replay)
      description: >-
        Re-runs post-call extraction against an existing session's stored
        transcript using the agent's CURRENT `extraction_config`. Useful after
        editing the config to backfill old sessions, or to test a config against
        real conversation data.


        - `dry_run: true` — runs extraction, returns values, does NOT persist or
        re-fire the partner webhook

        - `dry_run: false` (default) — persists to the session's `extraction`
        field; partner webhook is **not** re-fired.


        Returns 400 when the agent has no `extraction_config` defined. Subject
        to the same partner rate-limit as `POST /calls/start`.
      operationId: runCallExtraction
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
            format: uuid
          description: Call ID.
      requestBody:
        required: false
        content:
          application/json:
            schema:
              type: object
              properties:
                dry_run:
                  type: boolean
                  default: false
                  description: >-
                    When true, return the extraction result without persisting
                    it.
      responses:
        '200':
          description: Extraction result.
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    const: true
                  data:
                    type: object
                    properties:
                      call_id:
                        type: string
                        format: uuid
                      session_id:
                        type: string
                        format: uuid
                      dry_run:
                        type: boolean
                      extraction:
                        $ref: '#/components/schemas/ExtractionResult'
        '400':
          description: Agent has no extraction_config defined.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                success: false
                error:
                  code: EXTRACTION_NOT_CONFIGURED
                  message: Agent has no extraction_config defined
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
        '429':
          $ref: '#/components/responses/RateLimitExceeded'
        '500':
          $ref: '#/components/responses/InternalError'
components:
  schemas:
    ExtractionResult:
      type: object
      description: >-
        Structured output of a single extraction run. Shipped inline in
        `session.completed` webhooks AND returned by `POST /calls/{id}/extract`.
      required:
        - status
        - model
        - extractedAt
        - latencyMs
        - attempts
      properties:
        status:
          type: string
          enum:
            - success
            - failed
            - skipped
        values:
          type: object
          additionalProperties: true
          description: >-
            Extracted fields, typed per the agent's `extraction_config.keys`.
            Missing keys are emitted as `null` (per-key `nullable: true` on the
            response schema). Absent entirely when `status != 'success'`.
        error:
          type: string
          description: Failure reason; present only when `status === 'failed'`.
        model:
          type: string
          description: >-
            Opaque extraction model identifier. Do not branch business logic on
            this value.
        extractedAt:
          type: string
          format: date-time
        latencyMs:
          type: integer
          description: LLM latency in milliseconds.
        attempts:
          type: integer
          description: Number of attempts (1 = success on first try; 2-3 = retried).
    ErrorResponse:
      type: object
      properties:
        success:
          type: boolean
          const: false
        error:
          type: object
          properties:
            code:
              type: string
            message:
              type: string
          required:
            - code
            - message
      required:
        - success
        - error
  responses:
    Unauthorized:
      description: Missing or invalid API key.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          example:
            success: false
            error:
              code: UNAUTHORIZED
              message: Invalid or missing API key
    NotFound:
      description: Resource not found.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          example:
            success: false
            error:
              code: NOT_FOUND
              message: Resource not found
    RateLimitExceeded:
      description: Per-partner rate limit exceeded. Retry after a short backoff.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          example:
            success: false
            error:
              code: RATE_LIMITED
              message: Rate limit exceeded. Retry after 60 seconds.
    InternalError:
      description: Unexpected server error.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          example:
            success: false
            error:
              code: INTERNAL_ERROR
              message: An unexpected error occurred
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: >-
        API key in format: `rg_live_xxxx`. Pass as a Bearer token in the
        Authorization header.

````