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

# Get a campaign

> Get an outbound campaign and its lead counts.



## OpenAPI

````yaml /api-reference/openapi.json get /v1/convai/outbound-campaigns/campaigns/{campaign_id}
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}:
    get:
      tags:
        - Agents Platform
      summary: Get a campaign
      description: Get an outbound campaign and its lead counts.
      operationId: get_campaign
      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.
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CampaignResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
components:
  schemas:
    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
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    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
    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
    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
    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
    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
    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

````

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