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

# Send template message

> Send an approved WhatsApp template to one or more recipients.



## OpenAPI

````yaml /openapi/moja.json post /v1/broadcast/template/api-send
openapi: 3.0.3
info:
  title: Beem MOJA API
  version: 1.0.0
  description: >-
    Merged MOJA API reference covering the Chat API (chatbot-core), WhatsApp
    template broadcast API (bm-broadcast), and the customer-hosted message
    callback webhook.
  contact:
    name: Beem
    url: https://beem.africa
    email: support@beem.africa
servers:
  - url: https://apichatcore.beem.africa
    description: Default — Chat API (chatcore)
security: []
tags: []
paths:
  /v1/broadcast/template/api-send:
    post:
      summary: Send template message
      description: Send an approved WhatsApp template to one or more recipients.
      operationId: sendTemplateMessage
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                from_addr:
                  description: WhatsApp-enabled sender on your Beem account.
                  type: string
                destination_addr:
                  description: One or more recipients to send the template message to.
                  type: array
                  items:
                    type: object
                    properties:
                      phoneNumber:
                        description: Recipient WhatsApp number in international format.
                        type: string
                      params:
                        description: Placeholder values for {{1}}, {{2}}, etc.
                        type: array
                        items:
                          type: string
                    additionalProperties: false
                    required:
                      - phoneNumber
                  minItems: 1
                channel:
                  description: Messaging channel. Use whatsapp for WhatsApp templates.
                  example: whatsapp
                  type: string
                content:
                  description: >-
                    Media attachment for templates that require an image or
                    document.
                  type: object
                  properties:
                    mediaUrl:
                      description: Required when the approved template includes media.
                      type: string
                      format: uri
                      pattern: >-
                        ^(?=.)(?!https?:\/(?:$|[^/]))(?!https?:\/\/\/)(?!https?:[^/])(?:[a-zA-Z][a-zA-Z\d+-\.]*:(?:(?:\/\/(?:[\w-\.~%\dA-Fa-f!\$&'\(\)\*\+,;=:]*@)?(?:\[(?:(?:(?:[\dA-Fa-f]{1,4}:){6}(?:[\dA-Fa-f]{1,4}:[\dA-Fa-f]{1,4}|(?:(?:0{0,2}\d|0?[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.){3}(?: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:[\dA-Fa-f]{1,4}:[\dA-Fa-f]{1,4}|(?:(?:0{0,2}\d|0?[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.){3}(?:0{0,2}\d|0?[1-9]\d|1\d\d|2[0-4]\d|25[0-5]))|(?:(?:[\dA-Fa-f]{1,4}:){0,5}[\dA-Fa-f]{1,4})?::[\dA-Fa-f]{1,4}|(?:(?:[\dA-Fa-f]{1,4}:){0,6}[\dA-Fa-f]{1,4})?::)|v[\dA-Fa-f]+\.[\w-\.~!\$&'\(\)\*\+,;=:]+)\]|(?:(?:0{0,2}\d|0?[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.){3}(?:0{0,2}\d|0?[1-9]\d|1\d\d|2[0-4]\d|25[0-5])|[\w-\.~%\dA-Fa-f!\$&'\(\)\*\+,;=]{1,255})(?::\d*)?(?:\/[\w-\.~%\dA-Fa-f!\$&'\(\)\*\+,;=:@]*)*)|\/(?:[\w-\.~%\dA-Fa-f!\$&'\(\)\*\+,;=:@]+(?:\/[\w-\.~%\dA-Fa-f!\$&'\(\)\*\+,;=:@]*)*)?|[\w-\.~%\dA-Fa-f!\$&'\(\)\*\+,;=:@]+(?:\/[\w-\.~%\dA-Fa-f!\$&'\(\)\*\+,;=:@]*)*|(?:\/\/\/[\w-\.~%\dA-Fa-f!\$&'\(\)\*\+,;=:@]*(?:\/[\w-\.~%\dA-Fa-f!\$&'\(\)\*\+,;=:@]*)*)))(?:\?[\w-\.~%\dA-Fa-f!\$&'\(\)\*\+,;=:@\/\?]*(?=#|$))?(?:#[\w-\.~%\dA-Fa-f!\$&'\(\)\*\+,;=:@\/\?]*)?$
                  additionalProperties: false
                messageTemplateData:
                  description: Identifies the WhatsApp template to send.
                  type: object
                  properties:
                    id:
                      description: Approved template ID from message-templates/list.
                      type: integer
                  additionalProperties: false
                  required:
                    - id
              additionalProperties: false
              required:
                - from_addr
                - destination_addr
                - channel
                - messageTemplateData
            examples:
              marketingUtility:
                summary: Marketing / Utility with media
                value:
                  from_addr: 2557******45
                  destination_addr:
                    - phoneNumber: 2547******06
                      params:
                        - John
                  channel: whatsapp
                  content:
                    mediaUrl: https://example.com/image.jpg
                  messageTemplateData:
                    id: 1024
              authentication:
                summary: Authentication OTP
                value:
                  from_addr: 2557******45
                  destination_addr:
                    - phoneNumber: 2547******06
                      params:
                        - '123456'
                  channel: whatsapp
                  messageTemplateData:
                    id: 1024
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: object
                    properties:
                      statusCode:
                        description: HTTP-style status code for the broadcast job.
                        type: integer
                      successful:
                        description: True when the template broadcast was accepted.
                        type: boolean
                      message:
                        description: Human-readable status message.
                        type: string
                      jobId:
                        description: Broadcast job ID for tracking delivery reports.
                        type: string
                        format: uuid
                        pattern: >-
                          ^([\[{\(]?)[0-9A-F]{8}([:-]?)[0-9A-F]{4}\2?[0-9A-F][0-9A-F]{3}\2?[0-9A-F][0-9A-F]{3}\2?[0-9A-F]{12}([\]}\)]?)$
                      validation:
                        description: >-
                          Validation details for template placeholders and
                          pricing.
                        type: object
                        properties: {}
                      credits:
                        description: Credit usage breakdown for this broadcast.
                        type: object
                        properties: {}
                    additionalProperties: false
                additionalProperties: false
        '400':
          description: Bad request — invalid template, channel, or destination.
          content:
            application/json:
              schema:
                type: object
                properties:
                  statusCode:
                    type: string
                  message:
                    type: string
                additionalProperties: true
              examples:
                channelSettingsMissing:
                  summary: Channel settings not found
                  value:
                    statusCode: '400'
                    message: User/Channel settings does not exist
                invalidDestination:
                  summary: Invalid destination address
                  value:
                    statusCode: '400'
                    message: Invalid destination_addr
                templateChannelMismatch:
                  summary: Template and channel mismatch
                  value:
                    statusCode: '400'
                    message: >-
                      Template id and channel do not match. Contact support if
                      the issue persists.
        '401':
          description: Unauthorized — missing or invalid API credentials.
          content:
            application/json:
              schema:
                type: object
                properties:
                  statusCode:
                    type: string
                  message:
                    type: string
                additionalProperties: true
              examples:
                missingAuthorization:
                  summary: Missing authorization header
                  value:
                    statusCode: '401'
                    message: No authorization headers
                invalidAuthentication:
                  summary: Invalid authentication
                  value:
                    statusCode: '401'
                    message: Invalid Authentication Parameters
      security:
        - basicAuth: []
        - accessToken: []
      servers:
        - url: https://apibroadcast.beem.africa
          description: Production — Broadcast API
        - url: https://dev-apibroadcast.beem.africa
          description: Staging — Broadcast API
components:
  securitySchemes:
    basicAuth:
      type: http
      scheme: basic
      description: 'Beem API credentials: API key as username, API secret as password.'
    accessToken:
      type: apiKey
      in: header
      name: Authorization
      description: >-
        Access token only. Send as Authorization: <token> — do not use a Bearer
        prefix.

````