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

# Cancel A Batch Call.

> Cancel a running batch call and set all recipients to cancelled status.



## OpenAPI

````yaml /api-reference/openapi.json post /v1/convai/batch-calling/{batch_id}/cancel
openapi: 3.1.0
info:
  title: Threetone API Documentation
  description: >-
    This is the documentation for the Threetone API. You can use this API to use
    our service programmatically with API keys sent in the x-api-key header. You
    can create and manage API keys in the dashboard at
    https://threetone.in/app/developers/api-keys.
  version: '1.0'
servers:
  - url: https://api.threetone.in
    description: Production
security: []
paths:
  /v1/convai/batch-calling/{batch_id}/cancel:
    post:
      tags:
        - Agents Platform
      summary: Cancel A Batch Call.
      description: Cancel a running batch call and set all recipients to cancelled status.
      operationId: cancel_batch_call
      parameters:
        - name: batch_id
          in: path
          required: true
          schema:
            type: string
            title: Batch Id
        - name: x-api-key
          in: header
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            description: >-
              Your API key for programmatic access. Send it in the x-api-key
              header; you can create and manage keys from the Developers page.
            title: X-Api-Key
          description: >-
            Your API key for programmatic access. Send it in the x-api-key
            header; you can create and manage keys from the Developers page.
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BatchCallResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
components:
  schemas:
    BatchCallResponse:
      properties:
        id:
          type: string
          title: Id
        phone_number_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Phone Number Id
        phone_provider:
          anyOf:
            - $ref: '#/components/schemas/TelephonyProvider'
            - type: 'null'
        whatsapp_params:
          anyOf:
            - $ref: '#/components/schemas/BatchCallWhatsAppParams'
            - type: 'null'
        name:
          type: string
          title: Name
        agent_id:
          type: string
          title: Agent Id
        branch_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Branch Id
        environment:
          anyOf:
            - type: string
            - type: 'null'
          title: Environment
        created_at_unix:
          type: integer
          title: Created At Unix
        scheduled_time_unix:
          type: integer
          title: Scheduled Time Unix
        timezone:
          anyOf:
            - type: string
            - type: 'null'
          title: Timezone
        total_calls_dispatched:
          type: integer
          title: Total Calls Dispatched
          default: 0
        total_calls_scheduled:
          type: integer
          title: Total Calls Scheduled
          default: 0
        total_calls_finished:
          type: integer
          title: Total Calls Finished
          default: 0
        last_updated_at_unix:
          type: integer
          title: Last Updated At Unix
        status:
          $ref: '#/components/schemas/BatchCallStatus'
        retry_count:
          type: integer
          title: Retry Count
          default: 0
        telephony_call_config:
          $ref: '#/components/schemas/TelephonyCallConfig'
        target_concurrency_limit:
          anyOf:
            - type: integer
              minimum: 1
            - type: 'null'
          title: Target Concurrency Limit
          description: >-
            Maximum number of simultaneous calls for this batch. When set,
            dispatch is governed by this limit rather than workspace/agent
            capacity percentages.
        agent_name:
          type: string
          title: Agent Name
        branch_name:
          anyOf:
            - type: string
            - type: 'null'
          title: Branch Name
      type: object
      required:
        - id
        - phone_number_id
        - phone_provider
        - whatsapp_params
        - name
        - agent_id
        - branch_id
        - environment
        - created_at_unix
        - scheduled_time_unix
        - timezone
        - total_calls_dispatched
        - total_calls_scheduled
        - total_calls_finished
        - last_updated_at_unix
        - status
        - retry_count
        - telephony_call_config
        - target_concurrency_limit
        - agent_name
        - branch_name
      title: BatchCallResponse
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    TelephonyProvider:
      type: string
      enum:
        - twilio
        - sip_trunk
        - exotel
      title: TelephonyProvider
    BatchCallWhatsAppParams:
      properties:
        whatsapp_phone_number_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Whatsapp Phone Number Id
        whatsapp_call_permission_request_template_name:
          type: string
          title: Whatsapp Call Permission Request Template Name
        whatsapp_call_permission_request_template_language_code:
          type: string
          title: Whatsapp Call Permission Request Template Language Code
      type: object
      required:
        - whatsapp_call_permission_request_template_name
        - whatsapp_call_permission_request_template_language_code
      title: BatchCallWhatsAppParams
    BatchCallStatus:
      type: string
      enum:
        - pending
        - in_progress
        - completed
        - failed
        - cancelled
      title: BatchCallStatus
    TelephonyCallConfig:
      properties:
        ringing_timeout_secs:
          type: integer
          maximum: 999
          minimum: 1
          title: Ringing Timeout Secs
          description: >-
            How long to ring the recipient before giving up, in seconds. Note
            that this will also be limited by the provider's own constraints.
          default: 60
        twilio_call_recording_enabled:
          type: boolean
          title: Twilio Call Recording Enabled
          description: >-
            Whether to record the call using Twilio call recording. Ignored for
            non-Twilio providers. Recordings are stored in your Twilio account.
          default: false
        twilio_machine_detection:
          anyOf:
            - $ref: '#/components/schemas/TwilioMachineDetectionConfig'
            - type: 'null'
          description: >-
            Configuration for Twilio's carrier-level answering machine detection
            (AMD). Omit or set to null to disable it. Ignored for non-Twilio
            providers and for inbound calls. The resulting verdict is delivered
            as its own `answering_machine_detection` webhook event, which
            requires that event to be enabled on the workspace or agent webhook
            settings; it is not part of the conversation or the post-call
            webhook. Detection runs asynchronously so it never delays the start
            of the conversation, and the verdict can arrive at any point during
            the call -- with `detect_message_end`, even after it has ended.
            Twilio bills separately for AMD.
      type: object
      title: TelephonyCallConfig
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
    TwilioMachineDetectionConfig:
      properties:
        mode:
          $ref: '#/components/schemas/TwilioMachineDetectionMode'
          description: >-
            How thorough the detection should be. `enable` returns a verdict as
            soon as Twilio can tell a human from a machine. `detect_message_end`
            also waits for the voicemail greeting to finish, which is what
            produces the `machine_end_*` verdicts, but returns a result later.
          default: enable
      type: object
      title: TwilioMachineDetectionConfig
      description: >-
        How to run Twilio's carrier-level answering machine detection (AMD) on a
        call.
    TwilioMachineDetectionMode:
      type: string
      enum:
        - enable
        - detect_message_end
      title: TwilioMachineDetectionMode
      description: >-
        Which Twilio answering-machine-detection (AMD) mode to request for a
        call.


        `enable` returns a verdict as soon as Twilio can tell a human from a
        machine.

        `detect_message_end` additionally waits for the greeting to finish,
        which is what

        distinguishes the `machine_end_*` verdicts, at the cost of a later
        result.

````