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

# Upload a call

> Provider-agnostic call ingestion. POST a call in Zelto's canonical shape (the default), or a native Vapi/Retell webhook payload selected with the `X-Zelto-Provider` header. The delivery is acknowledged immediately and processed asynchronously into a conversation + transcript. Deduplicated by call id: re-uploading the same call updates it in place and never double-charges. Non-terminal native events (e.g. Vapi `status-update`) are accepted and ignored.



## OpenAPI

````yaml /docs-openapi.json post /webhooks/calls
openapi: 3.1.0
info:
  title: Zelto REST API
  version: v1
  description: >-
    Programmatic access to your Zelto organization. Every endpoint is scoped to
    the organization the API key belongs to. Mint a key at Settings →
    Integrations → API Call Upload.
servers:
  - url: https://api.zelto.ai
    description: Production
security:
  - bearerAuth: []
tags:
  - name: Agents
    description: Voice and chat bots normalised through Zelto's ingestion pipeline.
  - name: Conversations
    description: Calls, chats, and voicemails — plus their transcripts and recordings.
  - name: Customer Metrics
    description: >-
      Customer-provided evaluations attached to a call (requires metrics
      enabled).
  - name: Reviews
    description: Human review state for conversations.
  - name: Buckets
    description: Reviewer routing — group conversations for batched review.
  - name: Findings
    description: >-
      Structured issues discovered during analysis, with optional conversation
      attachments and comments.
  - name: Organizations
    description: >-
      Headless org provisioning. Requires an admin/service API key (not a
      read-only org-scoped customer key).
paths:
  /webhooks/calls:
    post:
      tags:
        - Conversations
      summary: Upload a call
      description: >-
        Provider-agnostic call ingestion. POST a call in Zelto's canonical shape
        (the default), or a native Vapi/Retell webhook payload selected with the
        `X-Zelto-Provider` header. The delivery is acknowledged immediately and
        processed asynchronously into a conversation + transcript. Deduplicated
        by call id: re-uploading the same call updates it in place and never
        double-charges. Non-terminal native events (e.g. Vapi `status-update`)
        are accepted and ignored.
      operationId: uploadCall
      parameters:
        - name: X-Zelto-Provider
          in: header
          required: false
          description: >-
            Which schema the request body uses. Defaults to `zelto` (the
            canonical CallIngest shape, also used by `livekit`). Native `vapi` /
            `retell` webhook payloads are also accepted.
          schema:
            type: string
            enum:
              - zelto
              - vapi
              - retell
              - livekit
            default: zelto
      requestBody:
        required: true
        description: >-
          When `X-Zelto-Provider` is `zelto` (or omitted), the canonical
          CallIngest body. When `vapi` / `retell`, that provider's native
          webhook payload.
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CallIngest'
      responses:
        '200':
          description: >-
            Accepted for processing. Also returned for duplicate deliveries and
            dropped (non-terminal) events.
          content:
            application/json:
              schema:
                type: object
                required:
                  - received
                properties:
                  received:
                    type: boolean
        '400':
          $ref: '#/components/responses/ValidationFailed'
        '401':
          $ref: '#/components/responses/Unauthorized'
components:
  schemas:
    CallIngest:
      type: object
      required:
        - call
      description: >-
        Zelto's canonical call upload shape (`X-Zelto-Provider: zelto`). Provide
        either `agent.externalId` (find-or-create) or `agentId` (attach to an
        existing agent).
      properties:
        agent:
          type: object
          description: >-
            Find-or-create an agent by your own id. Required unless `agentId` is
            given.
          properties:
            externalId:
              type: string
              minLength: 1
            name:
              type: string
              minLength: 1
              maxLength: 255
              description: Used only when the agent is first created.
        agentId:
          type: string
          format: uuid
          description: >-
            Attach to an existing Zelto agent. Takes precedence over
            `agent.externalId`.
        version:
          type: string
          minLength: 1
          maxLength: 255
          description: >-
            Version label for the agent build that handled this call (e.g. `v3`
            or a prompt hash). Recorded as the call's agent version so analytics
            can segment by it. Optional; wins over any rotating-id derivation
            when both apply.
        call:
          type: object
          required:
            - externalId
          properties:
            externalId:
              type: string
              minLength: 1
              description: >-
                Your call id. Dedup key — re-uploading the same id updates the
                call in place.
            startedAt:
              type: string
              format: date-time
            endedAt:
              type: string
              format: date-time
            durationSeconds:
              type: integer
              minimum: 0
              description: Derived from startedAt/endedAt when omitted.
            endedReason:
              type: string
              maxLength: 100
            cost:
              type: number
              minimum: 0
              description: Cost in dollars.
            recordingUrl:
              type: string
              maxLength: 2048
            customer:
              type: object
              properties:
                number:
                  type: string
                  maxLength: 50
                  description: Inbound caller number; used to resolve a receiver.
                name:
                  type: string
                  maxLength: 255
        transcript:
          type: object
          required:
            - turns
          properties:
            turns:
              type: array
              minItems: 1
              items:
                $ref: '#/components/schemas/CallIngestTurn'
        systemPrompt:
          type: string
          description: >-
            Agent system prompt. A leading `system` transcript turn is used if
            this is omitted.
        metadata:
          type: object
          additionalProperties: true
          description: Free-form metadata stored on the conversation.
    CallIngestTurn:
      type: object
      required:
        - role
        - content
      properties:
        role:
          type: string
          enum:
            - user
            - assistant
            - system
            - tool
        content:
          type: string
          minLength: 1
        startSeconds:
          type: number
          minimum: 0
        endSeconds:
          type: number
          minimum: 0
    Error:
      type: object
      required:
        - error
      properties:
        error:
          type: string
          description: >-
            Human-readable error message, e.g. Unauthorized or Validation
            failed.
        message:
          type: string
        details:
          type: object
          additionalProperties: true
  responses:
    ValidationFailed:
      description: Request body failed validation.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    Unauthorized:
      description: Missing or invalid API key.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: >-
        Send `Authorization: Bearer YOUR_API_KEY`. The key resolves to a single
        organization.

````