> ## Documentation Index
> Fetch the complete documentation index at: https://docs.talkpilot.io/llms.txt
> Use this file to discover all available pages before exploring further.

# List performance records

> Returns the QA/performance records (`call_statistics`) for the specified
agent — latencies, token stats, pipeline configuration and redflags.
Results are ordered by `created_at` descending (newest first).

The transcript is **not** included here: use
`GET /v1/agents/{agentId}/performance/{statisticId}` for a single record
with its transcript. Internal debug logs are never returned.

Requires the `performance:read` permission. With Dashboard JWT auth this
endpoint is restricted to the `super_admin`, `dev_admin` and
`dev_employee` roles, mirroring the Dashboard's Performance Analysis page.




## OpenAPI

````yaml get /v1/agents/{agentId}/performance
openapi: 3.1.0
info:
  title: TalkPilot API
  version: 1.0.0
  description: >
    The TalkPilot API allows you to programmatically manage your call center
    agents,

    employees, forwarding slots, knowledge base, and more.


    ## Authentication


    All API requests require an API key passed via the `X-API-Key` header:


    ```

    X-API-Key: tp_live_abc123def456...

    ```


    An API key can reach every organization its creator is a member of (see

    `GET /v1/organization`) and can be restricted to specific agents and
    permissions.

    Create and manage keys in the TalkPilot Dashboard under **Settings > API**

    (Dev-Admin only).


    ## Rate Limiting


    Default limits per API key: **60 requests/minute** and **1,000
    requests/hour**

    (both enforced, both configurable per key).


    Rate limit headers are included in every response to a request authenticated

    with an API key (Dashboard JWT requests are not rate limited):

    - `X-RateLimit-Limit` — Max requests per minute

    - `X-RateLimit-Remaining` — Remaining requests in the current minute window

    - `X-RateLimit-Reset` — Unix timestamp roughly 60 seconds in the future


    When rate limited, the API returns `429 Too Many Requests` with
    `Retry-After: 60`

    (minute window) or `Retry-After: 3600` (hour window).


    ## Pagination


    List endpoints support pagination via query parameters:

    - `page` — Page number (default: 1)

    - `limit` — Items per page (default: 20, max: 100)


    Paginated responses include a `pagination` object with `page`, `limit`,
    `total`, and `pages`.


    ## Error Format


    All errors follow a consistent format:


    ```json

    {
      "error": {
        "code": "VALIDATION_ERROR",
        "message": "Human-readable description",
        "details": [{ "field": "name", "message": "Required" }],
        "request_id": "req_abc123"
      }
    }

    ```
  contact:
    name: TalkPilot Support
    email: support@talkpilot.io
  license:
    name: Proprietary
    identifier: LicenseRef-Proprietary
servers:
  - url: https://api.talkpilot.io
    description: Production
security:
  - apiKey: []
tags:
  - name: Health
    description: API health and status
  - name: Agents
    description: Manage AI agent configurations
  - name: Workflow
    description: Multi-state conversation flow of an agent
  - name: Tools
    description: Manage agent tools (HTTP requests, call transfers, etc.)
  - name: Employees
    description: Manage employees linked to agents
  - name: Contacts
    description: >-
      Customer contacts (customer_database) per agent — the voice agent
      recognises callers and greets them by name or tag from here
  - name: Forwarding Slots
    description: Manage call forwarding slot assignments
  - name: Knowledge Base
    description: Manage agent knowledge base documents
  - name: Calls
    description: Read call records and transcripts
  - name: Performance
    description: >-
      Read call performance/QA data (latencies, token stats, redflags,
      transcript incl. tool calls)
  - name: Organization
    description: Organization-level settings
  - name: API Keys
    description: Manage API keys (Dashboard JWT auth only; dev_admin)
