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

# Create a broadcast

> Target either a saved segment or an explicit list of phone numbers. Opt-outs and frequency caps are enforced when the broadcast runs, not when it is created.

With `start: true`, in live mode a broadcast must fit in what is left of the plan's monthly Live broadcast sends. One that does not is refused with `422`, and `message` says how many sends are left and when they reset. Test mode is never limited.

**Required scope:** `messages:send`



## OpenAPI

````yaml /api-reference/openapi.json post /v1/broadcasts
openapi: 3.1.0
info:
  title: LazyApp API
  version: v1
  description: >-
    One WhatsApp API for developers, SaaS platforms and businesses.


    Every endpoint is Bearer-authenticated with a LazyApp API key, returns JSON,
    and is scoped to the workspace and mode (`live` or `test`) the key belongs
    to.


    Live keys need the Pro plan. A live key on a workspace below Pro gets `402`
    with `code: plan_limit_reached` on every request. Test keys work on every
    plan, so you can build against the test number before you upgrade.


    LazyApp adds 0% to Meta's message rates. Meta bills each message to the
    business's own Meta payment method; your LazyApp plan is billed separately.
  contact:
    name: LazyApp support
    url: https://lazyapp.in
servers:
  - url: https://lazyapp.in
    description: Production
security:
  - bearerAuth: []
tags:
  - name: Messages
    description: Send and schedule WhatsApp messages.
  - name: Contacts
    description: The people you message, and their identifiers.
  - name: Conversations
    description: Threads and their message history.
  - name: Calls
    description: WhatsApp call history for the workspace.
  - name: Templates
    description: Create, submit and sync message templates.
  - name: Media
    description: Upload, retrieve and delete media.
  - name: Broadcasts
    description: Template sends to many contacts at once.
  - name: Events
    description: Say what happened; LazyApp picks the template.
  - name: Flows
    description: WhatsApp Flows and their responses.
  - name: Webhooks
    description: Register endpoints and inspect deliveries.
  - name: Workflows
    description: Automations and their executions.
  - name: Verify
    description: One-time passcodes over WhatsApp.
  - name: Capabilities
    description: What each connected number supports.
  - name: Catalog
    description: Proxy Meta Commerce catalog products for a connection.
  - name: Platform
    description: Manage customers if you run a platform on LazyApp.
  - name: Meta-compatible proxy
    description: Drop-in endpoints for existing Cloud API integrations.
  - name: Connections
    description: >-
      Your WhatsApp numbers and the account behind them: health, limits,
      registration, display name, blue tick, QR codes, conversation starters,
      opt-in links, business profile and blocked users.
  - name: Billing
    description: >-
      Meta's message rates, which LazyApp passes on with 0% added, and the
      billing facts behind them.
  - name: Analytics
    description: Workspace messaging aggregates.
  - name: Groups
    description: WhatsApp group chats on a connection Meta has enabled.
  - name: Funding
    description: Local funding status and recorded WhatsApp charges.
  - name: Connections
    description: 'WhatsApp connections: block users, business profile, insights.'
  - name: Payments
    description: >-
      WhatsApp payments in India: ask for payment, follow it, update the order
      and refund.
