> ## 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 session message

> Send a message to a user with an active session. Session messaging is limited to the 24-hour window after the user last interacted with your business; outside that window use approved WhatsApp templates instead.



## OpenAPI

````yaml /openapi/moja.json post /v1/chatapi
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/chatapi:
    post:
      summary: Send session message
      description: >-
        Send a message to a user with an active session. Session messaging is
        limited to the 24-hour window after the user last interacted with your
        business; outside that window use approved WhatsApp templates instead.
      operationId: sendSessionMessage
      requestBody:
        content:
          application/json:
            schema:
              type: object
              required:
                - from
                - to
                - message_type
                - channel
              properties:
                from:
                  type: string
                  description: Your MOJA channel number (WhatsApp-enabled sender).
                to:
                  type: string
                  description: Recipient mobile number (include the country code)
                transaction_id:
                  type: string
                  format: uuid
                  description: Optional client reference (UUID v4).
                message_type:
                  type: string
                  enum:
                    - text
                    - image
                    - location
                    - document
                    - quick_reply
                    - list
                    - video
                  description: Type of session message to send.
                callback_url:
                  type: string
                  format: uri
                  description: Optional URL where inbound replies are delivered.
                channel:
                  type: string
                  enum:
                    - whatsapp
                    - facebook
                    - sms
                    - instagram
                  description: Messaging channel.
                text:
                  type: string
                  description: Message text when message_type is text.
                image:
                  type: object
                  description: Image attachment when message_type is image.
                  properties:
                    mime_type:
                      type: string
                      description: MIME type, e.g. image/jpeg.
                    url:
                      type: string
                      format: uri
                      description: Public HTTPS URL of the image.
                video:
                  type: object
                  description: Video attachment when message_type is video.
                  properties:
                    mime_type:
                      type: string
                      description: MIME type, e.g. video/mp4.
                    url:
                      type: string
                      format: uri
                      description: Public HTTPS URL of the video.
                document:
                  type: object
                  description: Document attachment when message_type is document.
                  properties:
                    mime_type:
                      type: string
                      description: MIME type, e.g. application/pdf.
                    url:
                      type: string
                      format: uri
                      description: Public HTTPS URL of the document.
                location:
                  type: object
                  description: Location pin when message_type is location.
                  properties:
                    latitude:
                      type: string
                      description: Latitude coordinate.
                    longitude:
                      type: string
                      description: Longitude coordinate.
                quick_reply:
                  type: object
                  description: >-
                    Interactive quick-reply buttons when message_type is
                    quick_reply.
                list:
                  type: object
                  description: Interactive list message when message_type is list.
            examples:
              text:
                summary: Text
                value:
                  from: '255701000000'
                  to: '255701000001'
                  channel: whatsapp
                  transaction_id: 4f6eec48-4140-4ce8-80c5-cef0e189578c
                  message_type: text
                  text: Hello there
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    example: SUCCESS
                    type: string
                additionalProperties: false
        '400':
          description: Bad request — missing authorization header or invalid request body.
          content:
            application/json:
              schema:
                type: object
                additionalProperties: true
              examples:
                missingAuthorization:
                  summary: Missing authorization header
                  value:
                    code: 400
                    message: No authorization headers
        '401':
          description: Unauthorized — invalid or missing API credentials.
          content:
            application/json:
              schema:
                type: object
                properties:
                  code:
                    type: integer
                  message:
                    type: string
                additionalProperties: true
              examples:
                invalidAuthentication:
                  summary: Invalid authentication
                  value:
                    code: 120
                    message: Invalid Authentication Parameters
        '404':
          description: Not found — session expired or resource not found.
          content:
            application/json:
              schema:
                type: object
                additionalProperties: true
              examples:
                sessionExpired:
                  summary: Session expired
                  value:
                    code: 404
                    message: The session has expired
      security:
        - basicAuth: []
        - accessToken: []
      servers:
        - url: https://apichatcore.beem.africa
          description: Production — Chat API
        - url: https://dev-apichatcore.beem.africa
          description: Staging — Chat 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.

````