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

# Queue template send job

> Accepts a bulk template send and processes it in the background. The request is validated at the door, queued durably, and returns `202 Accepted` immediately with a job id. Send an `Idempotency-Key` header to make retries safe: repeats of the same key within seven days return the original job id instead of sending the batch again. Without the header, Flowella derives a key from the request body, so an identical batch submitted twice in quick succession is not double-sent. Recipients are processed individually, so one invalid number does not block the rest of the batch.



## OpenAPI

````yaml /api-reference/openapi.json post /v1/templates/send
openapi: 3.0.0
info:
  title: Flowella REST API
  version: 2.1.0
  description: >-
    Public v1 HTTP API for Flowella. Authenticate with `Authorization: Bearer
    <api_key>` (`flo_` prefix). Canonical base: `https://api.flowella.io/v1`.
    Legacy `https://app.flowella.io/api/v1/...` requests are permanently
    redirected (308) to the canonical host, preserving method and body.
servers:
  - url: https://api.flowella.io
    description: Canonical API host
  - url: https://app.flowella.io
    description: Legacy app host — /api/v1 permanently redirects (308) to the API host /v1
security: []
tags:
  - name: System
    description: Health and auth checks
  - name: Messages
    description: Send WhatsApp messages
  - name: Conversations
    description: Inbox conversations
  - name: Contacts
    description: CRM contacts
  - name: Templates
    description: WhatsApp templates and bulk send
  - name: Analytics
    description: Usage and delivery metrics