paths:
  /v1/broadcasts:
    post:
      tags:
        - Broadcasts
      summary: Create a broadcast
      description: >-
        Target either a saved segment or an explicit list of phone numbers.
        Opt-outs and frequency caps are enforced when the broadcast runs, not
        when it is created.


        With `start: true`, in live mode a broadcast must fit in what is left of
        the plan's monthly Live broadcast sends. One that does not is refused
        with `422`, and `message` says how many sends are left and when they
        reset. Test mode is never limited.


        **Required scope:** `messages:send`
      parameters:
        - name: Idempotency-Key
          in: header
          description: >-
            Optional. Makes this write safe to retry: the same key replays the
            first response instead of acting twice.
          schema:
            type: string
            maxLength: 255
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                name:
                  type: string
                  maxLength: 200
                template_name:
                  type: string
                  maxLength: 512
                language:
                  type: string
                  maxLength: 16
                variable_map:
                  type: object
                  description: >-
                    How each recipient's template is filled. A slot is a fixed
                    string, or an object naming a contact attribute or field.
                  properties:
                    header:
                      oneOf:
                        - type: string
                          maxLength: 255
                        - type: object
                          properties:
                            source:
                              type: string
                              enum:
                                - static
                                - contact_attribute
                                - contact_field
                            value:
                              type: string
                              description: For `static`.
                            key:
                              type: string
                              description: For `contact_attribute`.
                            field:
                              type: string
                              enum:
                                - phone_number
                                - username
                                - email
                                - external_id
                                - crm_id
                                - preferred_language
                                - timezone
                                - bsuid
                              description: For `contact_field`.
                          required:
                            - source
                      description: Fills a `{{1}}` in a text header.
                    header_media:
                      type: string
                      maxLength: 2000
                      description: >-
                        For an image, video or document header: a public https
                        URL or an uploaded media id.
                    body:
                      type: array
                      maxItems: 20
                      items:
                        oneOf:
                          - type: string
                            maxLength: 255
                          - type: object
                            properties:
                              source:
                                type: string
                                enum:
                                  - static
                                  - contact_attribute
                                  - contact_field
                              value:
                                type: string
                                description: For `static`.
                              key:
                                type: string
                                description: For `contact_attribute`.
                              field:
                                type: string
                                enum:
                                  - phone_number
                                  - username
                                  - email
                                  - external_id
                                  - crm_id
                                  - preferred_language
                                  - timezone
                                  - bsuid
                                description: For `contact_field`.
                            required:
                              - source
                      description: Body variables in order.
                    buttons:
                      type: array
                      maxItems: 2
                      items:
                        oneOf:
                          - type: string
                            maxLength: 255
                          - type: object
                            properties:
                              source:
                                type: string
                                enum:
                                  - static
                                  - contact_attribute
                                  - contact_field
                              value:
                                type: string
                                description: For `static`.
                              key:
                                type: string
                                description: For `contact_attribute`.
                              field:
                                type: string
                                enum:
                                  - phone_number
                                  - username
                                  - email
                                  - external_id
                                  - crm_id
                                  - preferred_language
                                  - timezone
                                  - bsuid
                                description: For `contact_field`.
                            required:
                              - source
                      description: >-
                        Link suffix for each dynamic URL button, by button
                        index.
                    features:
                      type: object
                      description: >-
                        Offer, coupon, catalog and carousel inputs. Carousel
                        cards take `features.cards[].header_media`, `body`,
                        `buttons` and `quick_replies`.
                      properties:
                        coupon_code:
                          type: string
                          maxLength: 20
                        offer_expires_at:
                          type: string
                        cards:
                          type: array
                          maxItems: 10
                          items:
                            type: object
                            properties:
                              header_media:
                                type: string
                                maxLength: 2000
                              product_retailer_id:
                                type: string
                                maxLength: 100
                              body:
                                type: array
                                items:
                                  oneOf:
                                    - type: string
                                      maxLength: 255
                                    - type: object
                                      properties:
                                        source:
                                          type: string
                                          enum:
                                            - static
                                            - contact_attribute
                                            - contact_field
                                        value:
                                          type: string
                                          description: For `static`.
                                        key:
                                          type: string
                                          description: For `contact_attribute`.
                                        field:
                                          type: string
                                          enum:
                                            - phone_number
                                            - username
                                            - email
                                            - external_id
                                            - crm_id
                                            - preferred_language
                                            - timezone
                                            - bsuid
                                          description: For `contact_field`.
                                      required:
                                        - source
                              buttons:
                                type: array
                                items:
                                  oneOf:
                                    - type: string
                                      maxLength: 255
                                    - type: object
                                      properties:
                                        source:
                                          type: string
                                          enum:
                                            - static
                                            - contact_attribute
                                            - contact_field
                                        value:
                                          type: string
                                          description: For `static`.
                                        key:
                                          type: string
                                          description: For `contact_attribute`.
                                        field:
                                          type: string
                                          enum:
                                            - phone_number
                                            - username
                                            - email
                                            - external_id
                                            - crm_id
                                            - preferred_language
                                            - timezone
                                            - bsuid
                                          description: For `contact_field`.
                                      required:
                                        - source
                              quick_replies:
                                type: array
                                items:
                                  oneOf:
                                    - type: string
                                      maxLength: 255
                                    - type: object
                                      properties:
                                        source:
                                          type: string
                                          enum:
                                            - static
                                            - contact_attribute
                                            - contact_field
                                        value:
                                          type: string
                                          description: For `static`.
                                        key:
                                          type: string
                                          description: For `contact_attribute`.
                                        field:
                                          type: string
                                          enum:
                                            - phone_number
                                            - username
                                            - email
                                            - external_id
                                            - crm_id
                                            - preferred_language
                                            - timezone
                                            - bsuid
                                          description: For `contact_field`.
                                      required:
                                        - source
                      additionalProperties: true
                  example:
                    header_media: https://cdn.acme.example/campus.jpg
                    body:
                      - source: contact_attribute
                        key: first_name
                      - Autumn 2027
                contact_segment_id:
                  type: integer
                phone_numbers:
                  type: array
                  maxItems: 50000
                  items:
                    type: string
                    maxLength: 32
                schedule_at:
                  type: string
                  format: date-time
                  nullable: true
                quiet_hours:
                  type: object
                  properties:
                    start:
                      type: string
                      pattern: ^\d{1,2}:\d{2}$
                    end:
                      type: string
                      pattern: ^\d{1,2}:\d{2}$
                    timezone:
                      type: string
                frequency_cap_days:
                  type: integer
                  minimum: 1
                  maximum: 365
                whatsapp_connection_id:
                  type: integer
                start:
                  type: boolean
                  description: Start immediately after creating.
                contact_segment_uuid:
                  type: string
                  format: uuid
                  description: >-
                    The audience: a segment from `/v1/contact-segments`.
                    Preferred over `contact_segment_id`.
              required:
                - name
                - template_name
                - language
      responses:
        '201':
          description: Created.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Broadcast'
        '401':
          description: Missing or invalid API key.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '402':
          $ref: '#/components/responses/PlanLimitReached'
        '403':
          description: >-
            The key lacks the required scope, or is restricted from this phone
            number.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '422':
          description: >-
            Validation failed, or the broadcast could not start (for example, it
            is larger than the monthly Live broadcast sends left).
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ValidationError'
        '429':
          description: Rate limit exceeded.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
