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

# List or fetch call sessions (call logs)

> **Full URL:** `GET https://api.kupe.in/api/v1/call-analytics`

- **`request_id`**: one session by internal request id (404 if not found).
- **`page` + `page_size`**: paginated `{ items, total, page, page_size }`.
- **Neither**: full list (subject to `call_analytics` / `call_logs` feature flags).

Query **`filter`**: search request id or call type. Super-admins may pass `scope`, `organization_ids`,
`owner_user_ids`, `platform_roles`, etc., per backend support.

Session JSON may include **`post_call_analysis_results`** and related fields when not HIPAA-redacted.




## OpenAPI

````yaml /api-reference/kupe-voice-agent.openapi.yaml get /api/v1/call-analytics
openapi: 3.1.0
info:
  title: Kupe Voice Agent API
  description: >
    **Production base URL:** `https://api.kupe.in` — prepend it to each **path**
    below to get the full request URL.


    | Path | Full URL |

    |------|----------|

    | `GET /health` | `https://api.kupe.in/health` |

    | `GET /api/v1/me` | `https://api.kupe.in/api/v1/me` (requires `x-api-key`
    **or** `Authorization: Bearer`) |

    | `GET /api/v1/me/users` | `https://api.kupe.in/api/v1/me/users` |

    | `GET /api/v1/phone` | `https://api.kupe.in/api/v1/phone` (all provisioned
    phone lines) |

    | `POST /api/v1/phone/mapping` | `https://api.kupe.in/api/v1/phone/mapping`
    (inbound line → agent/workflow) |

    | `GET /api/v1/agents` | `https://api.kupe.in/api/v1/agents` |

    | `POST /api/v1/agents` | `https://api.kupe.in/api/v1/agents` (full create;
    optional `agent_specific_config`) |

    | `POST /api/v1/agents/simple` | `https://api.kupe.in/api/v1/agents/simple`
    |

    | `GET/PUT/DELETE /api/v1/agents/{agent_id}` |
    `https://api.kupe.in/api/v1/agents/{agent_id}` |

    | `GET /api/v1/providers/model` |
    `https://api.kupe.in/api/v1/providers/model` |

    | `GET /api/v1/providers/tts` | `https://api.kupe.in/api/v1/providers/tts` |

    | `GET /api/v1/providers/stt` | `https://api.kupe.in/api/v1/providers/stt` |

    | `GET /api/v1/providers/all` | `https://api.kupe.in/api/v1/providers/all` |

    | `GET /api/v1/tts-voices` | `https://api.kupe.in/api/v1/tts-voices` |

    | `GET /api/v1/noise-assets` | `https://api.kupe.in/api/v1/noise-assets`
    (background noise catalog) |

    | `POST /api/call/create_call` | `https://api.kupe.in/api/call/create_call`
    |

    | `POST /api/v1/batch-call/create` | Create outbound batch campaign |

    | `POST /api/v1/batch-call/upload-json/{batch_id}` | Add target numbers
    (JSON) |

    | `POST /api/v1/batch-call/start/{batch_id}` | Launch batch campaign |

    | `GET /api/v1/batch-call/{batch_id}/status` | Batch + per-number status
    counts |

    | `POST /api/v1/files/upload` | `https://api.kupe.in/api/v1/files/upload` |

    | `GET /api/v1/files/supported-formats` |
    `https://api.kupe.in/api/v1/files/supported-formats` |

    | `GET /api/v1/files/user/me` | `https://api.kupe.in/api/v1/files/user/me` |

    | `GET/DELETE /api/v1/files/{file_id}` |
    `https://api.kupe.in/api/v1/files/{file_id}` |

    | `POST /api/v1/agent-files-mappings/create` |
    `https://api.kupe.in/api/v1/agent-files-mappings/create` |

    | `GET /api/v1/agent-files-mappings/agent/{agent_id}` |
    `https://api.kupe.in/api/v1/agent-files-mappings/agent/{agent_id}` |

    | `DELETE .../agent/{agent_id}/file/{upload_file_id}` |
    `https://api.kupe.in/api/v1/agent-files-mappings/agent/{agent_id}/file/{upload_file_id}`
    |

    | `POST /api/v1/search/semantic` |
    `https://api.kupe.in/api/v1/search/semantic` |

    | `POST /api/v1/search/hybrid` | `https://api.kupe.in/api/v1/search/hybrid`
    |

    | `GET /api/v1/call-analytics` | `https://api.kupe.in/api/v1/call-analytics`
    (list / `page`+`page_size` / `?request_id=` one session) |

    | `GET /api/v1/call-analytics/export` | Export call logs (ZIP); query
    `request_id` or date range |

    | `GET /api/v1/billing/credit-balance` |
    `https://api.kupe.in/api/v1/billing/credit-balance` (summary; wallet-backed)
    |

    | `GET /api/v1/wallets/me` | `https://api.kupe.in/api/v1/wallets/me` (full
    wallet summary for the authenticated user) |

    | `GET /api/v1/wallets/{wallet_id}` | Wallet detail: grants + ledger (RBAC)
    |

    | `GET /api/v1/earnings/me` | Reseller org earnings summary (`period` query)
    |

    | `GET /api/v1/billing/usage/records` | Usage grouped by session (cost,
    duration, agent) |

    | `GET /api/v1/billing/usage/export` | Export usage (CSV/JSON per backend) |

    | `GET /api/v1/billing/usage/summary` | Aggregated usage for charts |

    | `GET /api/v1/billing/usage/overview` | Total and this-month usage totals |

    | `GET /api/v1/billing/usage-records` | Usage organized by call sessions |

    | `GET /api/v1/tool-endpoint-defs` | List or create HTTP tool definitions |

    | `GET /api/v1/tools-mcp-server-defs` | List or create MCP server tool
    definitions |

    | `GET/POST/PATCH /api/v1/agents/{agent_id}/tools` | Agent tool mappings |


    **Try it / API playground:** Response bodies use **schemas** (and prose on
    each operation) so the playground shows your **live** result after **Send**,
    without a second static “example response” panel duplicating the same JSON.
    Illustrative JSON still appears **in the page text** where noted (for
    example `GET /health`).


    **Errors** from the FastAPI backend are typically `{ "detail": "…" }` — see
    `ErrorDetail` in **Schemas**.


    REST APIs for voice agents, providers, outbound PSTN calls, knowledge (files
    + RAG), and **documented webhook payloads**

    your server receives when you configure post-call HTTP integrations.


    **Field mapping (client spec):** `name` → `agent.name`; `prompt` →
    `agent_model_config.system_prompt`;

    `transcriber` / `model` / `voice` → nested configs on **`PUT
    /api/v1/agents/{agent_id}`** (after **`POST /api/v1/agents/simple`**);
    `call_type` inbound/outbound →

    dashboard phone mapping + `POST /api/call/create_call`;
    `extracted_variables` → post-analysis structured output;

    `context_params` → bring your own telephony metadata (stock outbound uses
    query params).


    **LLM / TTS / STT:** pass **catalog codes** (`model_name`, `provider_name`,
    or `provider:model_name` for TTS) or row UUIDs — the API **resolves codes to
    internal ids** before save (never send arbitrary strings as UUIDs). VAD and
    inferencing toggles are **not** in the default create body; the platform
    applies defaults. See [Model providers](/assistants/model-providers) and
    [Supported models & providers](/supported-models).
  version: 1.0.0
