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

# Start a call

> Call a lead with a voice agent, or start a test call with `test: true`. This operation can change workspace data or trigger an external side effect; review the request before sending it and do not retry blindly after a timeout.



## OpenAPI

````yaml /openapi.json post /api/v1/public/calls
openapi: 3.1.0
info:
  description: >-
    Customer-facing API for managing outreach, leads, conversations, voice
    agents, knowledge bases, analytics, and webhooks.
  title: Sendora Public API
  version: 1.0.0
servers:
  - description: Production
    url: https://api.sendora.ai
security: []
tags:
  - description: Leads, lead lists, importing, enriching and finding new prospects.
    name: Leads
  - description: Build, run and measure outreach, and enroll leads.
    name: Campaigns
  - description: Read and send messages, and manage who must not be contacted.
    name: Conversations
  - description: >-
      Voice and chat agents, their tools, knowledge bases, voices and website
      widgets.
    name: Agents
  - description: >-
      Start calls, and manage phone numbers, SMS registration, sending accounts
      and email domains.
    name: Calls and numbers
  - description: Webhooks, jobs, analytics and the Copilot assistant.
    name: Platform
  - description: Manage client workspaces, plans and branding.
    name: Agency
paths:
  /api/v1/public/calls:
    post:
      tags:
        - Calls and numbers
      summary: Start a call
      description: >-
        Call a lead with a voice agent, or start a test call with `test: true`.
        This operation can change workspace data or trigger an external side
        effect; review the request before sending it and do not retry blindly
        after a timeout.
      operationId: start_call_api_v1_public_calls_post
      parameters:
        - in: header
          name: X-API-Key
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            title: X-Api-Key
        - in: header
          name: Authorization
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            title: Authorization
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/api__v1__public__facade__content__CallBody'
        required: true
      responses:
        '201':
          content:
            application/json:
              schema:
                anyOf:
                  - $ref: '#/components/schemas/InitiateCallResponse'
                  - $ref: >-
                      #/components/schemas/api__v1__public__facade__models__TestCallOut
                title: Response Start Call Api V1 Public Calls Post
          description: Successful Response
        '401':
          description: The X-API-Key header is missing, invalid, expired, or revoked.
        '402':
          description: >-
            The workspace is suspended for billing, or the request would exceed
            a plan or usage limit.
        '403':
          description: >-
            The key is valid but lacks the required scope, or the workspace has
            no active plan, lacks the entitlement, or has this feature turned
            off or view-only.
        '410':
          description: The workspace behind this key has been deleted.
        '422':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
          description: Validation Error
        '500':
          description: >-
            An unexpected Sendora error occurred. Retry only if the operation is
            safe to repeat.
        '503':
          description: >-
            An entitlement or billing check is temporarily unavailable. Retry
            after the Retry-After interval.
      security:
        - ApiKeyAuth: []
      x-codeSamples:
        - label: cURL
          lang: bash
          source: >-
            curl -X POST 'https://api.sendora.ai/api/v1/public/calls' -H
            "X-API-Key: $SENDORA_API_KEY" -H "Content-Type: application/json" \
              -d '{"agent_id":"example"}'
        - label: Python
          lang: python
          source: >-
            import requests


            url = 'https://api.sendora.ai/api/v1/public/calls'

            headers = {'X-API-Key': '$SENDORA_API_KEY'}

            response = requests.post(url, headers=headers, json={'agent_id':
            'example'})

            response.raise_for_status()

            print(response.json())
        - label: JavaScript
          lang: javascript
          source: >-
            const response = await
            fetch("https://api.sendora.ai/api/v1/public/calls", {
              method: "POST",
              headers: { 'X-API-Key': process.env.SENDORA_API_KEY, 'Content-Type': 'application/json' },
              body: JSON.stringify({"agent_id": "example"}),
            });

            if (!response.ok) throw new Error(await response.text());

            console.log(await response.json());
        - label: Go
          lang: go
          source: >-
            req, err := http.NewRequest("POST",
            "https://api.sendora.ai/api/v1/public/calls",
            bytes.NewBufferString(`{"agent_id": "example"}`))

            if err != nil { log.Fatal(err) }

            req.Header.Set("X-API-Key", os.Getenv("SENDORA_API_KEY"))

            req.Header.Set("Content-Type", "application/json")

            resp, err := http.DefaultClient.Do(req)

            if err != nil { log.Fatal(err) }

            defer resp.Body.Close()
