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

# Create a campaign

> Sends one approved template to many people now, or at a time you choose. The people: a list of numbers, a tag, or a saved audience. Every check runs first; a refused campaign makes nothing.

Permission: A Full or Send only key.



## OpenAPI

````yaml /openapi.json post /v1/campaigns
openapi: 3.1.0
info:
  title: GetReply API
  version: 1.0.0
  description: >-
    Send WhatsApp messages, templates, OTPs and campaigns from your own
    software. Every request needs an API key (Developer → API keys) as a Bearer
    token.


    Requests sent here are real and charged like any other.
servers:
  - url: https://api.getreply.in
    description: GetReply
security:
  - bearerAuth: []
tags:
  - name: Account
  - name: Messages
  - name: Templates
  - name: Contacts
  - name: Campaigns
  - name: Webhooks
paths:
  /v1/campaigns:
    post:
      tags:
        - Campaigns
      summary: Create a campaign
      description: >-
        Sends one approved template to many people now, or at a time you choose.
        The people: a list of numbers, a tag, or a saved audience. Every check
        runs first; a refused campaign makes nothing.


        Permission: A Full or Send only key.
      parameters:
        - name: Idempotency-Key
          in: header
          required: true
          description: >-
            Your own unique id for this request (at most 255 characters). The
            same id and body within 24 hours answers the first answer again —
            never a second send or charge.
          schema:
            type: string
            maxLength: 255
          example: campaign-diwali-2026
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - name
                - template
                - audience
              properties:
                name:
                  type: string
                reference:
                  type: string
                  maxLength: 512
                template:
                  type: object
                  required:
                    - name
                    - language
                  properties:
                    name:
                      type: string
                    language:
                      type: string
                audience:
                  type: object
                  description: Exactly one of numbers, tag or saved_audience.
                  properties:
                    numbers:
                      type: array
                      items:
                        type: object
                        required:
                          - to
                        properties:
                          to:
                            type: string
                          body:
                            type: array
                            items:
                              type: string
                          header:
                            type: object
                            properties:
                              text:
                                type: string
                          buttons:
                            type: array
                            items:
                              type: object
                    tag:
                      type: string
                    saved_audience:
                      type: string
                values:
                  type: object
                  description: 'The template''s variables: body, header and buttons.'
                header_media:
                  type: object
                  properties:
                    type:
                      type: string
                    url:
                      type: string
                send_at:
                  type: string
                  description: When to send (ISO 8601). Leave out to send now.
                  format: date-time
            example:
              name: Diwali offer
              template:
                name: diwali_offer
                language: en
              audience:
                tag: VIP
              values:
                body:
                  - from: contact.name
                    default: there
                  - 20%
                buttons:
                  - type: copy_code
                    value: DIWALI20
              header_media:
                type: image
                url: https://example.com/offer.jpg
      responses:
        '201':
          description: 'Created: who goes, who was skipped and why, and the cost by country.'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CampaignCreated'
        '400':
          description: >-
            validation_error: Some fields are missing or wrong. ·
            invalid_number: Not a valid number. · template_variables_mismatch:
            The template's variables don't match.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              examples:
                validation_error:
                  value:
                    error:
                      code: validation_error
                      message: Some fields are missing or wrong.
                invalid_number:
                  value:
                    error:
                      code: invalid_number
                      message: Not a valid number.
                template_variables_mismatch:
                  value:
                    error:
                      code: template_variables_mismatch
                      message: The template's variables don't match.
        '401':
          description: 'unauthorized: API key is missing or not valid.'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              examples:
                unauthorized:
                  value:
                    error:
                      code: unauthorized
                      message: API key is missing or not valid.
        '402':
          description: 'insufficient_balance: Not enough money in your wallet.'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              examples:
                insufficient_balance:
                  value:
                    error:
                      code: insufficient_balance
                      message: Not enough money in your wallet.
        '403':
          description: >-
            key_off: This API key is switched off. · forbidden_scope: This API
            key isn't allowed to do this. · ip_not_allowed: Requests from this
            IP address aren't allowed for this key. · needs_pro_plan: The API
            needs the Pro plan. · plan_ended: Your plan has ended. Renew it to
            send messages.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              examples:
                key_off:
                  value:
                    error:
                      code: key_off
                      message: This API key is switched off.
                forbidden_scope:
                  value:
                    error:
                      code: forbidden_scope
                      message: This API key isn't allowed to do this.
                ip_not_allowed:
                  value:
                    error:
                      code: ip_not_allowed
                      message: >-
                        Requests from this IP address aren't allowed for this
                        key.
                needs_pro_plan:
                  value:
                    error:
                      code: needs_pro_plan
                      message: The API needs the Pro plan.
                plan_ended:
                  value:
                    error:
                      code: plan_ended
                      message: Your plan has ended. Renew it to send messages.
        '404':
          description: 'template_not_found: Template not found.'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              examples:
                template_not_found:
                  value:
                    error:
                      code: template_not_found
                      message: Template not found.
        '409':
          description: >-
            request_id_reused: This request ID was already used for a different
            request. · number_not_ready: Your WhatsApp number can't send
            messages right now.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              examples:
                request_id_reused:
                  value:
                    error:
                      code: request_id_reused
                      message: >-
                        This request ID was already used for a different
                        request.
                number_not_ready:
                  value:
                    error:
                      code: number_not_ready
                      message: Your WhatsApp number can't send messages right now.
        '422':
          description: >-
            daily_limit_reached: Your daily messaging limit is reached. ·
            country_unavailable: WhatsApp isn't available in this country. ·
            no_price: Sending to this country isn't available yet. ·
            template_not_approved: This template isn't approved yet. ·
            audience_empty: No valid numbers to send to. · otp_not_in_campaigns:
            OTP templates can only be sent one by one. · media_unreachable: The
            media link can't be opened. · media_too_large: The media file is too
            large.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              examples:
                daily_limit_reached:
                  value:
                    error:
                      code: daily_limit_reached
                      message: Your daily messaging limit is reached.
                country_unavailable:
                  value:
                    error:
                      code: country_unavailable
                      message: WhatsApp isn't available in this country.
                no_price:
                  value:
                    error:
                      code: no_price
                      message: Sending to this country isn't available yet.
                template_not_approved:
                  value:
                    error:
                      code: template_not_approved
                      message: This template isn't approved yet.
                audience_empty:
                  value:
                    error:
                      code: audience_empty
                      message: No valid numbers to send to.
                otp_not_in_campaigns:
                  value:
                    error:
                      code: otp_not_in_campaigns
                      message: OTP templates can only be sent one by one.
                media_unreachable:
                  value:
                    error:
                      code: media_unreachable
                      message: The media link can't be opened.
                media_too_large:
                  value:
                    error:
                      code: media_too_large
                      message: The media file is too large.
        '429':
          description: 'rate_limited: Too many requests. Try again in a few seconds.'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              examples:
                rate_limited:
                  value:
                    error:
                      code: rate_limited
                      message: Too many requests. Try again in a few seconds.
        '500':
          description: 'server_error: Something went wrong on our side. Try again.'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              examples:
                server_error:
                  value:
                    error:
                      code: server_error
                      message: Something went wrong on our side. Try again.
components:
  schemas:
    CampaignCreated:
      type: object
      properties:
        id:
          type: string
        status:
          type: string
        people:
          type: integer
        skipped:
          type: object
          additionalProperties:
            type: integer
        cost:
          type: object
        reference:
          type:
            - string
            - 'null'
    Error:
      type: object
      required:
        - error
      properties:
        error:
          type: object
          required:
            - code
            - message
          properties:
            code:
              type: string
            message:
              type: string
            field:
              type: string
              description: The one field that is wrong, when there is one.
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: Your API key, e.g. gr_live_…

````

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