paths:
  /v1/templates/send:
    post:
      tags:
        - Templates
      summary: Queue template send job
      description: >-
        Accepts a bulk template send and processes it in the background. The
        request is validated at the door, queued durably, and returns `202
        Accepted` immediately with a job id. Send an `Idempotency-Key` header to
        make retries safe: repeats of the same key within seven days return the
        original job id instead of sending the batch again. Without the header,
        Flowella derives a key from the request body, so an identical batch
        submitted twice in quick succession is not double-sent. Recipients are
        processed individually, so one invalid number does not block the rest of
        the batch.
      operationId: v1SendTemplatesBulk
      parameters:
        - name: Idempotency-Key
          in: header
          required: false
          description: >-
            Unique key (up to 200 characters) identifying this batch. Repeats of
            the same key within seven days return the original job id without
            re-sending. If omitted, Flowella derives a key from the request
            body.
          schema:
            type: string
            maxLength: 200
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                templateId:
                  type: string
                  minLength: 1
                  maxLength: 128
                templateWabaId:
                  type: string
                  minLength: 1
                whatsappChannelId:
                  type: string
                  format: cuid
                headerMedia:
                  type: object
                  properties:
                    url:
                      type: string
                      minLength: 1
                      maxLength: 4000
                      format: uri
                    fileName:
                      type: string
                      minLength: 1
                      maxLength: 240
                  required:
                    - url
                recipients:
                  type: array
                  items:
                    type: object
                    properties:
                      phone:
                        type: string
                        minLength: 3
                        maxLength: 32
                      contactId:
                        type: string
                        nullable: true
                        format: cuid
                      bodyParameters:
                        type: array
                        items:
                          type: string
                          minLength: 1
                        maxItems: 20
                      buttonParameters:
                        type: array
                        items:
                          oneOf:
                            - type: object
                              properties:
                                index:
                                  type: integer
                                  nullable: true
                                  minimum: 0
                                  maximum: 9
                                subType:
                                  type: string
                                  enum:
                                    - url
                                text:
                                  type: string
                                  minLength: 1
                                  maxLength: 2000
                              required:
                                - index
                                - subType
                                - text
                            - type: object
                              properties:
                                index:
                                  type: integer
                                  nullable: true
                                  minimum: 0
                                  maximum: 9
                                subType:
                                  type: string
                                  enum:
                                    - flow
                                flowToken:
                                  type: string
                                  minLength: 1
                                  maxLength: 256
                                flowActionData:
                                  type: object
                                  additionalProperties:
                                    nullable: true
                              required:
                                - index
                                - subType
                                - flowToken
                            - type: object
                              properties:
                                index:
                                  type: integer
                                  nullable: true
                                  minimum: 0
                                  maximum: 9
                                subType:
                                  type: string
                                  enum:
                                    - copy_code
                                couponCode:
                                  type: string
                                  minLength: 1
                                  maxLength: 20
                                  pattern: ^[a-zA-Z0-9]+$
                              required:
                                - index
                                - subType
                                - couponCode
                        maxItems: 20
                    required:
                      - phone
                  minItems: 1
                  maxItems: 50000
                carouselCards:
                  type: array
                  minItems: 2
                  maxItems: 10
                  items:
                    type: object
                    properties:
                      mediaUrl:
                        type: string
                        maxLength: 4000
                        format: uri
                        description: >-
                          Public HTTPS URL of this card's image or video. Omit
                          to use the card's approved sample media.
                      mediaId:
                        type: string
                        minLength: 1
                        maxLength: 256
                        description: >-
                          Meta media ID for this card's image or video. Use
                          instead of `mediaUrl`.
                      bodyParameters:
                        type: array
                        items:
                          type: string
                          minLength: 1
                        maxItems: 20
                        description: Values for the card body variables, in order.
                      buttonParameters:
                        type: array
                        maxItems: 2
                        items:
                          type: object
                          properties:
                            index:
                              type: integer
                              minimum: 0
                              maximum: 1
                              description: Zero-based button position on the card.
                            text:
                              type: string
                              minLength: 1
                              maxLength: 2000
                              description: Value for a URL button variable.
                            payload:
                              type: string
                              minLength: 1
                              maxLength: 256
                              description: Payload for a quick reply button.
                          required:
                            - index
                  description: >-
                    Media card carousel parameters. Send one entry per template
                    card, in card order. The same card media, card body values,
                    and button values are used for every recipient. If a card
                    has no `mediaUrl` or `mediaId`, Flowella sends that card's
                    approved sample media.
                scheduledAt:
                  type: string
                  nullable: true
                throttlePerHour:
                  type: integer
                  minimum: 1
                  maximum: 100000
              required:
                - templateId
                - whatsappChannelId
                - recipients
              example:
                templateId: clxxxxxxxxxxxxxxxxxxxxxxxx
                whatsappChannelId: clxxxxxxxxxxxxxxxxxxxxxxxx
                recipients:
                  - phone: '+15551234567'
                    bodyParameters:
                      - Ada
                carouselCards:
                  - mediaUrl: https://cdn.example/card-1.jpg
                    buttonParameters:
                      - index: 1
                        text: summer
                  - mediaUrl: https://cdn.example/card-2.jpg
      responses:
        '202':
          description: Request accepted for durable processing
          content:
            application/json:
              schema:
                type: object
                properties:
                  id:
                    type: string
                  status:
                    type: string
                    enum:
                      - accepted
                required:
                  - id
                  - status
                example:
                  id: v1ts-0123456789abcdef
                  status: accepted
        '400':
          description: Bad body
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: object
                    properties:
                      code:
                        type: string
                      message:
                        type: string
                    required:
                      - code
                      - message
                required:
                  - error
                example:
                  error:
                    code: UNAUTHORIZED
                    message: Invalid API key
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: object
                    properties:
                      code:
                        type: string
                      message:
                        type: string
                    required:
                      - code
                      - message
                required:
                  - error
                example:
                  error:
                    code: UNAUTHORIZED
                    message: Invalid API key
        '402':
          description: Payment required
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: object
                    properties:
                      code:
                        type: string
                      message:
                        type: string
                    required:
                      - code
                      - message
                required:
                  - error
                example:
                  error:
                    code: UNAUTHORIZED
                    message: Invalid API key
        '429':
          description: Rate limited
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: object
                    properties:
                      code:
                        type: string
                      message:
                        type: string
                    required:
                      - code
                      - message
                required:
                  - error
                example:
                  error:
                    code: UNAUTHORIZED
                    message: Invalid API key
      security:
        - bearerAuth: []
components:
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: API key
      description: >-
        Organization API key (`flo_…`). Paste the full key; Scalar sends
        `Authorization: Bearer <key>`.

````

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