components:
  schemas:
    Broadcast:
      type: object
      properties:
        uuid:
          type: string
        name:
          type: string
        status:
          type: string
        template_name:
          type: string
        language:
          type: string
        schedule_at:
          type: string
          format: date-time
          nullable: true
        stats:
          type: object
          properties: {}
        created_at:
          type: string
          format: date-time
          nullable: true
    Error:
      type: object
      properties:
        message:
          type: string
          description: Human-readable description of what went wrong.
        code:
          type: string
          description: >-
            Stable machine-readable reason, when the failure is one a client can
            branch on.
      required:
        - message
    ValidationError:
      type: object
      properties:
        message:
          type: string
        errors:
          type: object
          additionalProperties:
            type: array
            items:
              type: string
          description: Field name to list of failures.
      required:
        - message
  responses:
    PlanLimitReached:
      description: >-
        The workspace's plan does not allow this. A live key on a workspace
        below Pro gets this on every request, because the live API is a Pro
        feature. Upgrade in **Billing** to use live keys. Test keys are never
        limited, on any plan.


        `code` is always `plan_limit_reached`. Show `message` to the person: it
        names the plan to move to.


        Other plan limits use the same code in the console, but the API reports
        them differently today: a broadcast larger than the month's remaining
        Live broadcast sends is refused with `422` and the reason in `message`,
        and connecting a number beyond the plan's number capacity fails
        validation (`422`) on `phone_number_id`.
      content:
        application/json:
          schema:
            type: object
            properties:
              message:
                type: string
                description: >-
                  A sentence you can show to the person. Says which plan to move
                  to.
              code:
                type: string
                enum:
                  - plan_limit_reached
            required:
              - message
              - code
          example:
            message: >-
              The API is on the Pro plan. Upgrade in Billing to use live keys.
              Test keys keep working.
            code: plan_limit_reached
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: Your API key, e.g. `sk_live_...` or `sk_test_...`.

````

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