> ## Documentation Index
> Fetch the complete documentation index at: https://onextel-09023014.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Create a campaign

> Send an approved template to a contact list, now, later or as a draft.

The quickest path is one call with `launch: true`:

```json theme={null}
{
  "name": "Diwali sale, wave 1",
  "template_id": "TEMPLATE_ID",
  "list_id": "LIST_ID",
  "launch": true,
  "scheduled_at": "2026-11-02T10:00:00+05:30"
}
```

Leave out `scheduled_at` to start now, or leave out `launch` to keep a draft.

While it runs, OneXtel skips opted-out numbers and applies Truecaller's promotional limits:
at most 3 promotional messages per person per day, 4 per person from one sender in 28 days, and
the sender's daily limit. Skipped contacts show as `blocked` with the reason.


## OpenAPI

````yaml api-reference/truecaller/openapi.yaml POST /v1/campaigns
openapi: 3.1.0
info:
  title: OneXtel Truecaller Business Messaging API
  version: 1.0.0
  description: >
    Send verified business messages to Truecaller users: single messages,
    templates with

    personalisation, images, files and buttons, and campaigns to contact lists.


    Every request carries a workspace API key in the `x-api-key` header. Create
    one in the

    Truecaller campaigns portal under **Developers → API keys**.


    Errors are JSON with a single `error` string (and `details` for validation
    errors):


    ```json

    { "error": "invalid phone number" }

    ```
servers:
  - url: https://truecaller.udchowdhury.me
    description: Production
security:
  - apiKey: []
tags:
  - name: Messages
    description: Send one message and read its status.
  - name: Templates
    description: Reusable messages with variables, media and buttons.
  - name: Media
    description: Upload files to attach to templates.
  - name: Contact lists
    description: Audiences for campaigns.
  - name: Campaigns
    description: Send a template to a whole contact list, now or later.
  - name: Senders
    description: The verified business profiles your workspace sends from.
paths:
  /v1/campaigns:
    post:
      tags:
        - Campaigns
      summary: Create a campaign
      description: >
        Creates a campaign from an approved template and a contact list. With
        `launch: true` it

        starts sending straight away (or at `scheduled_at`); otherwise it stays
        a draft for

        [Launch a campaign](/api-reference/truecaller/launch-campaign).
      operationId: createCampaign
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - name
                - template_id
                - list_id
              properties:
                name:
                  type: string
                  maxLength: 100
                  example: Diwali sale, wave 1
                template_id:
                  type: string
                  format: uuid
                list_id:
                  type: string
                  format: uuid
                sender_id:
                  type: string
                  description: >-
                    One of the workspace's active senders. Defaults to the first
                    active sender.
                launch:
                  type: boolean
                  default: false
                  description: Start sending now (or at `scheduled_at`).
                scheduled_at:
                  type: string
                  format: date-time
                  description: ISO 8601 with offset, e.g. 2026-11-02T10:00:00+05:30.
                variable_defaults:
                  type: object
                  additionalProperties:
                    type: string
                  description: >-
                    Fallbacks for empty contact columns, on top of the
                    template's own defaults.
                track_links:
                  type: boolean
                  default: true
                  description: >-
                    Rewrite links and link buttons through a short redirect so
                    clicks are counted.
      responses:
        '201':
          description: Created (and launched, if asked).
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Campaign'
        '400':
          $ref: '#/components/responses/BadRequest'
components:
  schemas:
    Campaign:
      type: object
      properties:
        id:
          type: string
          format: uuid
        name:
          type: string
        status:
          type: string
          enum:
            - draft
            - scheduled
            - running
            - completed
            - cancelled
        template_id:
          type: string
          format: uuid
        template_name:
          type: string
        list_id:
          type: string
          format: uuid
        list_name:
          type: string
        sender_id:
          type: string
        scheduled_at:
          type:
            - string
            - 'null'
          format: date-time
        started_at:
          type:
            - string
            - 'null'
          format: date-time
        completed_at:
          type:
            - string
            - 'null'
          format: date-time
        note:
          type:
            - string
            - 'null'
          description: Why a running campaign is waiting
          e.g. a daily sender limit.: null
        recipients:
          type: integer
        processed:
          type: integer
        sent:
          type: integer
        delivered:
          type: integer
        read:
          type: integer
        failed:
          type: integer
        blocked:
          type: integer
        queued:
          type: integer
    Error:
      type: object
      properties:
        error:
          type: string
        details:
          type: array
          items:
            type: object
  responses:
    BadRequest:
      description: >-
        The request is invalid. `details` lists each problem for validation
        errors.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error: invalid body
            details:
              - path:
                  - to
                message: Required
  securitySchemes:
    apiKey:
      type: apiKey
      in: header
      name: x-api-key
      description: >-
        Workspace API key from **Developers → API keys**. It starts with
        `tc_live_`.

````

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