components:
  schemas:
    api__v1__public__facade__content__CallBody:
      properties:
        additional_variables:
          anyOf:
            - additionalProperties:
                type: string
              type: object
            - type: 'null'
          description: Extra {{key}} variables resolved into the agent prompt at call time.
          title: Additional Variables
        agent_id:
          description: 'A voice agent''s id: the `id` from List or get agents.'
          title: Agent Id
          type: string
        from_number:
          anyOf:
            - type: string
            - type: 'null'
          description: >-
            Outbound caller ID in E.164 format. When omitted, uses the first
            active phone number configured for the workspace.
          title: From Number
        idempotency_key:
          anyOf:
            - maxLength: 128
              type: string
            - type: 'null'
          description: Idempotency key returned by the Sendora API.
          title: Idempotency Key
        lead_id:
          anyOf:
            - type: string
            - type: 'null'
          description: 'A lead''s id: the `id` from List or get leads.'
          title: Lead Id
        mode:
          anyOf:
            - enum:
                - browser
                - phone
              type: string
            - type: 'null'
          description: >-
            With test: browser starts a web call, phone rings the number in
            test_phone.
          title: Mode
        prompt_override:
          anyOf:
            - maxLength: 8000
              type: string
            - type: 'null'
          description: >-
            Override the agent system prompt for this single call. Supports
            {{lead.*}} tokens.
          title: Prompt Override
        test:
          default: false
          description: Place a test call to try an agent instead of calling a lead.
          title: Test
          type: boolean
        test_phone:
          anyOf:
            - $ref: '#/components/schemas/PhoneTestCallRequest'
            - type: 'null'
          description: 'With mode phone: where to ring.'
        voice_id:
          anyOf:
            - type: string
            - type: 'null'
          description: 'A voice''s id: the `id` from List voices.'
          title: Voice Id
        voicemail:
          anyOf:
            - $ref: '#/components/schemas/VoicemailConfig'
            - type: 'null'
          description: Voicemail returned by the Sendora API.
      required:
        - agent_id
      title: CallBody
      type: object
    InitiateCallResponse:
      properties:
        call_id:
          description: >-
            The call's tracking id. Pass it to List or get calls once the call
            has ended.
          title: Call Id
          type: string
        message:
          anyOf:
            - type: string
            - type: 'null'
          description: Message returned by the Sendora API.
          title: Message
        status:
          description: dialing | failed | skipped
          title: Status
          type: string
      required:
        - call_id
        - status
      title: InitiateCallResponse
      type: object
    api__v1__public__facade__models__TestCallOut:
      additionalProperties: true
      properties: {}
      required: []
      title: TestCallOut
      type: object
    HTTPValidationError:
      properties:
        detail:
          description: Detail returned by the Sendora API.
          items:
            $ref: '#/components/schemas/ValidationError'
          title: Detail
          type: array
      required: []
      title: HTTPValidationError
      type: object
    PhoneTestCallRequest:
      properties:
        from_number_id:
          anyOf:
            - type: string
            - type: 'null'
          description: 'The phone number to call from: an `id` from List numbers.'
          title: From Number Id
        template_context:
          description: Template context returned by the Sendora API.
          title: Template Context
          type: object
        to_number:
          description: E.164 phone number to call, e.g. +917976505979
          title: To Number
          type: string
      required:
        - to_number
      title: PhoneTestCallRequest
      type: object
    VoicemailConfig:
      properties:
        enabled:
          default: true
          description: Enabled returned by the Sendora API.
          title: Enabled
          type: boolean
        script:
          anyOf:
            - maxLength: 2000
              type: string
            - type: 'null'
          description: >-
            Script spoken when voicemail is detected. Supports
            {{lead.first_name}} tokens.
          title: Script
      required: []
      title: VoicemailConfig
      type: object
    ValidationError:
      properties:
        loc:
          description: Loc returned by the Sendora API.
          items:
            anyOf:
              - type: string
              - type: integer
          title: Location
          type: array
        msg:
          description: Msg returned by the Sendora API.
          title: Message
          type: string
        type:
          description: Type returned by the Sendora API.
          title: Error Type
          type: string
      required:
        - loc
        - msg
        - type
      title: ValidationError
      type: object
  securitySchemes:
    ApiKeyAuth:
      description: Customer API key created in the Sendora dashboard.
      in: header
      name: X-API-Key
      type: apiKey

````

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