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

# Send a campaign (recommended)

> This is the recommended way to deploy a conversation to a list of users, replacing the legacy `/deployment/api/poll/{poll_id}` endpoint (deprecated, turns off November 15, 2026). The request body is unchanged: only the URL is different.

The campaign is queued immediately and processed asynchronously — this endpoint returns `202 Accepted` right away, before users have actually been messaged. Poll the `status_url` from the response (or call `GET /v2/send-campaign/{launch_request_id}`) to check progress.

<Warning>
  Remember that to use this endpoint, you must have obtained your API key in the **Developers** section of the Treble platform.
</Warning>

<Info>
  This replaces the legacy [Deploy a conversation flow](/en/api-reference/endpoints/deploy) endpoint, which will stop working on **November 15, 2026**. The request body is the same — only the URL changes.
</Info>

## Asynchronous processing

This endpoint responds `202 Accepted` as soon as the campaign is queued, before any user has actually been messaged. Use the `status_url` from the response, or call [Get a campaign's status](/en/api-reference/endpoints/send-campaign-status), to check how it's progressing.

## Select which number deploys (multichannel companies)

For multichannel companies, you can select which cellphone will deploy the user with `user_session_keys`. If you want the first number to make the deployment, you can just add the key `deployment_squad` and the corresponding value will be `DS_[CELLPHONE]`. You may add several deployment squads so several numbers can deploy.

```json theme={null}
"user_session_keys": [
  {
    "key": "deployment_squad",
    "value": "DS_[CELLPHONE]"
  }
]
```


## OpenAPI

````yaml open-api-files/treble-api-en.json POST /v2/send-campaign/{poll_id}
openapi: 3.0.1
info:
  title: Treble Poll API
  description: Documentation for the poll deployment endpoint in Treble
  version: 1.0.0
servers:
  - url: https://main.treble.ai
    description: Main Treble server
  - url: https://yourdomain.com
    description: >-
      Example server for implementing webhooks. This represents YOUR server
      where you must implement the endpoints that Treble will call.
security: []
tags:
  - name: Webhooks
    description: >-
      Endpoints that Treble will call on your server. These are not real
      endpoints that you can call, but a representation of the webhooks that
      Treble will invoke in your system.
paths:
  /v2/send-campaign/{poll_id}:
    servers:
      - url: https://campaign-orchestration.treble.ai
        description: Campaign Orchestration server
    post:
      summary: Send a campaign (recommended)
      description: >-
        This is the recommended way to deploy a conversation to a list of users,
        replacing the legacy `/deployment/api/poll/{poll_id}` endpoint
        (deprecated, turns off November 15, 2026). The request body is
        unchanged: only the URL is different.


        The campaign is queued immediately and processed asynchronously — this
        endpoint returns `202 Accepted` right away, before users have actually
        been messaged. Poll the `status_url` from the response (or call `GET
        /v2/send-campaign/{launch_request_id}`) to check progress.
      parameters:
        - name: poll_id
          in: path
          required: true
          description: ID of the poll you want to deploy
          schema:
            type: string
        - name: Authorization
          in: header
          required: true
          description: >-
            Authorization API Key. Can be obtained at
            https://app.treble.ai/en/dashboard/settings/developers
          schema:
            type: string
          example: API_KEY
      requestBody:
        description: Information of the users to whom the poll will be deployed
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - users
              properties:
                users:
                  type: array
                  description: List of users to whom the poll will be deployed
                  items:
                    type: object
                    required:
                      - cellphone
                      - country_code
                      - user_session_keys
                    properties:
                      cellphone:
                        type: string
                        description: >-
                          User's phone number without the country code (e.g.,
                          '3051234567')
                      country_code:
                        type: string
                        description: Country code with the + symbol (e.g., '+57')
                      user_session_keys:
                        type: array
                        description: >-
                          Variables that can be replaced in question texts or
                          delivered when a webhook is called. For multi-channel
                          companies, you can include the 'deployment_squad' key
                          to select which phone number will perform the
                          deployment.
                        items:
                          type: object
                          required:
                            - key
                            - value
                          properties:
                            key:
                              type: string
                              description: >-
                                Name of the variable. Special values include
                                'deployment_squad' to select which phone number
                                will perform the deployment.
                            value:
                              type: string
                              description: >-
                                Value of the variable. For 'deployment_squad',
                                the value must be 'DS_[CELLPHONE]'.
                      deployment_eta:
                        type: integer
                        description: >-
                          UNIX UTC timestamp to schedule the deployment for a
                          future date (optional). Example: 1615823201 (March 15,
                          2021, 3:46:41 PM UTC)
            examples:
              Basic example:
                value:
                  users:
                    - cellphone: '3051234567'
                      country_code: '+57'
                      user_session_keys:
                        - key: name
                          value: John
                        - key: TransID
                          value: '12345'
                        - key: schoolname
                          value: Redschool
              Example with deployment_eta:
                value:
                  users:
                    - cellphone: '3051234567'
                      country_code: '+57'
                      user_session_keys:
                        - key: name
                          value: Jhon
                      deployment_eta: 1615823201
              Example with deployment_squad:
                value:
                  users:
                    - cellphone: '3051234567'
                      country_code: '+57'
                      user_session_keys:
                        - key: name
                          value: Jhon
                        - key: deployment_squad
                          value: DS_[CELLPHONE]
      responses:
        '202':
          description: The campaign was queued for processing
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                    description: Confirmation message
                  id:
                    type: string
                    description: Poll ID
                  batch_id:
                    type: string
                    description: Idempotency / batch key for this submission
                  launch_request_id:
                    type: string
                    description: ID to track this submission's progress
                  status_url:
                    type: string
                    description: Path to poll for this submission's status
              example:
                message: The campaign was queued
                id: '1251072'
                batch_id: acaab9ea-8754-4d6a-98b1-ace451c7d930
                launch_request_id: 59d7ef01-4518-444f-816e-1c45c1748974
                status_url: /v2/send-campaign/59d7ef01-4518-444f-816e-1c45c1748974
        '400':
          description: Error in the request
          content:
            application/json:
              schema:
                type: object
                properties:
                  detail:
                    type: string
                    description: Error description
              example:
                detail: poll_id is required, either in the URL or the body
        '401':
          description: >-
            Unauthorized. Invalid or missing API Key, or invalid/expired session
            token.
          content:
            application/json:
              schema:
                type: object
                properties:
                  detail:
                    type: string
                    description: Error description
              example:
                detail: Invalid API key
        '404':
          description: There is no poll for this company
          content:
            application/json:
              schema:
                type: object
                properties:
                  detail:
                    type: string
                    description: Error description
              example:
                detail: There is no poll for this company
      deprecated: true

````

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