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

# Reply to Thread

> Answer the contact by WhatsApp (inside the 24-hour window) or by email in the same email thread

The reply is sent as **the user who created the key**, exactly like a reply typed in the inbox. Send
`"dryRun": true` first to see the recipient, the subject, the WhatsApp window and the effects without sending.

## Rules

* **WhatsApp 24-hour window.** Free text only within 24 hours of the contact's last WhatsApp message. Outside it the
  answer is `422` `WHATSAPP_WINDOW_CLOSED` and nothing is sent: use an approved
  [template](https://docs.minimo.it/api-reference/messaging-channels/whatsapp/send-template.md) instead.
* **Email threading.** Sent to the address of the contact's last email (or the contact's email) in the same email
  thread, from your workspace's sender. The subject in the preview is the subject sent.
* **No double sends.** The same text sent in the same thread in the last 10 minutes is not sent again: `"sent": false`
  with `duplicateOf` (the id of the message already sent).
* **Handover.** A WhatsApp reply pauses the AI on this conversation and assigns it to the key's user if nobody had it.

## Permissions

The API key needs the **Inbox** permission. A key with no user (none created it) cannot reply.

## Common Errors

Errors answer with the code in `message` and a sentence you can show in `userMessage`:

```json theme={null}
{
  "status": "FAIL",
  "message": "WHATSAPP_WINDOW_CLOSED",
  "userMessage": "WhatsApp allows free text only within 24 hours of the contact's last WhatsApp message (this window closed at 2026-11-12T16:15:41.406Z). Send an approved template instead (...)."
}
```

| Status | `message` | When |
| - | - | - |
| `422` | `WHATSAPP_WINDOW_CLOSED` | WhatsApp reply outside the 24-hour window. Nothing is sent. |
| `422` | `NO_RECIPIENT_PHONE` / `NO_RECIPIENT_EMAIL` | The contact has no phone / email. |
| `422` | `NO_REPLY_CHANNEL` | The thread has no WhatsApp or email message and no `channel` was given. |
| `422` | `SUBJECT_REQUIRED` | Email reply to a contact who never emailed in this thread: pass `subject`. |
| `409` | `REPLY_IN_PROGRESS` | The same reply is being sent right now by another call. Read the thread before trying again. |
| `400` | `INVALID_PARAMETERS` | Empty or too long text, a field of the wrong type, or a key with no user. |
| `404` | | Unknown thread, or a thread of another workspace. |

## Related