paths:
  /v1/agents/{agentId}/performance:
    get:
      tags:
        - Performance
      summary: List performance records
      description: >
        Returns the QA/performance records (`call_statistics`) for the specified

        agent — latencies, token stats, pipeline configuration and redflags.

        Results are ordered by `created_at` descending (newest first).


        The transcript is **not** included here: use

        `GET /v1/agents/{agentId}/performance/{statisticId}` for a single record

        with its transcript. Internal debug logs are never returned.


        Requires the `performance:read` permission. With Dashboard JWT auth this

        endpoint is restricted to the `super_admin`, `dev_admin` and

        `dev_employee` roles, mirroring the Dashboard's Performance Analysis
        page.
      operationId: listPerformanceRecords
      parameters:
        - $ref: '#/components/parameters/AgentId'
        - $ref: '#/components/parameters/PageParam'
        - $ref: '#/components/parameters/LimitParam'
        - name: from
          in: query
          description: Filter records created after this date (ISO 8601)
          schema:
            type: string
            format: date-time
        - name: to
          in: query
          description: Filter records created before this date (ISO 8601)
          schema:
            type: string
            format: date-time
      responses:
        '200':
          description: List of performance records
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: array
                    items:
                      $ref: '#/components/schemas/PerformanceRecord'
                  pagination:
                    $ref: '#/components/schemas/Pagination'
              example:
                data:
                  - id: 9f1c2d3e-4a5b-6c7d-8e9f-0a1b2c3d4e5f
                    call_id: lk_call_abc123
                    caller_phone: '+491701234567'
                    agent_phone_number: '+4930123456'
                    agent_id: 550e8400-e29b-41d4-a716-446655440000
                    duration_seconds: 184
                    disconnect_reason: user_hangup
                    session_status: completed
                    e2e_latency_p90: 1.42
                    e2e_latency_median: 0.98
                    e2e_latency_min: 0.61
                    transcription_latency_p90: 0.31
                    transcription_latency_median: 0.22
                    transcription_latency_min: 0.14
                    llm_latency_p90: 0.82
                    llm_latency_median: 0.55
                    llm_latency_min: 0.33
                    tts_latency_p90: 0.29
                    tts_latency_median: 0.21
                    tts_latency_min: 0.12
                    llm_total_tokens: 4820
                    llm_prompt_tokens: 4120
                    llm_completion_tokens: 700
                    pre_call_variables:
                      caller_name: Hans Meier
                    extracted_variables:
                      appointment_date: '2026-04-02'
                    llm_provider: openai
                    llm_model: gpt-4o-mini
                    tts_provider: elevenlabs
                    stt: deepgram
                    pipeline_mode: stt_llm_tts
                    created_at: '2026-03-19T10:30:00Z'
                    final_result:
                      outcome: true
                      outcome_label: success
                      final_score: 8
                      summary_reasoning: Termin erfolgreich vereinbart, keine Rueckfragen offen.
                    prompt_fingerprint: >-
                      3b1f0c9d8e7a6b5c4d3e2f1a0b9c8d7e6f5a4b3c2d1e0f9a8b7c6d5e4f3a2b1c
                    assistant_misunderstood_multiple_times:
                      detected: false
                      reasoning: Keine Rueckfragen des Assistenten notwendig.
                      score_impact: 0
                    repeated_same_sentence:
                      detected: false
                      reasoning: Keine Wiederholungen erkannt.
                      score_impact: 0
                    abrupt_end_without_goodbye:
                      detected: false
                      reasoning: Gespraech wurde regulaer beendet.
                      score_impact: 0
                    connection_issue_repeated:
                      detected: false
                      reasoning: Stabile Verbindung.
                      score_impact: 0
                    assistant_policy_violation:
                      detected: false
                      reasoning: Keine Richtlinienverstoesse.
                      score_impact: 0
                    technical_error:
                      detected: false
                      reasoning: Keine technischen Fehler.
                      score_impact: 0
                    early_hangup_by_caller:
                      detected: false
                      reasoning: Anrufer blieb bis zum Ende in der Leitung.
                      score_impact: 0
                pagination:
                  page: 1
                  limit: 20
                  total: 342
                  pages: 18
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '429':
          $ref: '#/components/responses/RateLimited'
