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

# Send a text message in an Inbox conversation

> Send a text message in an Inbox conversation



## OpenAPI

````yaml openapi.json POST /v1/conversations/{conversationId}/messages
openapi: 3.1.0
info:
  title: Watahub API
  version: 0.2.0
  description: >-
    Tenant API of Watahub, the multi-tenant WhatsApp Cloud API gateway.
    Authenticate every request with your API key as `Authorization: Bearer
    <key>` or `X-API-Key: <key>`.


    - Shapes the gateway owns are closed: no other field appears.

    - Records that come from Meta are open: documented fields are listed and any
    other field Meta adds is passed through.

    - The `/vN.N` proxy passes Meta's body and status through untouched; the
    version in the path is accepted and ignored.
servers:
  - url: https://cloud.watahub.dev
security:
  - bearerApiKey: []
  - headerApiKey: []
tags:
  - name: Messages
  - name: Media
  - name: Templates
  - name: Graph-compatible proxy
    description: >-
      Drop-in for Meta's Graph API on three routes. Meta's response is returned
      as is.
  - name: Phones
    description: Phones
  - name: Conversations
    description: Conversations
  - name: Connect
    description: Connect
  - name: Customers
    description: Customers
  - name: Webhooks
    description: Webhooks
  - name: Logs
    description: Logs
  - name: Health
    description: Health
  - name: Message templates
    description: >-
      Templates cached by the gateway per WABA; synced from Meta and required by
      broadcasts.
  - name: Broadcasts
    description: >-
      Send one approved template to up to 500 recipients; sending is queued and
      drained in the background.
paths:
  /v1/conversations/{conversationId}/messages:
    parameters:
      - $ref: '#/components/parameters/ConversationId'
    post:
      tags:
        - Messages
      summary: Send a text message in an Inbox conversation
      description: Sent through `POST /v1/messages`, so it answers the same shape.
      operationId: sendConversationText
      parameters:
        - name: conversationId
          in: path
          required: true
          description: '`phoneNumberId:wa_id`, with a literal colon.'
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ConversationText'
      responses:
        '200':
          $ref: '#/components/responses/MessageSent'
        4XX:
          $ref: '#/components/responses/ClientError'
        5XX:
          $ref: '#/components/responses/ServerError'
components:
  parameters:
    ConversationId:
      name: conversationId
      in: path
      required: true
      description: URL-encoded `{phoneNumberId}:{waId}`.
      schema:
        type: string
  schemas:
    ConversationText:
      type: object
      additionalProperties: false
      required:
        - text
      properties:
        text:
          type: string
          minLength: 1
          maxLength: 4096
    SendMessageResult:
      type: object
      additionalProperties: false
      required:
        - success
        - messageId
        - recipient
        - phoneNumberId
      properties:
        success:
          const: true
        messageId:
          type: string
          description: Meta's `messages[0].id` (the wamid). Empty when Meta returns none.
        recipient:
          type: string
          description: >-
            Meta's `contacts[0].input`; otherwise the phone number sent, without
            `+`, or the BSUID.
        phoneNumberId:
          type: string
          description: The number that sent the message.
    GatewayError:
      type: object
      description: >-
        An error the gateway or the core answers itself. `error` is a stable
        English message for developers.
      additionalProperties: false
      required:
        - error
      properties:
        error:
          type: string
        fields:
          type: array
          items:
            type: string
          description: 'With 400 `Invalid fields`: the paths of the rejected fields.'
        requestId:
          type: string
          description: 'With 500 `Operation unavailable`: the ID to quote to support.'
    ValidationError:
      type: object
      description: The core rejected a value of the body, path, header or query.
      additionalProperties: false
      required:
        - error
        - details
      properties:
        error:
          const: Validation failed
        details:
          type: object
          description: Messages by field name.
          additionalProperties:
            type: array
            items:
              type: string
    MetaError:
      type: object
      description: >-
        Meta failed a `/v1` call. With Meta's error: `code`, its `subcode`,
        `type` on sends, and the core's classification. When Meta could not be
        reached or answered something unusable, only `message`, plus the
        `unknown_outcome` classification on sends.
      additionalProperties: false
      required:
        - error
      properties:
        error:
          type: object
          additionalProperties: false
          required:
            - message
          properties:
            message:
              type: string
            code:
              type: integer
              description: Meta's error code; Meta's HTTP status when Meta gave none.
            subcode:
              type: integer
              description: Meta's `error_subcode`.
            type:
              type: string
              description: Meta's error type. Only on message sends.
            category:
              type: string
              enum:
                - auth
                - billing
                - rate_limit
                - meta_server
                - unknown
                - unknown_outcome
            retryable:
              type: boolean
            action:
              type: string
              description: What to do next, in English.
  responses:
    MessageSent:
      description: Meta accepted the message.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/SendMessageResult'
    ClientError:
      description: >-
        Rejected by the gateway (`GatewayError`), by the core's validation
        (`ValidationError`, 422) or by Meta (`MetaError`, with Meta's status).
      content:
        application/json:
          schema:
            anyOf:
              - $ref: '#/components/schemas/GatewayError'
              - $ref: '#/components/schemas/ValidationError'
              - $ref: '#/components/schemas/MetaError'
    ServerError:
      description: >-
        `GatewayError` for a gateway failure (500 with `requestId`, 503 for
        missing configuration); `MetaError` for a Meta 5XX, an unreachable Meta
        (502) or a Meta timeout (504).
      content:
        application/json:
          schema:
            anyOf:
              - $ref: '#/components/schemas/GatewayError'
              - $ref: '#/components/schemas/MetaError'
  securitySchemes:
    bearerApiKey:
      type: http
      scheme: bearer
      description: Tenant API key.
    headerApiKey:
      type: apiKey
      in: header
      name: X-API-Key
      description: Tenant API key.

````

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