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

# Add contacts to broadcast

> Add contacts to a broadcast in batch. Maximum 1000 contacts per request.



## OpenAPI

````yaml /openapi.json post /v1/broadcasts/{broadcastId}/contacts
openapi: 3.0.3
info:
  title: Zavu Unified Messaging Layer API
  version: 0.2.0
  description: >
    Unified multi-channel messaging API for Zavu.


    Supported channels:

    - **SMS**: Simple text messages

    - **WhatsApp**: Rich messaging with media, buttons, lists, CTA URL buttons,
    and templates

    - **Telegram**: Bot messaging with text, media, and interactive elements

    - **Email**: Transactional emails via Amazon SES


    Design goals:

    - Simple `send()` entrypoint for developers

    - Project-level authentication via Bearer token

    - Support for all WhatsApp message types (text, image, video, audio,
    document, sticker, location, contact, buttons, list, cta_url, reaction,
    template)

    - If a non-text message type is sent, WhatsApp channel is used automatically

    - 24-hour WhatsApp conversation window enforcement

    - Universal `to` field accepts phone numbers (E.164), email addresses, or
    numeric chat IDs (Telegram/Instagram)
servers:
  - url: https://api.zavu.dev
security:
  - bearerAuth: []
paths:
  /v1/broadcasts/{broadcastId}/contacts:
    post:
      summary: Add contacts to broadcast
      description: Add contacts to a broadcast in batch. Maximum 1000 contacts per request.
      operationId: addBroadcastContacts
      parameters:
        - $ref: '#/components/parameters/BroadcastIdParam'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/BroadcastContactsAddRequest'
            example:
              contacts:
                - recipient: '+14155551234'
                  templateVariables:
                    name: John
                    order_id: ORD-001
                - recipient: '+14155555678'
                  templateVariables:
                    name: Jane
                    order_id: ORD-002
      responses:
        '201':
          description: Contacts added.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BroadcastContactsAddResponse'
        '400':
          description: Invalid request or broadcast not in draft status.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          description: Unauthorized.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: Broadcast not found.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
      security:
        - bearerAuth: []
components:
  parameters:
    BroadcastIdParam:
      name: broadcastId
      in: path
      required: true
      schema:
        type: string
  schemas:
    BroadcastContactsAddRequest:
      type: object
      required:
        - contacts
      properties:
        contacts:
          type: array
          description: List of contacts to add (max 1000 per request).
          maxItems: 1000
          items:
            $ref: '#/components/schemas/BroadcastContactInput'
    BroadcastContactsAddResponse:
      type: object
      required:
        - added
        - duplicates
        - invalid
      properties:
        added:
          type: integer
          description: Number of contacts successfully added.
        duplicates:
          type: integer
          description: Number of duplicate contacts skipped.
        invalid:
          type: integer
          description: Number of invalid contacts rejected.
        errors:
          type: array
          description: Details about invalid contacts.
          items:
            type: object
            properties:
              recipient:
                type: string
              reason:
                type: string
    Error:
      type: object
      required:
        - code
        - message
      properties:
        code:
          type: string
          example: invalid_request
        message:
          type: string
          example: Phone number is invalid
        details:
          type: object
          additionalProperties: true
    BroadcastContactInput:
      type: object
      required:
        - recipient
      properties:
        recipient:
          type: string
          description: Phone number (E.164) or email address.
          example: '+14155551234'
        templateVariables:
          type: object
          description: >-
            Per-contact body variables. Keys are positions (1, 2, ...) matching
            the order placeholders appear in the template body.
          additionalProperties:
            type: string
          example:
            '1': John
            '2': ORD-12345
        templateButtonVariables:
          type: object
          description: >-
            Per-contact button variables for dynamic URL/OTP buttons. Keys are
            the button index (0, 1, 2).
          additionalProperties:
            type: string
          example:
            '0': abc-report-token
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT

````