servers:
  - url: https://api.kupe.in
    description: Production
security:
  - KupeApiKey: []
tags:
  - name: Service
    description: Public health check and authenticated **current user** profile.
  - name: Current user
    description: >-
      Signed-in user details (`GET /api/v1/me`) and accessible users (`GET
      /api/v1/me/users`).
  - name: Agent Management
    description: List, create (defaults), read, update, and delete voice agents.
  - name: Providers
    description: LLM, TTS, and STT catalogs plus TTS voice rows (`GET /api/v1/tts-voices`).
  - name: Noise Assets
    description: >
      Catalog of outbound **background noise** WAV assets (`GET
      /api/v1/noise-assets`). Use each row's **`id`** as
      **`agent_specific_config.background_noise_id`** when creating or updating
      an agent.
  - name: Phone numbers
    description: >
      List all provisioned **phone_numbers** rows (`GET /api/v1/phone`). Use
      each row’s **`id`** as **`phone_number_id`** for inbound mapping and
      outbound calls. Prefer **E.164** numbers where possible.
  - name: Incoming calls
    description: >
      Map an assistant or workflow to a **purchased phone line** so inbound PSTN
      hits the right runtime. Use **E.164** numbers where possible (e.g.
      **+91**… for India, **+1**… for the US).
  - name: Outbound calls
    description: >
      Initiate outbound PSTN calls (`POST /api/call/create_call`). Authenticate
      with **`x-api-key`** or **Bearer**; user is inferred from auth only;
      response includes `request_id` and `call_session_id`.
  - name: Batch calling
    description: >
      Outbound **campaigns**: create a batch (agent + caller line), upload or
      upsert target numbers with template variables, launch dialing in waves
      (`batch_size`), and poll status per recipient and for the whole batch.
      Base path **`/api/v1/batch-call`**. Requires the **outbound** feature flag
      on your account.
  - name: Knowledge base
    description: Files, agent–file mappings, and semantic or hybrid RAG search.
  - name: Call logs
    description: >
      Call session analytics: list, pagination, single session by `request_id`,
      and exports. Responses may include `post_call_analysis_results` when
      policy allows.
  - name: Billing and usage
    description: >
      Usage records, summaries, exports, and **`GET /billing/credit-balance`**
      (wallet-backed balance summary). Self-serve checkout, Razorpay,
      pricing-plan catalog, and **`/billing/balance-history`** are not part of
      the API anymore. With **`x-api-key`**, only **GET** (and HEAD/OPTIONS) are
      allowed on `/api/v1/billing/**`.
  - name: Wallets
    description: >
      Unified wallets: materialized balance, credit grants, append-only ledger,
      monthly caps, and admin credit assignment. **POST** routes require a
      **Bearer** session with org-admin or super-admin permissions.
  - name: Earnings
    description: >
      Markup and commission summaries for **channel_partner** and
      **distributor** organizations (`GET /earnings/me`, breakdown, super-admin
      org view).
  - name: Post-call analysis
    description: >
      User-scoped analysis rules (`/api/v1/post-analysis/rules`) and mapping
      rules to agents (`/api/v1/agents/{agent_id}/post-analysis`).
  - name: Tools and MCP
    description: >
      Custom HTTP tool definitions, MCP server definitions, and attaching tools
      to agents (`/api/v1/agents/{agent_id}/tools`).
  - name: API keys
    description: Create, list, rename (label), and revoke Kupe API keys for integrations.
  - name: Webhooks
    description: >-
      Example payloads Kupe can POST to **your** HTTPS URL (post-analysis HTTP
      tool).