components:
  parameters:
    AgentId:
      name: agentId
      in: path
      required: true
      description: Agent UUID
      schema:
        type: string
        format: uuid
    PageParam:
      name: page
      in: query
      description: Page number
      schema:
        type: integer
        minimum: 1
        default: 1
    LimitParam:
      name: limit
      in: query
      description: Items per page
      schema:
        type: integer
        minimum: 1
        maximum: 100
        default: 20
  schemas:
    PerformanceRecord:
      type: object
      description: >-
        Performance/QA record of one call (list view — no transcript, no
        internal debug logs)
      properties:
        id:
          type: string
          format: uuid
        call_id:
          type: string
          description: External call ID (e.g. LiveKit) — links to the `calls` resource
        caller_phone:
          type:
            - string
            - 'null'
        agent_phone_number:
          type:
            - string
            - 'null'
        agent_id:
          type:
            - string
            - 'null'
          format: uuid
        duration_seconds:
          type: integer
          description: Call duration in seconds
        disconnect_reason:
          type:
            - string
            - 'null'
        session_status:
          type:
            - string
            - 'null'
        e2e_latency_p90:
          type:
            - number
            - 'null'
          description: End-to-end response latency, 90th percentile (seconds)
        e2e_latency_median:
          type:
            - number
            - 'null'
        e2e_latency_min:
          type:
            - number
            - 'null'
        transcription_latency_p90:
          type:
            - number
            - 'null'
          description: Speech-to-text latency, 90th percentile (seconds)
        transcription_latency_median:
          type:
            - number
            - 'null'
        transcription_latency_min:
          type:
            - number
            - 'null'
        llm_latency_p90:
          type:
            - number
            - 'null'
          description: Language model latency, 90th percentile (seconds)
        llm_latency_median:
          type:
            - number
            - 'null'
        llm_latency_min:
          type:
            - number
            - 'null'
        tts_latency_p90:
          type:
            - number
            - 'null'
          description: Text-to-speech latency, 90th percentile (seconds)
        tts_latency_median:
          type:
            - number
            - 'null'
        tts_latency_min:
          type:
            - number
            - 'null'
        llm_total_tokens:
          type:
            - integer
            - 'null'
        llm_prompt_tokens:
          type:
            - integer
            - 'null'
        llm_completion_tokens:
          type:
            - integer
            - 'null'
        pre_call_variables:
          type:
            - object
            - 'null'
          additionalProperties: true
          description: Variables handed to the agent before the call started
        extracted_variables:
          type:
            - object
            - 'null'
          additionalProperties: true
          description: Variables the agent extracted during the call
        llm_provider:
          type:
            - string
            - 'null'
        llm_model:
          type:
            - string
            - 'null'
        tts_provider:
          type:
            - string
            - 'null'
        stt:
          type:
            - string
            - 'null'
          description: Speech-to-text provider
        pipeline_mode:
          type:
            - string
            - 'null'
        created_at:
          type:
            - string
            - 'null'
          format: date-time
        final_result:
          oneOf:
            - $ref: '#/components/schemas/PerformanceFinalResult'
            - type: 'null'
        prompt_fingerprint:
          type:
            - string
            - 'null'
          description: >-
            SHA-256 of the prompt template used — groups calls of the same
            prompt version
        assistant_misunderstood_multiple_times:
          oneOf:
            - $ref: '#/components/schemas/FailureCause'
            - type: 'null'
        repeated_same_sentence:
          oneOf:
            - $ref: '#/components/schemas/FailureCause'
            - type: 'null'
        abrupt_end_without_goodbye:
          oneOf:
            - $ref: '#/components/schemas/FailureCause'
            - type: 'null'
        connection_issue_repeated:
          oneOf:
            - $ref: '#/components/schemas/FailureCause'
            - type: 'null'
        assistant_policy_violation:
          oneOf:
            - $ref: '#/components/schemas/FailureCause'
            - type: 'null'
        technical_error:
          oneOf:
            - $ref: '#/components/schemas/FailureCause'
            - type: 'null'
        early_hangup_by_caller:
          oneOf:
            - $ref: '#/components/schemas/FailureCause'
            - type: 'null'
    Pagination:
      type: object
      properties:
        page:
          type: integer
        limit:
          type: integer
        total:
          type: integer
        pages:
          type: integer
    PerformanceFinalResult:
      type: object
      description: Overall automated evaluation of the call
      properties:
        outcome:
          type:
            - boolean
            - 'null'
        outcome_label:
          type: string
          enum:
            - success
            - failed
            - neutral
        final_score:
          type: number
          description: Overall quality score of the call
        summary_reasoning:
          type: string
    FailureCause:
      type: object
      description: |
        Automated QA assessment of a single failure pattern ("redflag").
        Written by the analysis pipeline, not by the caller.
      properties:
        detected:
          type: boolean
          description: Whether this failure pattern occurred in the call
        reasoning:
          type: string
          description: Short explanation of the assessment
        score_impact:
          type: number
          description: How strongly this pattern lowered the final score
    Error:
      type: object
      required:
        - error
      properties:
        error:
          type: object
          required:
            - code
            - message
            - request_id
          properties:
            code:
              type: string
              enum:
                - VALIDATION_ERROR
                - UNAUTHORIZED
                - FORBIDDEN
                - AGENT_NOT_ACCESSIBLE
                - NOT_FOUND
                - CONFLICT
                - AGENT_HAS_NUMBER
                - POOL_EMPTY
                - NOT_POOL_NUMBER
                - RATE_LIMITED
                - INTERNAL_ERROR
            message:
              type: string
            details:
              type: array
              items:
                type: object
                properties:
                  field:
                    type: string
                  message:
                    type: string
            request_id:
              type: string
  responses:
    Unauthorized:
      description: Missing or invalid authentication
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error:
              code: UNAUTHORIZED
              message: Invalid or missing API key
              request_id: req_abc123
    Forbidden:
      description: >
        Insufficient permissions (`FORBIDDEN`), or the agent is outside the
        key's

        `allowed_agent_ids` (`AGENT_NOT_ACCESSIBLE`)
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          examples:
            missingPermission:
              value:
                error:
                  code: FORBIDDEN
                  message: 'API key lacks required permission: agents:write'
                  request_id: req_abc123
            agentNotAccessible:
              value:
                error:
                  code: AGENT_NOT_ACCESSIBLE
                  message: API key does not have access to this agent
                  request_id: req_abc123
    RateLimited:
      description: Too many requests for this API key (60/minute or 1,000/hour by default)
      headers:
        Retry-After:
          description: >-
            Seconds to wait before retrying — 60 for the minute window, 3600 for
            the hour window
          schema:
            type: integer
        X-RateLimit-Limit:
          schema:
            type: integer
        X-RateLimit-Remaining:
          schema:
            type: integer
        X-RateLimit-Reset:
          schema:
            type: integer
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error:
              code: RATE_LIMITED
              message: Rate limit exceeded. Try again in 60 seconds.
              request_id: req_abc123
  securitySchemes:
    apiKey:
      type: apiKey
      in: header
      name: X-API-Key
      description: |
        API key for external access. Format: `tp_live_<32-hex-chars>`.
        Create keys in the TalkPilot Dashboard under Settings > API.

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.