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

# Create a message

> Requires scope `messages:create`.



## OpenAPI

````yaml /direct/openapi.json post /v3/messages
openapi: 3.1.0
info:
  title: Assistable Direct API
  version: 3.0.0
  description: >-
    The Assistable Direct API — the same v3 endpoints, for native (GHL-free)
    Direct sub-accounts. Provision a Direct sub-account, manage its users, fund
    its wallet, then drive assistants, contacts, conversations, chat, knowledge,
    tools, calls and more — all scoped by sub-account, with zero GoHighLevel.
    (Appointments are not yet available on Direct.)
servers:
  - url: https://api.assistable.ai
    description: Production
security:
  - bearerAuth: []
paths:
  /v3/messages:
    post:
      tags:
        - Messages
      summary: Create a message
      description: Requires scope `messages:create`.
      operationId: createMessage
      parameters:
        - name: X-Subaccount-Id
          in: header
          required: false
          description: >-
            Target subaccount for the request. Required unless the API key is
            authorized for exactly one subaccount (then it defaults to that
            one). Alternatively pass `subaccount_id` (or legacy `location_id`)
            in the request body. Omitting it on a multi-subaccount key returns
            `400 subaccount_required`.
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                conversation_id:
                  type: string
                  minLength: 1
                content:
                  type: string
                  minLength: 1
                  maxLength: 8000
                channel:
                  description: Defaults to the conversation's last channel, else CUSTOM.
                  type: string
                  enum:
                    - SMS
                    - EMAIL
                    - VOICE
                    - WHATSAPP
                    - WEBCHAT
                    - FACEBOOK
                    - INSTAGRAM
                    - GMB
                    - LIVE_CHAT
                    - CUSTOM
                type:
                  type: string
                  enum:
                    - TEXT
                    - IMAGE
                    - VIDEO
                    - AUDIO
                    - FILE
                    - LOCATION
                    - CONTACT
                    - SYSTEM
                    - TOOL_CALL
                    - TOOL_RESULT
                    - FUNCTION_CALL
                    - FUNCTION_RESULT
                  description: Message type. Defaults to TEXT.
                subaccount_id:
                  description: >-
                    Target subaccount id. Prefer the X-Subaccount-Id header;
                    this body field is a fallback.
                  type: string
                location_id:
                  description: Alias for subaccount_id (GHL location id).
                  type: string
              required:
                - conversation_id
                - content
              additionalProperties: false
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: object
                  error:
                    type: 'null'
                  request_id:
                    type: string
                required:
                  - data
                  - request_id
        '400':
          description: Invalid request (validation_error / subaccount_required)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiError'
        '401':
          description: Missing or invalid API key
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiError'
        '403':
          description: Insufficient scope or subaccount not allowed
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiError'
        '404':
          description: Resource not found (not_found)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiError'
        '429':
          description: Rate limit exceeded (rate_limited)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiError'
      security:
        - bearerAuth: []
components:
  schemas:
    ApiError:
      type: object
      properties:
        data:
          type: 'null'
        error:
          type: object
          properties:
            code:
              type: string
            message:
              type: string
          required:
            - code
            - message
        request_id:
          type: string
      required:
        - error
        - request_id
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: Your v3 API key, e.g. `ask_live_…`

````

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