paths:
  /api/v1/call-analytics:
    get:
      tags:
        - Call logs
      summary: List or fetch call sessions (call logs)
      description: >
        **Full URL:** `GET https://api.kupe.in/api/v1/call-analytics`


        - **`request_id`**: one session by internal request id (404 if not
        found).

        - **`page` + `page_size`**: paginated `{ items, total, page, page_size
        }`.

        - **Neither**: full list (subject to `call_analytics` / `call_logs`
        feature flags).


        Query **`filter`**: search request id or call type. Super-admins may
        pass `scope`, `organization_ids`,

        `owner_user_ids`, `platform_roles`, etc., per backend support.


        Session JSON may include **`post_call_analysis_results`** and related
        fields when not HIPAA-redacted.
      operationId: getCallAnalytics
      parameters:
        - name: request_id
          in: query
          schema:
            type: string
          description: When set, return exactly one session.
        - name: page
          in: query
          schema:
            type: integer
            minimum: 1
        - name: page_size
          in: query
          schema:
            type: integer
            minimum: 1
            maximum: 100
        - name: filter
          in: query
          schema:
            type: string
          description: Search request_id or call type (alias for backend `search_filter`).
        - name: scope
          in: query
          schema:
            type: string
        - name: organization_ids
          in: query
          schema:
            type: string
        - name: owner_user_ids
          in: query
          schema:
            type: string
      responses:
        '200':
          description: One session, paginated wrapper, or array — see backend behavior.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ArbitraryJson'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorDetail'
        '403':
          description: Feature disabled or forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorDetail'
        '404':
          description: Session not found (when `request_id` set)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorDetail'
components:
  schemas:
    ArbitraryJson:
      type: object
      additionalProperties: true
      description: >
        Deployment-specific JSON (call sessions, billing views, tool defs). See
        prose on each operation and the **Platform REST APIs** guide page.
    ErrorDetail:
      type: object
      properties:
        detail:
          type: string
          example: 'Forbidden: API Key does not have required scopes'
  securitySchemes:
    KupeApiKey:
      type: apiKey
      in: header
      name: x-api-key
      description: Kupe dashboard API key for your user.
      x-default: YOUR_KUPE_API_KEY

````