> ## 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.

# Add campaign leads

> Add recipients to an outbound campaign that isn't stopping, stopped or failed. Recipients whose `id` the campaign already has are skipped, and a `completed` campaign becomes `active` again.



## OpenAPI

````yaml /api-reference/openapi.json post /v1/convai/outbound-campaigns/campaigns/{campaign_id}/leads
openapi: 3.1.0
info:
  title: Threetone API
  description: >-
    APIs for the Threetone Agents Platform and shared workspace resources.
    Authenticate programmatic requests with an API key in the x-api-key header.
  version: '1.0'
servers:
  - url: https://api.threetone.in
    description: Production
security: []
paths:
  /v1/convai/outbound-campaigns/campaigns/{campaign_id}/leads:
    post:
      tags:
        - Agents Platform
      summary: Add campaign leads
      description: >-
        Add recipients to an outbound campaign that isn't stopping, stopped or
        failed. Recipients whose `id` the campaign already has are skipped, and
        a `completed` campaign becomes `active` again.
      operationId: add_campaign_leads
      parameters:
        - name: campaign_id
          in: path
          required: true
          schema:
            type: string
            title: Campaign 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.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AddLeadsRequest'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AddLeadsResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
components:
  schemas:
    AddLeadsRequest:
      properties:
        recipients:
          items:
            $ref: '#/components/schemas/SubmitCampaignRecipient'
          type: array
          maxItems: 10000
          minItems: 1
          title: Recipients
          description: >-
            Who to add. A recipient whose `id` the campaign already has is
            skipped, so retrying a request with ids is safe. Recipients without
            an `id` are always added.
      additionalProperties: false
      type: object
      required:
        - recipients
      title: AddLeadsRequest
    AddLeadsResponse:
      properties:
        campaign:
          $ref: '#/components/schemas/CampaignResponse'
        added:
          type: integer
          title: Added
          description: Recipients the campaign didn't have yet.
      type: object
      required:
        - campaign
        - added
      title: AddLeadsResponse
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    SubmitCampaignRecipient:
      properties:
        phone_number:
          anyOf:
            - type: string
              maxLength: 64
            - type: 'null'
          title: Phone Number
          description: The number to call, in E.164 format such as `+14155550100`.
        phone_numbers:
          anyOf:
            - items:
                type: string
              type: array
              maxItems: 5
            - type: 'null'
          title: Phone Numbers
          description: >-
            More numbers to call, in order after `phone_number`. The lead moves
            on to the next one when calls to its current number keep failing.
        whatsapp_user_id:
          anyOf:
            - type: string
              maxLength: 256
            - type: 'null'
          title: Whatsapp User Id
          description: >-
            The contact's WhatsApp user ID. WhatsApp campaigns use it instead of
            the phone numbers.
        id:
          anyOf:
            - type: string
              maxLength: 256
            - type: 'null'
          title: Id
          description: >-
            Your identifier for the recipient, returned as its lead's
            `recipient_id`.
        timezone_override:
          anyOf:
            - type: string
            - type: 'null'
          title: Timezone Override
          description: >-
            IANA timezone to read the calling windows and callback times in for
            this recipient, overriding the campaign's.
        conversation_initiation_client_data:
          anyOf:
            - $ref: '#/components/schemas/ConversationInitiationClientDataRequest'
            - type: 'null'
          description: Dynamic variables and overrides for this recipient's calls.
      additionalProperties: false
      type: object
      title: SubmitCampaignRecipient
    CampaignResponse:
      properties:
        campaign_id:
          type: string
          title: Campaign Id
        call_name:
          type: string
          title: Call Name
          description: The campaign's name.
        agent_id:
          type: string
          title: Agent Id
        channel_config:
          oneOf:
            - $ref: '#/components/schemas/PhoneChannelConfig-Output'
            - $ref: '#/components/schemas/WhatsAppChannelConfig'
          title: Channel Config
          discriminator:
            propertyName: channel
            mapping:
              phone: '#/components/schemas/PhoneChannelConfig-Output'
              whatsapp: '#/components/schemas/WhatsAppChannelConfig'
        status:
          $ref: '#/components/schemas/CampaignStatus'
          description: >-
            `attention` means an open attention item holds back some of the
            campaign's calls while the rest go ahead. `stopping` means queued
            calls are cancelled and calls already placed are finishing.
        policy:
          $ref: '#/components/schemas/CampaignPolicySnapshot'
          description: The policy the campaign took when it was created.
        variant:
          $ref: '#/components/schemas/CampaignVariant'
        source:
          anyOf:
            - $ref: '#/components/schemas/CampaignSource'
            - type: 'null'
          description: Whether the campaign was created in the app or through the API.
        created_at_unix:
          type: integer
          title: Created At Unix
        scheduled_time_unix:
          anyOf:
            - type: integer
            - type: 'null'
          title: Scheduled Time Unix
          description: When the campaign starts calling; unset to start once created.
        updated_at_unix:
          type: integer
          title: Updated At Unix
        branch_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Branch Id
          description: The agent branch the campaign calls with.
        environment:
          anyOf:
            - type: string
            - type: 'null'
          title: Environment
          description: The environment the agent's environment variables resolve in.
        target_concurrency_limit:
          anyOf:
            - type: integer
            - type: 'null'
          title: Target Concurrency Limit
          description: The most calls the campaign places at once.
        channel:
          $ref: '#/components/schemas/OutboundChannel'
        mode:
          $ref: '#/components/schemas/OutboundMode'
        counts:
          $ref: '#/components/schemas/CampaignSummaryCounts'
        agent_name:
          type: string
          title: Agent Name
          default: ''
      type: object
      required:
        - campaign_id
        - call_name
        - agent_id
        - channel_config
        - status
        - policy
        - variant
        - source
        - created_at_unix
        - scheduled_time_unix
        - updated_at_unix
        - branch_id
        - environment
        - target_concurrency_limit
        - channel
        - mode
        - counts
        - agent_name
      title: CampaignResponse
    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
    ConversationInitiationClientDataRequest:
      properties:
        conversation_config_override:
          $ref: '#/components/schemas/ConversationConfigClientOverride'
        custom_llm_extra_body:
          additionalProperties: true
          type: object
          title: Custom Llm Extra Body
        user_id:
          anyOf:
            - type: string
            - type: 'null'
          title: User Id
          description: >-
            ID of the end user participating in this conversation (for agent
            owner's user identification)
        source_info:
          $ref: '#/components/schemas/ConversationInitiationSourceInfo'
        branch_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Branch Id
          description: ID of the agent branch to use for this conversation
        environment:
          anyOf:
            - type: string
            - type: 'null'
          title: Environment
          description: Environment to use for resolving environment variables
        starting_workflow_node_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Starting Workflow Node Id
          description: >-
            If set, start the workflow at this node id instead of the default
            entry
        procedure_ids:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          title: Procedure Ids
          description: >-
            If set, only these procedures are available to the starting agent.
            Each ID must be attached to that agent; unknown IDs fail
            conversation start. An empty list disables all of that agent's
            procedures. Not applied after an agent transfer. Requires
            enable_procedure_ids_from_client.
        start_procedure_ids:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          title: Start Procedure Ids
          description: >-
            If set, these free-form procedures start when the conversation
            starts. Accepts at most five IDs. Each ID must be available after
            procedure_ids is applied. Unknown IDs and structured procedures fail
            conversation start. Requires enable_procedure_ids_from_client.
        dynamic_variables:
          additionalProperties: true
          type: object
          title: Dynamic Variables
      type: object
      title: ConversationInitiationClientDataRequest
    PhoneChannelConfig-Output:
      properties:
        channel:
          type: string
          const: phone
          title: Channel
          default: phone
        agent_phone_number_id:
          type: string
          maxLength: 256
          minLength: 1
          title: Agent Phone Number Id
          description: The phone number to call from.
        mode_config:
          $ref: '#/components/schemas/PhoneVoiceConfig-Output'
      type: object
      required:
        - agent_phone_number_id
      title: PhoneChannelConfig
    WhatsAppChannelConfig:
      properties:
        channel:
          type: string
          const: whatsapp
          title: Channel
          default: whatsapp
        whatsapp_phone_number_id:
          type: string
          minLength: 1
          title: Whatsapp Phone Number Id
          description: The WhatsApp phone number to call or message from.
        mode_config:
          oneOf:
            - $ref: '#/components/schemas/WhatsAppVoiceConfig'
            - $ref: '#/components/schemas/WhatsAppMessageConfig'
          title: Mode Config
          discriminator:
            propertyName: mode
            mapping:
              message: '#/components/schemas/WhatsAppMessageConfig'
              voice: '#/components/schemas/WhatsAppVoiceConfig'
      type: object
      required:
        - whatsapp_phone_number_id
        - mode_config
      title: WhatsAppChannelConfig
    CampaignStatus:
      type: string
      enum:
        - active
        - paused
        - stopping
        - stopped
        - completed
        - failed
        - attention
      title: CampaignStatus
    CampaignPolicySnapshot:
      properties:
        timezone:
          type: string
          title: Timezone
        retry:
          $ref: '#/components/schemas/RetryPolicy'
        calling_periods:
          items:
            $ref: '#/components/schemas/CallingPeriodPolicy'
          type: array
          title: Calling Periods
        date_overrides:
          items:
            $ref: '#/components/schemas/DateOverridePolicy'
          type: array
          title: Date Overrides
        data_collection:
          $ref: '#/components/schemas/DataCollectionPolicy'
        followup_context:
          $ref: '#/components/schemas/FollowupContextPolicy'
      type: object
      required:
        - timezone
        - retry
        - calling_periods
        - data_collection
        - followup_context
      title: CampaignPolicySnapshot
      description: >-
        The policy the campaign took when it was created, laid out like a
        submitted `policy`.
    CampaignVariant:
      type: string
      enum:
        - simple
        - advanced
      title: CampaignVariant
    CampaignSource:
      type: string
      enum:
        - ui
        - api
      title: CampaignSource
    OutboundChannel:
      type: string
      enum:
        - phone
        - whatsapp
      title: OutboundChannel
    OutboundMode:
      type: string
      enum:
        - voice
        - message
      title: OutboundMode
    CampaignSummaryCounts:
      properties:
        leads:
          type: integer
          title: Leads
        terminal_leads:
          type: integer
          title: Terminal Leads
          description: Leads that won't be called again.
        open_attention:
          type: integer
          title: Open Attention
          description: Attention items not yet resolved.
        delivery:
          anyOf:
            - $ref: '#/components/schemas/RecipientDeliveryCounts'
            - type: 'null'
          description: >-
            How many messages reached each stage; set when getting one message
            campaign.
      type: object
      required:
        - leads
        - terminal_leads
        - open_attention
      title: CampaignSummaryCounts
    ConversationConfigClientOverride:
      properties:
        turn:
          anyOf:
            - $ref: '#/components/schemas/TurnConfigOverride'
            - type: 'null'
          description: Configuration for turn detection
        tts:
          anyOf:
            - $ref: '#/components/schemas/TTSConversationalConfigOverride'
            - type: 'null'
          description: Configuration for conversational text to speech
        conversation:
          anyOf:
            - $ref: '#/components/schemas/ConversationConfigOverride'
            - type: 'null'
          description: Configuration for conversational events
        agent:
          anyOf:
            - $ref: '#/components/schemas/AgentConfigOverride'
            - type: 'null'
          description: Agent specific configuration
      additionalProperties: false
      type: object
      title: ConversationConfigClientOverride
      example:
        agent:
          first_message: Hello, how can I help you today?
          language: en
          prompt:
            knowledge_base: []
            llm: google/gemma-4-31b
            prompt: >-
              You are a helpful assistant that can answer questions about the
              topic of the conversation.
            tool_ids: []
        conversation:
          max_duration_seconds: 600
        tts:
          voice_id: ME9RtCnWp5vX2LhJdF3k
        turn:
          soft_timeout_config:
            message: Hhmmmm...yeah.
    ConversationInitiationSourceInfo:
      properties:
        source:
          anyOf:
            - $ref: '#/components/schemas/ConversationInitiationSource'
            - type: 'null'
          description: Source of the conversation initiation
        version:
          anyOf:
            - type: string
              maxLength: 50
            - type: 'null'
          title: Version
          description: The SDK version number
      type: object
      title: ConversationInitiationSourceInfo
      description: Information about the source of conversation initiation
    PhoneVoiceConfig-Output:
      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.
        mode:
          type: string
          const: voice
          title: Mode
          default: voice
      additionalProperties: false
      type: object
      title: PhoneVoiceConfig
    WhatsAppVoiceConfig:
      properties:
        mode:
          type: string
          const: voice
          title: Mode
          default: voice
        whatsapp_call_permission_request_template_name:
          type: string
          title: Whatsapp Call Permission Request Template Name
          description: The approved template that asks the contact for permission to call.
        whatsapp_call_permission_request_template_language_code:
          type: string
          title: Whatsapp Call Permission Request Template Language Code
          description: The language code of that template.
      additionalProperties: false
      type: object
      required:
        - whatsapp_call_permission_request_template_name
        - whatsapp_call_permission_request_template_language_code
      title: WhatsAppVoiceConfig
    WhatsAppMessageConfig:
      properties:
        mode:
          type: string
          const: message
          title: Mode
          default: message
        template:
          $ref: '#/components/schemas/WhatsAppTemplate'
          description: The Meta template as it was approved at submission.
      type: object
      required:
        - template
      title: WhatsAppMessageConfig
    RetryPolicy:
      properties:
        retry_delay_seconds:
          type: integer
          exclusiveMinimum: 0
          title: Retry Delay Seconds
          description: How long to wait before a short retry.
          default: 600
        max_short_retries:
          type: integer
          maximum: 30
          minimum: 0
          title: Max Short Retries
          description: >-
            Retries a calling window allows after a failed call. Once used up,
            the next retry waits for the following window, which starts afresh.
          default: 1
        max_total_calls:
          type: integer
          maximum: 30
          minimum: 1
          title: Max Total Calls
          description: The most calls a lead gets, counting the first.
          default: 6
        max_callbacks:
          type: integer
          maximum: 30
          minimum: 0
          title: Max Callbacks
          description: The most callbacks to honor for one number.
          default: 2
        max_redirects:
          type: integer
          maximum: 30
          minimum: 0
          title: Max Redirects
          description: The most times a lead follows a request to call another number.
          default: 2
        interval_placement:
          $ref: '#/components/schemas/IntervalPlacement'
          description: >-
            Where in a later calling window a pushed-back call lands: at its
            `start`, at a `random` time, or `rotate`d `rotate_step_seconds` past
            where the last call in that window failed.
          default: start
        rotate_step_seconds:
          type: integer
          exclusiveMinimum: 0
          title: Rotate Step Seconds
          description: How far `rotate` placement moves each call. Only used by `rotate`.
          default: 900
        max_consecutive_failures_per_number:
          anyOf:
            - type: integer
              maximum: 30
              minimum: 1
            - type: 'null'
          title: Max Consecutive Failures Per Number
          description: >-
            Calls to one number that may fail in a row before the lead moves on
            to its next listed number, or ends when there is none. An answered
            call, or a redirect to a new number, restarts the count. Unset
            leaves only `max_total_calls`.
      additionalProperties: false
      type: object
      title: RetryPolicy
    CallingPeriodPolicy:
      properties:
        weekdays:
          items:
            type: integer
          type: array
          minItems: 1
          title: Weekdays
        intervals:
          items:
            $ref: '#/components/schemas/CallingIntervalPolicy'
          type: array
          minItems: 1
          title: Intervals
          description: Windows on each of those days. They may not overlap on any day.
      type: object
      required:
        - weekdays
        - intervals
      title: CallingPeriodPolicy
    DateOverridePolicy:
      properties:
        start_date:
          type: string
          format: date
          title: Start Date
          description: First local date the override applies on.
        end_date:
          type: string
          format: date
          title: End Date
          description: Last local date the override applies on, inclusive.
        intervals:
          items:
            $ref: '#/components/schemas/CallingIntervalPolicy'
          type: array
          title: Intervals
          description: >-
            Calling windows on every day from `start_date` to `end_date`,
            replacing the weekly ones. Empty means no calls on those days.
        name:
          anyOf:
            - type: string
            - type: 'null'
          title: Name
      type: object
      required:
        - start_date
        - end_date
      title: DateOverridePolicy
    DataCollectionPolicy:
      properties:
        callback_time:
          anyOf:
            - type: string
            - type: 'null'
          title: Callback Time
        redirect_phone_number:
          anyOf:
            - type: string
            - type: 'null'
          title: Redirect Phone Number
        stop:
          anyOf:
            - type: string
            - type: 'null'
          title: Stop
        mappings:
          additionalProperties:
            type: string
          type: object
          title: Mappings
          description: >-
            Copies data collection results into dynamic variables for later
            calls: each key is a data collection item ID and its value the
            variable's name.
      type: object
      title: DataCollectionPolicy
    FollowupContextPolicy:
      properties:
        call_type:
          type: boolean
          title: Call Type
          description: Pass the call type as `campaign__call_type`.
          default: true
        previous_conversation_id:
          type: boolean
          title: Previous Conversation Id
          description: >-
            Pass the last conversation's ID as
            `campaign__previous_conversation_id`.
          default: true
        previous_summary:
          type: boolean
          title: Previous Summary
          description: >-
            Pass the last conversation's summary as
            `campaign__previous_summary`.
          default: true
        previous_transcript:
          type: boolean
          title: Previous Transcript
          description: >-
            Pass the last conversation's transcript as
            `campaign__previous_transcript`.
          default: true
      additionalProperties: false
      type: object
      title: FollowupContextPolicy
      description: Which `campaign__` dynamic variables follow-up calls get.
    RecipientDeliveryCounts:
      properties:
        sent:
          type: integer
          title: Sent
          default: 0
        delivered:
          type: integer
          title: Delivered
          default: 0
        read:
          type: integer
          title: Read
          default: 0
        replied:
          type: integer
          title: Replied
          default: 0
        failed:
          type: integer
          title: Failed
          default: 0
      type: object
      title: RecipientDeliveryCounts
    TurnConfigOverride:
      properties:
        noisy_environment_message:
          anyOf:
            - type: string
            - type: 'null'
          title: Noisy Environment Message
          description: What the agent says when it detects a noisy environment.
          x-convai-client-override: true
          x-convai-language-override: true
        soft_timeout_config:
          anyOf:
            - $ref: '#/components/schemas/SoftTimeoutConfigOverride'
            - type: 'null'
          description: >-
            Configuration for soft timeout functionality. Provides immediate
            feedback during longer LLM responses.
      additionalProperties: false
      type: object
      title: TurnConfigOverride
      example:
        soft_timeout_config:
          message: Hhmmmm...yeah.
    TTSConversationalConfigOverride:
      properties:
        voice_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Voice Id
          description: The voice ID to use for TTS
          x-convai-client-override: true
          x-convai-language-override: true
        pronunciation_dictionary_locators:
          anyOf:
            - items:
                $ref: >-
                  #/components/schemas/PydanticPronunciationDictionaryVersionLocator
              type: array
            - type: 'null'
          title: Pronunciation Dictionary Locators
          description: The pronunciation dictionary locators
          x-convai-client-override: true
      additionalProperties: false
      type: object
      title: TTSConversationalConfigOverride
    ConversationConfigOverride:
      properties:
        text_only:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Text Only
          description: >-
            If enabled audio will not be processed and only text will be used,
            use to avoid audio pricing.
          x-convai-client-override: true
        max_duration_seconds:
          anyOf:
            - type: integer
            - type: 'null'
          title: Max Duration Seconds
          description: The maximum duration of a conversation in seconds
          x-convai-client-override: true
      additionalProperties: false
      type: object
      title: ConversationConfigOverride
      example:
        max_duration_seconds: 600
    AgentConfigOverride:
      properties:
        first_message:
          anyOf:
            - type: string
            - type: 'null'
          title: First Message
          description: >-
            If non-empty, the first message the agent will say. If empty, the
            agent waits for the user to start the discussion.
          x-convai-client-override: true
          x-convai-language-override: true
        language:
          anyOf:
            - $ref: '#/components/schemas/LanguageTag'
            - type: 'null'
          description: >-
            Default response language. ASR input languages are configured
            separately.
          x-convai-client-override: true
        max_conversation_duration_message:
          anyOf:
            - type: string
            - type: 'null'
          title: Max Conversation Duration Message
          description: >-
            If non-empty, the message the agent will send when max conversation
            duration is reached.
          x-convai-client-override: true
          x-convai-language-override: true
        prompt:
          anyOf:
            - $ref: '#/components/schemas/PromptAgentAPIModelOverride'
            - type: 'null'
          description: The prompt for the agent
      additionalProperties: false
      type: object
      title: AgentConfigOverride
      example:
        first_message: Hello, how can I help you today?
        language: en
        prompt:
          knowledge_base: []
          llm: google/gemma-4-31b
          prompt: >-
            You are a helpful assistant that can answer questions about the
            topic of the conversation.
          tool_ids: []
    ConversationInitiationSource:
      type: string
      enum:
        - unknown
        - android_sdk
        - node_js_sdk
        - react_native_sdk
        - react_sdk
        - js_sdk
        - python_sdk
        - widget
        - sip_trunk
        - twilio
        - exotel
        - genesys
        - avaya
        - audiocodes
        - swift_sdk
        - whatsapp
        - twilio_sms
        - flutter_sdk
        - unity_sdk
        - zendesk_integration
        - slack_integration
        - telegram_integration
        - intercom_integration
        - freshdesk_integration
        - plain_integration
        - salesforce_integration
        - template_preview
        - genesys_bot_connector
        - subagent_tool
        - agent_messages_api
      title: ConversationInitiationSource
      description: Enum representing the possible sources for conversation initiation.
      default: unknown
    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
        actions:
          items:
            $ref: '#/components/schemas/TwilioMachineDetectionRule'
          type: array
          title: Actions
          description: >-
            Actions to take on the call per AMD verdict. Each action can appear
            in at most one rule, so list all of its verdicts together. Verdicts
            without a rule leave the call running.
      type: object
      title: TwilioMachineDetectionConfig
      description: >-
        How to run Twilio's carrier-level answering machine detection (AMD) on a
        call.
    WhatsAppTemplate:
      properties:
        name:
          type: string
          title: Name
        language:
          type: string
          title: Language
          description: >-
            https://developers.facebook.com/documentation/business-messaging/whatsapp/templates/supported-languages
        parameter_format:
          type: string
          enum:
            - POSITIONAL
            - NAMED
          title: Parameter Format
          default: POSITIONAL
        components:
          items:
            $ref: '#/components/schemas/WhatsAppTemplateComponent'
          type: array
          title: Components
        category:
          anyOf:
            - type: string
            - type: 'null'
          title: Category
          description: >-
            https://developers.facebook.com/docs/graph-api/reference/whats-app-business-account/message_templates/
      type: object
      required:
        - name
        - language
        - components
      title: WhatsAppTemplate
    IntervalPlacement:
      type: string
      enum:
        - start
        - random
        - rotate
      title: IntervalPlacement
      default: start
    CallingIntervalPolicy:
      properties:
        start:
          type: string
          pattern: ^([01]\d|2[0-3]):[0-5]\d$
          title: Start
          description: Local start time, as `HH:MM`.
        end:
          type: string
          pattern: ^(([01]\d|2[0-3]):[0-5]\d|24:00)$
          title: End
          description: Local end time, as `HH:MM`; `24:00` ends at midnight.
      additionalProperties: false
      type: object
      required:
        - start
        - end
      title: CallingIntervalPolicy
    SoftTimeoutConfigOverride:
      properties:
        message:
          anyOf:
            - type: string
            - type: 'null'
          title: Message
          description: >-
            Message to show when the first soft timeout is reached while waiting
            for LLM response. Supports dynamic variables (e.g.,
            {{system__time}}, {{custom_variable}}).
          x-convai-client-override: true
          x-convai-language-override: true
        additional_soft_timeout_messages:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          title: Additional Soft Timeout Messages
          description: >-
            Extra static filler messages for subsequent soft timeouts in the
            same LLM generation. The first timeout uses `message`. If fewer
            messages are configured than `max_soft_timeouts_per_generation`, the
            last configured message is repeated; otherwise a built-in filler is
            used.
          x-convai-client-override: true
          x-convai-language-override: true
      additionalProperties: false
      type: object
      title: SoftTimeoutConfigOverride
      example:
        message: Hhmmmm...yeah.
    PydanticPronunciationDictionaryVersionLocator:
      properties:
        pronunciation_dictionary_id:
          type: string
          title: Pronunciation Dictionary Id
          description: The ID of the pronunciation dictionary
        version_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Version Id
          description: The ID of the version of the pronunciation dictionary
      additionalProperties: false
      type: object
      required:
        - pronunciation_dictionary_id
        - version_id
      title: PydanticPronunciationDictionaryVersionLocator
      description: >-
        A locator for other documents to be able to reference a specific
        dictionary and it's version.

        This is a pydantic version of
        PronunciationDictionaryVersionLocatorDBModel.

        Required to ensure compat with the rest of the agent data models.
    LanguageTag:
      type: string
      minLength: 2
      pattern: ^[a-z]{2,8}(-[a-z0-9]{1,8})*$
      description: Normalized lowercase BCP 47 language tag.
    PromptAgentAPIModelOverride:
      properties:
        prompt:
          anyOf:
            - type: string
            - type: 'null'
          title: Prompt
          description: The prompt for the agent
          x-convai-client-override: true
        llm:
          anyOf:
            - $ref: '#/components/schemas/CatalogModelId'
            - type: 'null'
          description: >-
            The LLM to query with the prompt and the chat history. If using data
            residency, the LLM must be supported in the data residency
            environment
          x-convai-client-override: true
          x-convai-runtime-override: true
        reasoning_effort:
          anyOf:
            - $ref: '#/components/schemas/LLMReasoningEffort'
            - type: 'null'
          description: Reasoning effort of the model. Only available for some models.
          x-convai-client-override: true
          x-convai-runtime-override: true
          x-convai-soft-override-disallowed: true
        tool_ids:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          title: Tool Ids
          description: A list of IDs of tools used by the agent
          x-convai-client-override: true
        tool_ids_strict:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Tool Ids Strict
          description: >-
            Only applies as a conversation override, allowed whenever tool_ids
            may be overridden. When true, the overridden tool_ids is the full
            list of tools allowed in the conversation, including tools on
            workflow nodes. Ignored when set on the agent.
          x-convai-client-override: true
        native_mcp_server_ids:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          title: Native Mcp Server Ids
          description: A list of Native MCP server ids to be used by the agent
          x-convai-client-override: true
        knowledge_base:
          anyOf:
            - items:
                $ref: '#/components/schemas/KnowledgeBaseLocator'
              type: array
            - type: 'null'
          title: Knowledge Base
          description: A list of knowledge bases to be used by the agent
          x-convai-client-override: true
      additionalProperties: false
      type: object
      title: PromptAgentAPIModelOverride
      example:
        knowledge_base: []
        llm: google/gemma-4-31b
        prompt: >-
          You are a helpful assistant that can answer questions about the topic
          of the conversation.
        tool_ids: []
    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.
    TwilioMachineDetectionRule:
      properties:
        action:
          $ref: '#/components/schemas/TwilioMachineDetectionAction'
        answered_by:
          items:
            $ref: '#/components/schemas/TwilioAnsweredBy'
          type: array
          minItems: 1
          title: Answered By
          description: Verdicts that trigger the action.
      type: object
      required:
        - action
        - answered_by
      title: TwilioMachineDetectionRule
      description: Action to take on a live call for the given AMD verdicts.
    WhatsAppTemplateComponent:
      properties:
        type:
          type: string
          title: Type
        format:
          anyOf:
            - type: string
            - type: 'null'
          title: Format
        text:
          anyOf:
            - type: string
            - type: 'null'
          title: Text
        buttons:
          anyOf:
            - items:
                $ref: '#/components/schemas/WhatsAppTemplateComponentButton'
              type: array
            - type: 'null'
          title: Buttons
      type: object
      required:
        - type
      title: WhatsAppTemplateComponent
    CatalogModelId:
      type: string
      maxLength: 128
      minLength: 3
      pattern: ^[a-z][a-z0-9_-]*/[A-Za-z0-9][A-Za-z0-9._:-]*$
      description: Provider-qualified model identifier.
    LLMReasoningEffort:
      type: string
      enum:
        - none
        - minimal
        - low
        - medium
        - high
        - xhigh
        - max
      title: LLMReasoningEffort
    KnowledgeBaseLocator:
      properties:
        type:
          $ref: '#/components/schemas/KnowledgeBaseDocumentType'
          description: The type of the knowledge base
        name:
          type: string
          title: Name
          description: The name of the knowledge base
        id:
          type: string
          title: Id
          description: The ID of the knowledge base
        usage_mode:
          $ref: '#/components/schemas/DocumentUsageModeEnum'
          description: The usage mode of the knowledge base
          default: auto
      additionalProperties: false
      type: object
      required:
        - type
        - name
        - id
      title: KnowledgeBaseLocator
      example:
        id: '123'
        name: My Knowledge Base
        type: file
        usage_mode: auto
    TwilioMachineDetectionAction:
      type: string
      enum:
        - hang_up
      title: TwilioMachineDetectionAction
    TwilioAnsweredBy:
      type: string
      enum:
        - human
        - fax
        - unknown
        - machine_start
        - machine_end_beep
        - machine_end_silence
        - machine_end_other
      title: TwilioAnsweredBy
      description: Carrier-level AMD verdict reported by Twilio via `AnsweredBy`.
    WhatsAppTemplateComponentButton:
      properties:
        type:
          type: string
          title: Type
        text:
          anyOf:
            - type: string
            - type: 'null'
          title: Text
        url:
          anyOf:
            - type: string
            - type: 'null'
          title: Url
      type: object
      required:
        - type
      title: WhatsAppTemplateComponentButton
    KnowledgeBaseDocumentType:
      type: string
      enum:
        - file
        - url
        - text
        - folder
      title: KnowledgeBaseDocumentType
    DocumentUsageModeEnum:
      type: string
      enum:
        - prompt
        - auto
      title: DocumentUsageModeEnum
      default: auto

````

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