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

# Create a batch call

> Creates a draft with up to 1,000 recipients and, with `launch`, launches it in the same request. Import larger lists with the import and recipients endpoints. Needs a Full access key.



## OpenAPI

````yaml /api-reference/openapi.json post /api/v2/agents/{agentId}/batch-calls
openapi: 3.1.0
info:
  title: Centillion Labs API
  description: >-
    The public API of Centillion Labs: agents, their branches and versions,
    knowledge, tools and the secrets they send, chat, conversations, contacts,
    campaigns, batch calls, agent testing, issues and Helpdesk.
  version: 2.0.0
servers:
  - url: https://app.cntillion.com
security:
  - workspaceApiKey: []
  - workspaceApiKeyHeader: []
tags:
  - name: Agents
    description: Create, read, change, clone and delete agents.
  - name: Branches and versions
    description: Branches, drafts, immutable versions, merges, publishing and traffic.
  - name: Workflow and voice
    description: A branch's workflow and its voice settings.
  - name: Tools
    description: 'Workspace tools: HTTP, client, MCP server and code tools.'
  - name: Secrets
    description: >-
      Named credentials, such as an API key, that HTTP tools and MCP servers
      send as a header by naming the secret's id in
      `configuration.secretHeaders`. A value is encrypted when saved and never
      returned. A new value reaches every tool and published agent that uses the
      secret on its next call, with nothing to publish, and a secret can be
      deleted only once no tool and no published agent sends it.
  - name: Auth connections
    description: >-
      How the workspace's tools sign in to an API, kept once and named by id in
      an HTTP tool's or an MCP server's `configuration.authConnectionId` (or
      `configuration.page.authConnectionId` for a web form's link request).
      Secrets are encrypted when saved and never returned. A change reaches
      every tool and published agent that uses the connection on its next call,
      and a connection can be deleted only once nothing signs in with it.
  - name: Knowledge sources
    description: What an agent knows, and training it on that.
  - name: Chat
    description: Talk to an agent from your own systems.
  - name: Conversations
    description: Conversations, their messages, feedback and analysis.
  - name: Leads and contacts
    description: The leads and contacts an agent collected.
  - name: Contacts and enrollments
    description: Upsert contacts and enroll them in always-open campaigns.
  - name: Batch calls
    description: Outbound call batches, their recipients and their runs.
  - name: Campaigns
    description: >-
      Managed outbound calling: campaigns that call each lead within calling
      windows and retry, call back or redirect as their lead policy allows,
      their leads, calls and attention items, and the workspace's campaign
      settings.
  - name: WhatsApp
    description: WhatsApp templates and template messages.
  - name: Agent testing
    description: Workspace tests, agent suites, execution, and results.
  - name: Issues
    description: >-
      Issues an agent raised or a teammate flagged about how it behaves: triage,
      comment, merge and resolve.
  - name: Helpdesk
    description: Helpdesk tickets, their messages, teams and statuses.
  - name: Status
    description: Whether the API is up.
paths:
  /api/v2/agents/{agentId}/batch-calls:
    post:
      tags:
        - Batch calls
      summary: Create a batch call
      description: >-
        Creates a draft with up to 1,000 recipients and, with `launch`, launches
        it in the same request. Import larger lists with the import and
        recipients endpoints. Needs a Full access key.
      operationId: createBatchCall
      parameters:
        - name: agentId
          in: path
          required: true
          schema:
            type: string
            minLength: 1
            maxLength: 128
        - name: Idempotency-Key
          in: header
          required: true
          description: >-
            Between 1 and 128 characters. A retry with the same key and body
            gets the first answer back and writes nothing; the same key with
            another body is refused with `409`.
          schema:
            type: string
            minLength: 1
            maxLength: 128
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateBatchCallRequest'
      responses:
        '201':
          description: Created.
          headers:
            Idempotent-Replayed:
              description: >-
                `true` when this is the stored answer to an earlier request with
                the same key.
              schema:
                type: string
                enum:
                  - 'true'
                  - 'false'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CreateBatchCallResponse'
        '400':
          $ref: '#/components/responses/Error400'
        '401':
          $ref: '#/components/responses/Error401'
        '403':
          $ref: '#/components/responses/Error403'
        '404':
          $ref: '#/components/responses/Error404'
        '409':
          $ref: '#/components/responses/Error409'
        '413':
          $ref: '#/components/responses/Error413'
        '415':
          $ref: '#/components/responses/Error415'
        '429':
          $ref: '#/components/responses/Error429'
        '500':
          $ref: '#/components/responses/Error500'
        '504':
          $ref: '#/components/responses/Error504'
components:
  schemas:
    CreateBatchCallRequest:
      type: object
      properties:
        name:
          type: string
          minLength: 1
          maxLength: 120
        settings:
          oneOf:
            - type: object
              properties:
                branchId:
                  anyOf:
                    - type: string
                      minLength: 1
                      maxLength: 100
                    - type: 'null'
                ringingTimeoutSeconds:
                  type: integer
                  minimum: 5
                  maximum: 120
                answeringMachineDetection:
                  type: boolean
                concurrencyLimit:
                  anyOf:
                    - type: integer
                      minimum: 1
                      maximum: 1000
                    - type: 'null'
                allowedOverrides:
                  maxItems: 4
                  type: array
                  items:
                    type: string
                    enum:
                      - prompt
                      - first_message
                      - language
                      - voice_id
                channel:
                  type: string
                  const: telephony
                phoneLineId:
                  anyOf:
                    - type: string
                      minLength: 1
                      maxLength: 100
                    - type: 'null'
                phoneLineIds:
                  maxItems: 50
                  type: array
                  items:
                    type: string
                    minLength: 1
                    maxLength: 100
              required:
                - branchId
                - ringingTimeoutSeconds
                - concurrencyLimit
                - allowedOverrides
                - phoneLineId
            - type: object
              properties:
                branchId:
                  anyOf:
                    - type: string
                      minLength: 1
                      maxLength: 100
                    - type: 'null'
                ringingTimeoutSeconds:
                  type: integer
                  minimum: 5
                  maximum: 120
                answeringMachineDetection:
                  type: boolean
                concurrencyLimit:
                  anyOf:
                    - type: integer
                      minimum: 1
                      maximum: 1000
                    - type: 'null'
                allowedOverrides:
                  maxItems: 4
                  type: array
                  items:
                    type: string
                    enum:
                      - prompt
                      - first_message
                      - language
                      - voice_id
                channel:
                  type: string
                  const: whatsapp
                connectionId:
                  anyOf:
                    - type: string
                      minLength: 1
                      maxLength: 100
                    - type: 'null'
              required:
                - branchId
                - ringingTimeoutSeconds
                - concurrencyLimit
                - allowedOverrides
                - channel
                - connectionId
        timezone:
          type: string
          maxLength: 64
        startsAt:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
        consentConfirmed:
          type: boolean
        sendRatePerMinute:
          type: integer
          minimum: 1
          maximum: 20
        recipients:
          default: []
          maxItems: 1000
          type: array
          items:
            $ref: '#/components/schemas/BatchCallRecipientRow'
        launch:
          default: false
          type: boolean
      required:
        - name
        - settings
        - timezone
        - startsAt
        - consentConfirmed
        - sendRatePerMinute
      additionalProperties: false
    CreateBatchCallResponse:
      type: object
      properties:
        data:
          $ref: '#/components/schemas/BatchCall'
      required:
        - data
    BatchCallRecipientRow:
      type: object
      properties:
        phone:
          type: string
          pattern: ^\+[1-9]\d{7,14}$
        name:
          type: string
          maxLength: 200
        variables:
          type: object
          propertyNames:
            type: string
            pattern: ^[A-Za-z_][A-Za-z0-9_]{0,63}$
          additionalProperties:
            anyOf:
              - type: string
                maxLength: 12000
              - type: number
              - type: boolean
        overrides:
          type: object
          properties:
            prompt:
              type: string
              minLength: 1
              maxLength: 8000
            first_message:
              type: string
              minLength: 1
              maxLength: 2000
            language:
              type: string
              enum:
                - en
                - es
                - it
            voice_id:
              type: string
              minLength: 1
              maxLength: 200
      required:
        - phone
        - name
        - variables
        - overrides
    BatchCall:
      type: object
      properties:
        id:
          type: string
        agentId:
          type: string
        updatedAt:
          type: string
          format: date-time
        config:
          $ref: '#/components/schemas/BatchCallConfig'
        recipientCount:
          type: integer
        input:
          $ref: '#/components/schemas/BatchCallDraft'
        status:
          type: string
          enum:
            - DRAFT
            - SCHEDULED
            - RUNNING
            - PAUSED
            - COMPLETED
            - CANCELLED
        createdAt:
          type: string
          format: date-time
        launchedAt:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
        completedAt:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
        lastError:
          type:
            - string
            - 'null'
      required:
        - id
        - agentId
        - updatedAt
        - config
        - recipientCount
        - input
        - status
        - createdAt
        - launchedAt
        - completedAt
        - lastError
    ApiError:
      type: object
      properties:
        error:
          type: object
          properties:
            code:
              type: string
              description: A stable code, such as `NOT_FOUND`.
            message:
              type: string
              description: What went wrong, for a person.
            details:
              description: More about the failure, on some endpoints.
          required:
            - code
            - message
      required:
        - error
    BatchCallConfig:
      oneOf:
        - type: object
          properties:
            branchId:
              anyOf:
                - type: string
                  minLength: 1
                  maxLength: 100
                - type: 'null'
            ringingTimeoutSeconds:
              type: integer
              minimum: 5
              maximum: 120
            answeringMachineDetection:
              type: boolean
            concurrencyLimit:
              anyOf:
                - type: integer
                  minimum: 1
                  maximum: 1000
                - type: 'null'
            allowedOverrides:
              maxItems: 4
              type: array
              items:
                type: string
                enum:
                  - prompt
                  - first_message
                  - language
                  - voice_id
            channel:
              type: string
              const: telephony
            phoneLineId:
              anyOf:
                - type: string
                  minLength: 1
                  maxLength: 100
                - type: 'null'
            phoneLineIds:
              maxItems: 50
              type: array
              items:
                type: string
                minLength: 1
                maxLength: 100
            version:
              type: number
              const: 1
            import:
              oneOf:
                - type: object
                  properties:
                    kind:
                      type: string
                      const: empty
                  required:
                    - kind
                - type: object
                  properties:
                    kind:
                      type: string
                      const: uploading
                    token:
                      type: string
                      format: uuid
                    fileName:
                      type: string
                      minLength: 1
                      maxLength: 255
                    headers:
                      minItems: 1
                      maxItems: 65
                      type: array
                      items:
                        type: string
                        minLength: 1
                        maxLength: 64
                    expectedRows:
                      type: integer
                      minimum: 1
                      maximum: 50000
                    importedRows:
                      type: integer
                      minimum: 0
                      maximum: 50000
                    importedBytes:
                      type: integer
                      minimum: 0
                      maximum: 26214400
                  required:
                    - kind
                    - token
                    - fileName
                    - headers
                    - expectedRows
                    - importedRows
                    - importedBytes
                - type: object
                  properties:
                    kind:
                      type: string
                      const: ready
                    token:
                      type: string
                      format: uuid
                    fileName:
                      type: string
                      minLength: 1
                      maxLength: 255
                    headers:
                      minItems: 1
                      maxItems: 65
                      type: array
                      items:
                        type: string
                        minLength: 1
                        maxLength: 64
                    expectedRows:
                      type: integer
                      minimum: 1
                      maximum: 50000
                    importedRows:
                      type: integer
                      minimum: 0
                      maximum: 50000
                    importedBytes:
                      type: integer
                      minimum: 0
                      maximum: 26214400
                  required:
                    - kind
                    - token
                    - fileName
                    - headers
                    - expectedRows
                    - importedRows
                    - importedBytes
          required:
            - branchId
            - ringingTimeoutSeconds
            - concurrencyLimit
            - allowedOverrides
            - phoneLineId
            - version
            - import
        - type: object
          properties:
            branchId:
              anyOf:
                - type: string
                  minLength: 1
                  maxLength: 100
                - type: 'null'
            ringingTimeoutSeconds:
              type: integer
              minimum: 5
              maximum: 120
            answeringMachineDetection:
              type: boolean
            concurrencyLimit:
              anyOf:
                - type: integer
                  minimum: 1
                  maximum: 1000
                - type: 'null'
            allowedOverrides:
              maxItems: 4
              type: array
              items:
                type: string
                enum:
                  - prompt
                  - first_message
                  - language
                  - voice_id
            channel:
              type: string
              const: whatsapp
            connectionId:
              anyOf:
                - type: string
                  minLength: 1
                  maxLength: 100
                - type: 'null'
            version:
              type: number
              const: 1
            import:
              oneOf:
                - type: object
                  properties:
                    kind:
                      type: string
                      const: empty
                  required:
                    - kind
                - type: object
                  properties:
                    kind:
                      type: string
                      const: uploading
                    token:
                      type: string
                      format: uuid
                    fileName:
                      type: string
                      minLength: 1
                      maxLength: 255
                    headers:
                      minItems: 1
                      maxItems: 65
                      type: array
                      items:
                        type: string
                        minLength: 1
                        maxLength: 64
                    expectedRows:
                      type: integer
                      minimum: 1
                      maximum: 50000
                    importedRows:
                      type: integer
                      minimum: 0
                      maximum: 50000
                    importedBytes:
                      type: integer
                      minimum: 0
                      maximum: 26214400
                  required:
                    - kind
                    - token
                    - fileName
                    - headers
                    - expectedRows
                    - importedRows
                    - importedBytes
                - type: object
                  properties:
                    kind:
                      type: string
                      const: ready
                    token:
                      type: string
                      format: uuid
                    fileName:
                      type: string
                      minLength: 1
                      maxLength: 255
                    headers:
                      minItems: 1
                      maxItems: 65
                      type: array
                      items:
                        type: string
                        minLength: 1
                        maxLength: 64
                    expectedRows:
                      type: integer
                      minimum: 1
                      maximum: 50000
                    importedRows:
                      type: integer
                      minimum: 0
                      maximum: 50000
                    importedBytes:
                      type: integer
                      minimum: 0
                      maximum: 26214400
                  required:
                    - kind
                    - token
                    - fileName
                    - headers
                    - expectedRows
                    - importedRows
                    - importedBytes
          required:
            - branchId
            - ringingTimeoutSeconds
            - concurrencyLimit
            - allowedOverrides
            - channel
            - connectionId
            - version
            - import
      description: The batch's stored settings and the state of its recipient import.
    BatchCallDraft:
      type: object
      properties:
        name:
          type: string
          minLength: 1
          maxLength: 120
        settings:
          oneOf:
            - type: object
              properties:
                branchId:
                  anyOf:
                    - type: string
                      minLength: 1
                      maxLength: 100
                    - type: 'null'
                ringingTimeoutSeconds:
                  type: integer
                  minimum: 5
                  maximum: 120
                answeringMachineDetection:
                  type: boolean
                concurrencyLimit:
                  anyOf:
                    - type: integer
                      minimum: 1
                      maximum: 1000
                    - type: 'null'
                allowedOverrides:
                  maxItems: 4
                  type: array
                  items:
                    type: string
                    enum:
                      - prompt
                      - first_message
                      - language
                      - voice_id
                channel:
                  type: string
                  const: telephony
                phoneLineId:
                  anyOf:
                    - type: string
                      minLength: 1
                      maxLength: 100
                    - type: 'null'
                phoneLineIds:
                  maxItems: 50
                  type: array
                  items:
                    type: string
                    minLength: 1
                    maxLength: 100
              required:
                - branchId
                - ringingTimeoutSeconds
                - concurrencyLimit
                - allowedOverrides
                - phoneLineId
            - type: object
              properties:
                branchId:
                  anyOf:
                    - type: string
                      minLength: 1
                      maxLength: 100
                    - type: 'null'
                ringingTimeoutSeconds:
                  type: integer
                  minimum: 5
                  maximum: 120
                answeringMachineDetection:
                  type: boolean
                concurrencyLimit:
                  anyOf:
                    - type: integer
                      minimum: 1
                      maximum: 1000
                    - type: 'null'
                allowedOverrides:
                  maxItems: 4
                  type: array
                  items:
                    type: string
                    enum:
                      - prompt
                      - first_message
                      - language
                      - voice_id
                channel:
                  type: string
                  const: whatsapp
                connectionId:
                  anyOf:
                    - type: string
                      minLength: 1
                      maxLength: 100
                    - type: 'null'
              required:
                - branchId
                - ringingTimeoutSeconds
                - concurrencyLimit
                - allowedOverrides
                - channel
                - connectionId
        timezone:
          type: string
          maxLength: 64
        startsAt:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
        consentConfirmed:
          type: boolean
        sendRatePerMinute:
          type: integer
          minimum: 1
          maximum: 20
      required:
        - name
        - settings
        - timezone
        - startsAt
        - consentConfirmed
        - sendRatePerMinute
      description: The batch as a create or an update writes it.
  responses:
    Error400:
      description: The request is invalid. `error.message` names the first problem.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ApiError'
    Error401:
      description: No valid workspace API key was sent.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ApiError'
    Error403:
      description: The key or the workspace's plan does not allow this request.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ApiError'
    Error404:
      description: The endpoint, or a record it names, was not found in this workspace.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ApiError'
    Error409:
      description: The record changed since it was read, or its state does not allow this.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ApiError'
    Error413:
      description: The request body is too large.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ApiError'
    Error415:
      description: The request body is not of a media type this endpoint accepts.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ApiError'
    Error429:
      description: Too many requests. Wait for `Retry-After` seconds.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ApiError'
    Error500:
      description: The request could not be completed. Try again.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ApiError'
    Error504:
      description: The request took too long. Try again.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ApiError'
  securitySchemes:
    workspaceApiKey:
      type: http
      scheme: bearer
      bearerFormat: cl_api_...
      description: >-
        A workspace API key from Workspace settings > API keys, sent as
        `Authorization: Bearer cl_api_...`. A Read only key can call the GET
        endpoints; every other method needs a Full access key.
    workspaceApiKeyHeader:
      type: apiKey
      in: header
      name: X-API-Key
      description: >-
        The same workspace API key, for a gateway that keeps `Authorization` for
        itself.

````

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