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

# Create campaign

> Create a one-time campaign that sends up to 5 Meta templates, in order, to the contacts of a segment. A recipient who replies stops receiving the steps after it. One campaign can be created every 30 minutes per account.

Creates a one-time campaign that sends up to 5 Meta templates, in order, to the contacts of a segment.

## How it sends

* **Audience**: the segment's contacts are captured when the campaign is created. Contacts who join the segment later are not added.
* **Steps**: each step waits `wait_before` (1 day by default) after the previous one. A recipient who replies stops receiving the steps after it.
* **Start**: `start_at` is `"now"` (the default) or a future date-time. Without `batch_size`, everyone is released at once; with `batch_size` and `batch_interval_minutes`, the audience is released in batches until everyone has been reached.

## Template variables

`variables` sets each template variable by its position: `"1"` is `{{1}}`, counted across header, body and buttons, in that order. A value is either fixed text or a contact placeholder resolved for each recipient:

| Placeholder | Value |
| - | - |
| `__CONTACT_NAME__` | Contact name |
| `__CONTACT_EMAIL__` | Contact email |
| `__CONTACT_PHONE__` | Contact phone |

Header and body variables you leave out are written by the AI for each recipient, from their contact information and conversation. The response lists them in `ai_filled_variables`. Button variables (URLs, phone numbers and button text) are required.

## Limits

One campaign can be created every 30 minutes per account. A request inside that window answers `429` with `retry_after_seconds`. Requests rejected with a `4xx` before the campaign is created do not start the window.

Track the campaign with [Get campaign](/reference/campaigns/get-campaign) and [Get campaign recipients](/reference/campaigns/get-campaign-recipients).


## OpenAPI

````yaml post /api/public/outreach-campaign
openapi: 3.0.0
info:
  title: Vambe AI API
  description: Vambe AI documentation
  version: '1.0'
  contact: {}
servers:
  - url: https://api.vambe.me
    description: Production Server
security: []
tags:
  - name: Vambe AI
    description: ''
paths:
  /api/public/outreach-campaign:
    post:
      tags:
        - Campaigns
      summary: Create campaign
      description: >-
        Create a one-time campaign that sends up to 5 Meta templates, in order,
        to the contacts of a segment. A recipient who replies stops receiving
        the steps after it. One campaign can be created every 30 minutes per
        account.
      operationId: PublicCampaignController_createCampaign
      parameters:
        - name: x-api-key
          in: header
          description: API key needed to authorize the request
          required: true
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - name
                - segment_id
                - steps
              properties:
                name:
                  type: string
                  minLength: 1
                  maxLength: 255
                segment_id:
                  type: string
                  format: uuid
                  description: >-
                    The segment to send to. Its contacts are captured when the
                    campaign is created; contacts who join the segment later are
                    not added.
                steps:
                  type: array
                  minItems: 1
                  maxItems: 5
                  description: >-
                    The messages to send, in order. A recipient who replies
                    stops receiving the steps after it.
                  items:
                    type: object
                    required:
                      - type
                      - template_id
                      - channel_id
                      - stage_id
                    properties:
                      type:
                        type: string
                        enum:
                          - meta_template
                      template_id:
                        type: string
                        format: uuid
                        description: An approved Meta template, from List Meta templates
                      channel_id:
                        type: string
                        format: uuid
                        description: The WhatsApp channel the template is sent from
                      stage_id:
                        type: string
                        format: uuid
                        description: The pipeline stage recipients are placed in
                      variables:
                        type: object
                        additionalProperties:
                          type: string
                        example:
                          '1': __CONTACT_NAME__
                          '2': 20% off
                        description: >-
                          Values by variable position ("1" is {{1}}), counted
                          across header, body and buttons. A value may be fixed
                          text or a contact placeholder such as
                          `__CONTACT_NAME__`. Header and body variables left out
                          are written by the AI for each recipient; button
                          variables are required.
                      file_url:
                        type: string
                        format: uri
                        description: >-
                          Media for a template with an image, video or document
                          header. Defaults to the template's own media.
                      wait_before:
                        type: object
                        required:
                          - amount
                          - unit
                        properties:
                          amount:
                            type: integer
                            minimum: 1
                          unit:
                            type: string
                            enum:
                              - minutes
                              - hours
                              - days
                        description: >-
                          Time between the previous step and this one, at most
                          30 days. Defaults to 1 day. Not allowed on the first
                          step.
                sending:
                  type: object
                  properties:
                    start_at:
                      type: string
                      default: now
                      description: '"now", or a future ISO 8601 date-time.'
                      example: '2026-10-20T13:00:00Z'
                    batch_size:
                      type: integer
                      minimum: 1
                      maximum: 50000
                      description: >-
                        Recipients released per batch. Send together with
                        batch_interval_minutes; leave both out to release
                        everyone at once.
                    batch_interval_minutes:
                      type: integer
                      minimum: 1
                      description: Minutes between batches.
      responses:
        '201':
          description: Campaign created and scheduled.
          content:
            application/json:
              schema:
                type: object
                properties:
                  id:
                    format: uuid
                    type: string
                  name:
                    type: string
                  segment_id:
                    format: uuid
                    type: string
                  audience_size:
                    type: integer
                    description: Contacts captured from the segment
                  start_at:
                    format: date-time
                    type: string
                  batch_size:
                    type: integer
                    nullable: true
                  batch_interval_minutes:
                    type: integer
                    nullable: true
                  steps:
                    type: array
                    items:
                      type: object
                      properties:
                        step_number:
                          type: integer
                        type:
                          type: string
                          enum:
                            - meta_template
                        template_id:
                          format: uuid
                          type: string
                        channel_id:
                          format: uuid
                          type: string
                        stage_id:
                          format: uuid
                          type: string
                        wait_before:
                          type: object
                          required:
                            - amount
                            - unit
                          properties:
                            amount:
                              type: integer
                              minimum: 1
                            unit:
                              type: string
                              enum:
                                - minutes
                                - hours
                                - days
                          nullable: true
                        ai_filled_variables:
                          type: array
                          items:
                            type: string
                          description: >-
                            Variable positions the AI writes for each recipient
                            because no value was given
        '400':
          description: >-
            Invalid request: an empty segment, a template that is not approved
            or not enabled on the channel, an invalid stage, a missing button
            variable or a start_at in the past.
        '404':
          description: Template or segment not found
        '429':
          description: >-
            A campaign was created less than 30 minutes ago. The body carries
            retry_after_seconds.

````

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