* **[Send WhatsApp Template](https://docs.minimo.it/api-reference/messaging-channels/whatsapp/send-template.md)**: write first, or after the 24-hour window
* **MCP**: agents use `minimo_inbox_reply`, which asks for confirmation before sending ([Inbox for your AI agent](https://docs.minimo.it/product/inbox/ai-agent.md))


## OpenAPI

````yaml post /public/v1/inbox/threads/{threadId}/reply
openapi: 3.1.0
info:
  title: API Documentation
  description: Documentation for transactional and subscribe APIs
  version: 1.0.0
servers:
  - url: https://app.minimo.it
security:
  - bearerAuth: []
paths:
  /public/v1/inbox/threads/{threadId}/reply:
    servers:
      - url: https://api.minimo.it
    post:
      summary: Reply to an inbox thread
      description: >-
        Answer the contact by WhatsApp (inside the 24-hour window) or by email
        in the same email thread. Sent as the user who created the key, exactly
        like a reply typed in the inbox.
      operationId: replyInboxThread
      parameters:
        - name: threadId
          in: path
          required: true
          description: The `threadId` from List Threads or Search Threads.
          schema:
            type: integer
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - text
              properties:
                text:
                  type: string
                  minLength: 1
                  maxLength: 4096
                  description: Plain text.
                channel:
                  type: string
                  enum:
                    - whatsapp
                    - email
                  description: >-
                    Default: the channel of the contact's last WhatsApp or email
                    message.
                subject:
                  type: string
                  maxLength: 300
                  description: 'Email only. Default: `Re: <subject of their last email>`.'
                dryRun:
                  type: boolean
                  description: >-
                    `true` = validate and return the preview, send nothing. A
                    JSON boolean, not `"true"`.
            examples:
              whatsapp:
                summary: WhatsApp reply
                value:
                  text: Yes, we ship to Sicily in 2 working days.
                  channel: whatsapp
              emailDryRun:
                summary: Email reply, preview only
                value:
                  text: Your refund is on its way.
                  channel: email
                  dryRun: true
      responses:
        '201':
          description: >-
            Sent, previewed (`dryRun`), or skipped as a double send
            (`duplicateOf`)
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: object
                    properties:
                      sent:
                        type: boolean
                        description: >-
                          `false` with `dryRun`, or when the same text was
                          already sent (see `duplicateOf`).
                      messageId:
                        type: integer
                        description: The message sent.
                      duplicateOf:
                        type: integer
                        description: >-
                          The same text was sent in this thread in the last 10
                          minutes: the id of that message. Nothing was sent
                          again.
                      preview:
                        type: object
                        properties:
                          channel:
                            type: string
                            enum:
                              - whatsapp
                              - email
                          to:
                            type: string
                            description: Phone number or email address the reply goes to.
                          subject:
                            type: string
                            nullable: true
                            description: 'Email only: the subject that is sent.'
                          text:
                            type: string
                      whatsappWindow:
                        type: object
                        nullable: true
                        description: '`dryRun` only, WhatsApp only.'
                        properties:
                          open:
                            type: boolean
                          closesAt:
                            type: string
                            format: date-time
                            nullable: true
                      effects:
                        type: array
                        items:
                          type: string
                        description: >-
                          What the reply does besides sending (AI pause,
                          assignment, email threading).
                      thread:
                        $ref: '#/components/schemas/InboxThread'
              examples:
                sent:
                  summary: Sent
                  value:
                    data:
                      sent: true
                      messageId: 90113
                      preview:
                        channel: whatsapp
                        to: '393331234567'
                        subject: null
                        text: Yes, we ship to Sicily in 2 working days.
                      effects:
                        - >-
                          The AI agent pauses on this conversation (an operator
                          reply hands it over to a human).
                        - The conversation is assigned to you.
                      thread:
                        threadId: 1234
                        status: open
                        unreadMessages: 2
                        pinned: false
                        channels:
                          - whatsapp
                        contact:
                          contactId: 5678
                          name: Mario Rossi
                          email: null
                          phone: '393331234567'
                        assignedTo:
                          userId: 42
                          name: Giulia Bianchi
                        needsHuman: false
                        ai:
                          state: paused
                          since: '2026-11-13T09:02:00.000Z'
                        snoozedUntil: null
                        updatedAt: '2026-11-13T09:00:00.000Z'
                        lastMessage:
                          messageId: 90112
                          direction: inbound
                          channel: whatsapp
                          subject: null
                          preview: Can I talk to a person?
                          at: '2026-11-13T09:00:00.000Z'
                dryRun:
                  summary: 'dryRun: preview only'
                  value:
                    data:
                      sent: false
                      preview:
                        channel: whatsapp
                        to: '393331234567'
                        subject: null
                        text: Yes, we ship to Sicily in 2 working days.
                      whatsappWindow:
                        open: true
                        closesAt: '2026-11-14T09:00:00.000Z'
                      effects:
                        - >-
                          The AI agent pauses on this conversation (an operator
                          reply hands it over to a human).
                        - The conversation is assigned to you.
        '400':
          description: >-
            `INVALID_PARAMETERS`: empty or too long text, a field of the wrong
            type, or a key with no user.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/InboxError'
        '401':
          description: Missing or invalid API key, or a key without the `Inbox` permission.
        '404':
          description: Unknown thread, or a thread of another workspace.
        '409':
          description: >-
            `REPLY_IN_PROGRESS`: the same reply is being sent right now by
            another call. Read the thread before trying again.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/InboxError'
        '422':
          description: >-
            `WHATSAPP_WINDOW_CLOSED`, `NO_RECIPIENT_PHONE`,
            `NO_RECIPIENT_EMAIL`, `NO_REPLY_CHANNEL` or `SUBJECT_REQUIRED`.
            Nothing is sent.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/InboxError'
      security:
        - bearerAuth: []
      x-codeSamples:
        - label: CLI
          lang: cURL
          source: |-
            curl --request POST \
              --url 'https://api.minimo.it/public/v1/inbox/threads/1234/reply' \
              --header 'Authorization: Bearer {{BEARER_TOKEN}}' \
              --header 'Content-Type: application/json' \
              --data '{"text": "Yes, we ship to Sicily in 2 working days.", "channel": "whatsapp"}'
        - lang: JavaScript
          source: >-
            const res = await
            fetch('https://api.minimo.it/public/v1/inbox/threads/1234/reply', {
              method: 'POST',
              headers: {
                'Authorization': 'Bearer {{BEARER_TOKEN}}',
                'Content-Type': 'application/json',
              },
              body: JSON.stringify({"text": "Yes, we ship to Sicily in 2 working days.", "channel": "whatsapp"}),
            });

            const { data } = await res.json();

            console.log(data);
        - lang: Python
          source: |-
            import requests

            res = requests.post(
                'https://api.minimo.it/public/v1/inbox/threads/1234/reply',
                headers={'Authorization': 'Bearer {{BEARER_TOKEN}}'},
                json={'text': 'Yes, we ship to Sicily in 2 working days.', 'channel': 'whatsapp'},
            )
            print(res.json())
components:
  schemas:
    InboxThread:
      type: object
      description: >-
        One conversation with one contact: email, WhatsApp, SMS and Telegram
        together. The MCP `minimo_inbox_*` tools return the same object.
      properties:
        threadId:
          type: integer
          example: 1234
        status:
          type: string
          enum:
            - open
            - closed
            - snoozed
        unreadMessages:
          type: integer
          example: 2
        pinned:
          type: boolean
        channels:
          type: array
          description: Channels this contact has used in the thread.
          items:
            type: string
            enum:
              - whatsapp
              - email
              - sms
              - telegram
        contact:
          type: object
          properties:
            contactId:
              type: integer
              example: 5678
            name:
              type: string
              nullable: true
              example: Mario Rossi
            email:
              type: string
              nullable: true
              example: mario@example.com
            phone:
              type: string
              nullable: true
              example: '393331234567'
        assignedTo:
          type: object
          nullable: true
          description: The teammate the thread is assigned to, `null` if nobody.
          properties:
            userId:
              type: integer
              example: 42
            name:
              type: string
              nullable: true
              example: Giulia Bianchi
        needsHuman:
          type: boolean
          description: The AI handed the thread over to a person.
        ai:
          type: object
          properties:
            state:
              type: string
              enum:
                - active
                - paused
                - disabled
              description: >-
                `active` = the AI answers. `paused` = a teammate replied or the
                AI handed over; the AI comes back after the assistant's pause
                time. `disabled` = off on this thread until it is turned on
                again.
            since:
              type: string
              format: date-time
              nullable: true
              description: When the AI paused (`paused` only).
        snoozedUntil:
          type: string
          format: date-time
          nullable: true
        updatedAt:
          type: string
          format: date-time
        lastMessage:
          type: object
          nullable: true
          properties:
            messageId:
              type: integer
              example: 90112
            direction:
              type: string
              enum:
                - inbound
                - outbound
              description: >-
                `inbound` = from the contact, `outbound` = from you, your team
                or your AI.
            channel:
              type: string
              enum:
                - whatsapp
                - email
                - sms
                - telegram
            subject:
              type: string
              nullable: true
              description: Email only.
            preview:
              type: string
              description: The text on one line, up to 280 characters.
            at:
              type: string
              format: date-time
    InboxError:
      type: object
      description: >-
        `message` is the code, `userMessage` a sentence you can show to a
        person.
      properties:
        status:
          type: string
          example: FAIL
        message:
          type: string
          example: WHATSAPP_WINDOW_CLOSED
        userMessage:
          type: string
          example: >-
            WhatsApp allows free text only within 24 hours of the contact's last
            WhatsApp message. Send an approved template instead.
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: mn-API_CLIENT_ID-API_KEY

````

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