> ## 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.

# Turn AI Off or On

> Hand one conversation to a person, or give it back to the AI

Changes only this thread: the assistant's settings stay as they are. Sends nothing to the contact.

* `{ "enabled": false }`: the AI stops answering this contact and a person takes over, with no timer.
* `{ "enabled": true }`: the AI answers again. It also ends a pause started by a teammate's reply.

The thread's `ai.state` in the response shows the result (`active`, `paused` or `disabled`). See
[AI and handover](https://docs.minimo.it/product/inbox/ai-handover.md).

## Permissions

The API key needs the **Inbox** permission.


## OpenAPI

````yaml post /public/v1/inbox/threads/{threadId}/ai
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}/ai:
    servers:
      - url: https://api.minimo.it
    post:
      summary: Turn the AI off or on for a thread
      description: >-
        Hand one conversation to a person, or give it back to the AI. Changes
        only this thread; the assistant's settings stay as they are. Sends
        nothing.
      operationId: setInboxThreadAi
      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:
                - enabled
              properties:
                enabled:
                  type: boolean
                  description: >-
                    `false` = AI off, a person takes over (no timer). `true` =
                    AI on again; also ends a pause after a teammate's reply.
            example:
              enabled: false
      responses:
        '201':
          description: The updated thread
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: object
                    properties:
                      thread:
                        $ref: '#/components/schemas/InboxThread'
              example:
                data:
                  thread:
                    threadId: 1234
                    status: open
                    unreadMessages: 2
                    pinned: false
                    channels:
                      - whatsapp
                    contact:
                      contactId: 5678
                      name: Mario Rossi
                      email: null
                      phone: '393331234567'
                    assignedTo: null
                    needsHuman: true
                    ai:
                      state: disabled
                      since: null
                    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'
        '400':
          description: '`INVALID_PARAMETERS`: a parameter of the wrong type or out of range.'
          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.
      security:
        - bearerAuth: []
      x-codeSamples:
        - label: CLI
          lang: cURL
          source: |-
            curl --request POST \
              --url 'https://api.minimo.it/public/v1/inbox/threads/1234/ai' \
              --header 'Authorization: Bearer {{BEARER_TOKEN}}' \
              --header 'Content-Type: application/json' \
              --data '{"enabled": false}'
        - lang: JavaScript
          source: >-
            const res = await
            fetch('https://api.minimo.it/public/v1/inbox/threads/1234/ai', {
              method: 'POST',
              headers: {
                'Authorization': 'Bearer {{BEARER_TOKEN}}',
                'Content-Type': 'application/json',
              },
              body: JSON.stringify({"enabled": false}),
            });

            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/ai',
                headers={'Authorization': 'Bearer {{BEARER_TOKEN}}'},
                json={'enabled': False},
            )
            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.