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

# Create a broadcast

> Create a broadcast



## OpenAPI

````yaml openapi.json POST /v1/broadcasts
openapi: 3.1.0
info:
  title: Watahub API
  version: 0.2.0
  description: >-
    Tenant API of Watahub, the multi-tenant WhatsApp Cloud API gateway.
    Authenticate every request with your API key as `Authorization: Bearer
    <key>` or `X-API-Key: <key>`.


    - Shapes the gateway owns are closed: no other field appears.

    - Records that come from Meta are open: documented fields are listed and any
    other field Meta adds is passed through.

    - The `/vN.N` proxy passes Meta's body and status through untouched; the
    version in the path is accepted and ignored.
servers:
  - url: https://cloud.watahub.dev
security:
  - bearerApiKey: []
  - headerApiKey: []
tags:
  - name: Messages
  - name: Media
  - name: Templates
  - name: Graph-compatible proxy
    description: >-
      Drop-in for Meta's Graph API on three routes. Meta's response is returned
      as is.
  - name: Phones
    description: Phones
  - name: Conversations
    description: Conversations
  - name: Connect
    description: Connect
  - name: Customers
    description: Customers
  - name: Webhooks
    description: Webhooks
  - name: Logs
    description: Logs
  - name: Health
    description: Health
  - name: Message templates
    description: >-
      Templates cached by the gateway per WABA; synced from Meta and required by
      broadcasts.
  - name: Broadcasts
    description: >-
      Send one approved template to up to 500 recipients; sending is queued and
      drained in the background.
paths:
  /v1/broadcasts:
    post:
      tags:
        - Broadcasts
      summary: Create a broadcast
      description: >-
        Creates a `draft` with one `pending` recipient per unique number.
        Nothing is sent until you call send.
      operationId: createBroadcast
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/BroadcastCreate'
      responses:
        '201':
          description: Draft created.
          content:
            application/json:
              schema:
                type: object
                required:
                  - broadcast
                properties:
                  broadcast:
                    $ref: '#/components/schemas/Broadcast'
        '400':
          description: >-
            Invalid input, inactive phone, or template not cached (`Template not
            found; sync first`) or not `APPROVED`.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '402':
          $ref: '#/components/responses/PaymentRequired'
        '404':
          $ref: '#/components/responses/NotFound'
        '429':
          $ref: '#/components/responses/RateLimited'
        '503':
          $ref: '#/components/responses/Unavailable'
components:
  schemas:
    BroadcastCreate:
      type: object
      required:
        - name
        - phoneNumberId
        - templateName
        - templateLanguage
        - recipients
      properties:
        name:
          type: string
        phoneNumberId:
          type: string
          pattern: ^\d+$
          description: An active phone of the tenant.
        templateName:
          type: string
          minLength: 1
          maxLength: 512
          description: Must be cached and `APPROVED`; run a sync first.
        templateLanguage:
          type: string
          minLength: 2
          maxLength: 16
        templateComponents:
          type: array
          maxItems: 10
          items:
            type: object
            additionalProperties: true
          description: Parameters sent to every recipient.
        recipients:
          type: array
          minItems: 1
          maxItems: 500
          items:
            type: string
            pattern: ^\d{6,20}$
          description: >-
            Numbers without `+`; a leading `+` is stripped and duplicates are
            removed.
      additionalProperties: false
    Broadcast:
      type: object
      required:
        - id
        - phoneNumberId
        - wabaId
        - name
        - templateName
        - templateLanguage
        - templateComponents
        - status
        - createdAt
        - updatedAt
        - startedAt
        - completedAt
        - counts
      properties:
        id:
          type: string
          format: uuid
        phoneNumberId:
          type: string
        wabaId:
          type: string
        name:
          type: string
        templateName:
          type: string
        templateLanguage:
          type: string
        templateComponents:
          type:
            - array
            - 'null'
          items:
            type: object
            additionalProperties: true
        status:
          type: string
          enum:
            - draft
            - queued
            - sending
            - completed
            - cancelled
            - failed
        createdAt:
          type: integer
          description: Unix time in milliseconds.
        updatedAt:
          type: integer
          description: Unix time in milliseconds.
        startedAt:
          type:
            - integer
            - 'null'
          description: Unix time in milliseconds.
        completedAt:
          type:
            - integer
            - 'null'
          description: Unix time in milliseconds.
        counts:
          type: object
          description: Recipients per status; a status with no recipients is omitted.
          propertyNames:
            enum:
              - pending
              - sent
              - failed
              - skipped
          additionalProperties:
            type: integer
      additionalProperties: false
    Error:
      type: object
      required:
        - error
      properties:
        error:
          type: string
  responses:
    Unauthorized:
      description: Missing or invalid API key.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    PaymentRequired:
      description: Account requires payment.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    NotFound:
      description: Resource not found or not owned by this account.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    RateLimited:
      description: >-
        Too many requests (account rate limit, 10 failed keys/min per IP, or 20
        setup links/hour).
      headers:
        Retry-After:
          schema:
            type: integer
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    Unavailable:
      description: Gateway paused, in maintenance, or Meta app not configured.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
  securitySchemes:
    bearerApiKey:
      type: http
      scheme: bearer
      description: Tenant API key.
    headerApiKey:
      type: apiKey
      in: header
      name: X-API-Key
      description: Tenant API key.

````

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