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

# Send a message



## OpenAPI

````yaml /openapi/sinjapp-business.v1.yaml post /messages
openapi: 3.0.3
info:
  title: Sinjapp Business API
  version: 1.0.0
  description: |
    Sinjapp Business exposes a Tenant API for customer messaging operations.
  license:
    name: Proprietary
    url: https://sinjapp.com/legal/terms
servers:
  - url: '{tenantBaseUrl}/api/v1'
    description: Tenant API
    variables:
      tenantBaseUrl:
        default: https://your-tenant.sinjapp.org
        description: >-
          Full customer tenant URL, including https://. Use the exact tenant
          workspace domain shown in the dashboard.
security:
  - ApiKeyAuth: []
tags:
  - name: Auth
    description: Tenant identity and runtime context.
  - name: Subscription
    description: >-
      Tenant subscription status. Payment and plan changes happen inside the
      tenant dashboard.
  - name: API Keys
    description: Tenant API credentials and scopes.
  - name: Sender Numbers
    description: Sender number registration and activation state.
  - name: Messages
    description: Sending and reading message logs.
  - name: Contacts
    description: Contact reachability checks.
  - name: Usage
    description: Usage counters and limits.
paths:
  /messages:
    post:
      tags:
        - Messages
      summary: Send a message
      operationId: sendMessage
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SendMessageRequest'
          multipart/form-data:
            schema:
              allOf:
                - $ref: '#/components/schemas/SendMessageRequest'
                - type: object
                  properties:
                    media:
                      type: string
                      format: binary
      responses:
        '201':
          description: Message accepted and logged.
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    $ref: '#/components/schemas/MessageLog'
        '422':
          $ref: '#/components/responses/ValidationError'
      security:
        - ApiKeyAuth:
            - messages.send
components:
  schemas:
    SendMessageRequest:
      type: object
      required:
        - to_phone
        - type
      properties:
        sender_number_id:
          type: integer
          description: Required when sender_phone is not provided.
        sender_phone:
          type: string
          description: Required when sender_number_id is not provided.
          example: '{sender_phone}'
        to_phone:
          type: string
          example: '{recipient_phone}'
        type:
          type: string
          enum:
            - text
            - image
            - voice
            - document
        content:
          type: string
          nullable: true
        duration:
          type: integer
          minimum: 1
          maximum: 300
          nullable: true
        file_name:
          type: string
          nullable: true
        file_size:
          type: integer
          nullable: true
        file_type:
          type: string
          nullable: true
    MessageLog:
      type: object
      properties:
        id:
          type: integer
        sender_number_id:
          type: integer
        recipient_user_id:
          type: integer
          nullable: true
        conversation_id:
          type: integer
          nullable: true
        message_id:
          type: integer
          nullable: true
        message_type:
          type: string
        content:
          type: string
          nullable: true
        status:
          type: string
        sent_at:
          type: string
          format: date-time
          nullable: true
  responses:
    ValidationError:
      description: Validation failed.
      content:
        application/json:
          schema:
            type: object
            properties:
              message:
                type: string
              errors:
                type: object
                additionalProperties:
                  type: array
                  items:
                    type: string
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: X-Api-Key

````