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

# Update an inbox thread

> Update a Nixflex inbox thread's archive state or acknowledge messages through a known read version. Listing messages alone does not mark them read.

**FIXED · account** Inbox number discovery is account-wide. Filter threads by channel and number, and call history by number. `DELETE /v1/calls` purges calls and related recordings account-wide and reports sms\_deleted=0. For one customer verify each call ID, then use `DELETE /v1/calls/{id}`.

**NOT OFFERED → do this instead · number** A business\_number filter on campaign and opt-out reads does not establish tenant identity. Authorise the tenant and its number on your server. Keep that filter through SMS pagination. Bulk call deletion stays account-wide.

**YOU CAN CHANGE · account** Choose direction, source, outcome and period when supported. The number narrows a history read only. `direction` `all`, `inbound`, `outbound`, `web` · `source` `all`, `campaign`, `web`, `test`, `other` · `outcome` `all`, `successful`, `unsuccessful`, `unknown`, `failed` · `period` `all`, `today`, `week`, `month`.

**SCOPE · account** Keep the same filters with each server-issued cursor.

[Read the compact AI rules](https://docs.nixflex.com/ai-rules.md#inbox-history)

Change an owned conversation’s archive state or acknowledge messages through a known read version. This does not delete content or extend retention.

Method: **PATCH** · Success: **200** · Scope: **Owning account**

**The important part**

* This updates supported thread state; it is not a send-message endpoint.
* Read the current thread before resolving an uncertain update.

[Business guide](https://docs.nixflex.com/guides/business/agent-inbox.md) · [Developer guide](https://docs.nixflex.com/guides/developer/agent-inbox.md) · [Glossary](https://docs.nixflex.com/guides/glossary.md)

## Authentication

Send `Authorization: Bearer KEY_ID:KEY_SECRET` using the owning account’s server-side credential. Send `Content-Type: application/json`.

## Request fields

| Field | Type | Required | Default | Limits and meaning |
| - | - | - | - | - |
| `channel` (path) | string | Yes | None | Conversation channel. Allowed: `"sms"`, `"web"`. |
| `number` (path) | string | Yes | None | International number with + and digits; no spaces. Pattern: `^\+[1-9][0-9]{6,14}$`. |
| `thread` (path) | string | Yes | None | Opaque thread key from the conversation list. URL-encode it. Maximum 160 characters. Minimum 1 characters. |

Supply at least one field. Unknown fields and null are refused.

| Field | Type | Required | Default | Limits and meaning |
| - | - | - | - | - |
| `archived` | boolean | No | Omitted | Set true to archive or false to unarchive. Omitted leaves state unchanged. |
| `read_version` | string | No | Omitted | Opaque decimal revision. Keep as a string to avoid precision loss. Pattern: `^[0-9]{1,18}$`. |

Use the read\_version string returned by a thread read. Decimal numeric input is also accepted but strings avoid precision loss. Versions beyond received messages are refused. Read acknowledgements only advance; an older acknowledgement cannot mark later arrivals as read. A missing conversation is 404 inbox\_not\_found even though reading it may return an empty list. Archiving does not change retention. Requests return Cache-Control: no-store.

## Response fields

`200 OK` returns the shape below. Nullable fields can be unknown or unset; do not turn null into zero or false.

| Field | Type | Meaning |
| - | - | - |
| `ok` | boolean | Update confirmed. Value: `true`. |
| `archived` | boolean | Current archive state. |

## Example request

These examples require Node/CLI 0.11.0 or later, Python 0.4.0 or later and MCP 0.5.0 or later. Keep `NIXFLEX_API_KEY` private. cURL uses Bash; CLI uses PowerShell and reads the key through `NIXFLEX_API_KEY`. Replace fixture identifiers and reserved example numbers with approved account-owned values. Configure the existing MCP installation for the same account at `https://api.nixflex.com` before using the shown tool arguments. Python shows the synchronous client; `AsyncNixflex` uses the same method with `async with` and `await`. This example changes state. Review the target and payload before running it.

```bash cURL theme={"dark"}
curl --request PATCH \
  --url "https://api.nixflex.com/v1/agent-inbox/web/%2B12025550123/thread/visitor%2Fplus%2B%20%C3%BC" \
  --header "Authorization: Bearer $NIXFLEX_API_KEY" \
  --header "Content-Type: application/json" \
  --data '{"archived":false,"read_version":"999999999999999999"}'
```

```javascript Node theme={"dark"}
import Nixflex from 'nixflex';

const c = new Nixflex({
  apiKey: process.env.NIXFLEX_API_KEY,
  baseUrl: 'https://api.nixflex.com',
  maxRetries: 0,
});
const result = await c.inbox.update("web", "+12025550123", "visitor/plus+ \u00fc", {"archived": false, "read_version": "999999999999999999"});
```

```python Python theme={"dark"}
import os
from nixflex import Nixflex

with Nixflex(
    api_key=os.environ["NIXFLEX_API_KEY"],
    base_url="https://api.nixflex.com",
    max_retries=0,
) as c:
    result = c.inbox.update('web', '+12025550123', 'visitor/plus+ ü', archived=False, read_version='999999999999999999')
```

```powershell CLI (PowerShell) theme={"dark"}
$body = @'
{
  "archived": false,
  "read_version": "999999999999999999"
}
'@
[IO.File]::WriteAllText('request-54.json', $body, (New-Object Text.UTF8Encoding $false))
nixflex inbox update web '+12025550123' --thread 'visitor/plus+ ü' --body '@request-54.json' --confirm --json --base-url "https://api.nixflex.com"
```

```json MCP theme={"dark"}
{
  "name": "update_inbox_thread",
  "arguments": {
    "channel": "web",
    "number": "+12025550123",
    "thread": "visitor/plus+ ü",
    "body": {
      "archived": false,
      "read_version": "999999999999999999"
    },
    "confirm": true
  }
}
```

## Example response

Illustrative `200` response. Identifiers and values are examples; some optional or compatibility fields are omitted.

```json Response theme={"dark"}
{
  "ok": true,
  "archived": true
}
```

## Errors

Failures return an `error` object with `code`, `message`, `doc_url` and optional details. Each code links to the shared error catalog. Read the message and details before deciding whether to resend.

| Status | Code | Meaning | What to do |
| - | - | - | - |
| 400 | [`invalid_inbox_request`](https://docs.nixflex.com/api-reference/errors#invalid_inbox_request) | A path, query, body or settings value is invalid. | Correct the documented shape and limits. |
| 404 | [`inbox_not_found`](https://docs.nixflex.com/api-reference/errors#inbox_not_found) | The number or thread is unavailable to this account. | Check the number, thread and account state. |
| 503 | [`agent_inbox_disabled`](https://docs.nixflex.com/api-reference/errors#agent_inbox_disabled) | The inbox feature is disabled. | Wait for feature availability. |
| 503 | [`inbox_unavailable`](https://docs.nixflex.com/api-reference/errors#inbox_unavailable) | The inbox read or write could not be confirmed. | Retry reads with bounded backoff; reconcile writes first. |
| 400 | [`invalid_json`](https://docs.nixflex.com/api-reference/errors#invalid_json) | Invalid JSON body. | Correct JSON syntax. |
| 413 | [`payload_too_large`](https://docs.nixflex.com/api-reference/errors#payload_too_large) | The request exceeds the JSON body limit. | Send a smaller request. |
| 401 | [`unauthorized`](https://docs.nixflex.com/api-reference/errors#unauthorized) | The credential is missing or invalid. | Check the full account credential. |
| 429 | [`rate_limit_exceeded`](https://docs.nixflex.com/api-reference/errors#rate_limit_exceeded) | The account request limit was reached. | Wait for Retry-After. Reconcile uncertain writes before resending. |

## Retry and idempotency

No idempotency key is documented. A timeout or 5xx can follow a committed change. Read the current state before deciding whether to submit again; never automatically repeat an uncertain write. Reapplying an intended archive boolean or an already acknowledged version preserves that state, but a concurrent archive edit can change user intent. Reload after uncertainty.

## Related endpoints

* [Check inbox availability](https://docs.nixflex.com/api-reference/agent-inbox/get-agent-inbox-features.md)
* [List inbox numbers](https://docs.nixflex.com/api-reference/agent-inbox/get-agent-inbox-numbers.md)
* [Errors and recovery](https://docs.nixflex.com/api-reference/errors.md#error-envelope)


## OpenAPI

````yaml api-reference/public.openapi.json PATCH /agent-inbox/{channel}/{number}/thread/{thread}
openapi: 3.1.0
info:
  title: Nixflex public API
  version: 1.0.0
  description: >-
    Nixflex API reference for agents, calls, messaging, knowledge, organisations
    and integrations. Authenticate with the owning account and follow each
    operation’s permissions, response and retry contract.
servers:
  - url: https://api.nixflex.com/v1
security:
  - bearerAuth: []
paths:
  /agent-inbox/{channel}/{number}/thread/{thread}:
    patch:
      tags:
        - Agent inbox
      summary: Update an inbox thread
      description: >-
        Change an owned conversation’s archive state or acknowledge messages
        through a known read version. This does not delete content or extend
        retention. Use the read_version string returned by a thread read.
        Decimal numeric input is also accepted but strings avoid precision loss.
        Versions beyond received messages are refused. Read acknowledgements
        only advance; an older acknowledgement cannot mark later arrivals as
        read. A missing conversation is 404 inbox_not_found even though reading
        it may return an empty list. Archiving does not change retention.
        Requests return Cache-Control: no-store.
      operationId: patch_agent_inbox_channel_number_thread_thread_
      parameters:
        - name: channel
          in: path
          required: true
          schema:
            type: string
            description: Conversation channel.
            enum:
              - sms
              - web
        - name: number
          in: path
          required: true
          schema:
            type: string
            description: International number with + and digits; no spaces.
            pattern: ^\+[1-9][0-9]{6,14}$
        - name: thread
          in: path
          required: true
          schema:
            type: string
            description: Opaque thread key from the conversation list. URL-encode it.
            minLength: 1
            maxLength: 160
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                archived:
                  type: boolean
                  description: >-
                    Set true to archive or false to unarchive. Omitted leaves
                    state unchanged.
                read_version:
                  type: string
                  description: >-
                    Opaque decimal revision. Keep as a string to avoid precision
                    loss.
                  pattern: ^[0-9]{1,18}$
              description: Supply at least one field. Unknown fields and null are refused.
              additionalProperties: false
              minProperties: 1
            example:
              archived: true
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  ok:
                    type: boolean
                    description: Update confirmed.
                    const: true
                  archived:
                    type: boolean
                    description: Current archive state.
                required:
                  - ok
                  - archived
                description: ''
                additionalProperties: false
              example:
                ok: true
                archived: true
        '400':
          description: >-
            invalid_inbox_request: A path, query, body or settings value is
            invalid. invalid_json: Invalid JSON body.
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: object
                    properties:
                      code:
                        type: string
                        description: Machine-readable error code.
                      message:
                        type: string
                        description: Explanation.
                      doc_url:
                        type: string
                        description: Error reference link.
                      details:
                        type: object
                        properties: {}
                        description: >-
                          Optional context; inspect campaign_id, status, outcome
                          and safe_to_retry for uncertain writes.
                        additionalProperties: true
                    required:
                      - code
                      - message
                      - doc_url
                      - type
                    description: ''
                    additionalProperties: false
                required:
                  - error
                description: ''
                additionalProperties: false
        '401':
          description: 'unauthorized: The credential is missing or invalid.'
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: object
                    properties:
                      code:
                        type: string
                        description: Machine-readable error code.
                      message:
                        type: string
                        description: Explanation.
                      doc_url:
                        type: string
                        description: Error reference link.
                      details:
                        type: object
                        properties: {}
                        description: >-
                          Optional context; inspect campaign_id, status, outcome
                          and safe_to_retry for uncertain writes.
                        additionalProperties: true
                    required:
                      - code
                      - message
                      - doc_url
                      - type
                    description: ''
                    additionalProperties: false
                required:
                  - error
                description: ''
                additionalProperties: false
        '404':
          description: >-
            inbox_not_found: The number or thread is unavailable to this
            account.
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: object
                    properties:
                      code:
                        type: string
                        description: Machine-readable error code.
                      message:
                        type: string
                        description: Explanation.
                      doc_url:
                        type: string
                        description: Error reference link.
                      details:
                        type: object
                        properties: {}
                        description: >-
                          Optional context; inspect campaign_id, status, outcome
                          and safe_to_retry for uncertain writes.
                        additionalProperties: true
                    required:
                      - code
                      - message
                      - doc_url
                      - type
                    description: ''
                    additionalProperties: false
                required:
                  - error
                description: ''
                additionalProperties: false
        '413':
          description: 'payload_too_large: The request exceeds the JSON body limit.'
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: object
                    properties:
                      code:
                        type: string
                        description: Machine-readable error code.
                      message:
                        type: string
                        description: Explanation.
                      doc_url:
                        type: string
                        description: Error reference link.
                      details:
                        type: object
                        properties: {}
                        description: >-
                          Optional context; inspect campaign_id, status, outcome
                          and safe_to_retry for uncertain writes.
                        additionalProperties: true
                    required:
                      - code
                      - message
                      - doc_url
                      - type
                    description: ''
                    additionalProperties: false
                required:
                  - error
                description: ''
                additionalProperties: false
        '429':
          description: 'rate_limit_exceeded: The account request limit was reached.'
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: object
                    properties:
                      code:
                        type: string
                        description: Machine-readable error code.
                      message:
                        type: string
                        description: Explanation.
                      doc_url:
                        type: string
                        description: Error reference link.
                      details:
                        type: object
                        properties: {}
                        description: >-
                          Optional context; inspect campaign_id, status, outcome
                          and safe_to_retry for uncertain writes.
                        additionalProperties: true
                    required:
                      - code
                      - message
                      - doc_url
                      - type
                    description: ''
                    additionalProperties: false
                required:
                  - error
                description: ''
                additionalProperties: false
        '503':
          description: >-
            agent_inbox_disabled: The inbox feature is disabled.
            inbox_unavailable: The inbox read or write could not be confirmed.
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: object
                    properties:
                      code:
                        type: string
                        description: Machine-readable error code.
                      message:
                        type: string
                        description: Explanation.
                      doc_url:
                        type: string
                        description: Error reference link.
                      details:
                        type: object
                        properties: {}
                        description: >-
                          Optional context; inspect campaign_id, status, outcome
                          and safe_to_retry for uncertain writes.
                        additionalProperties: true
                    required:
                      - code
                      - message
                      - doc_url
                      - type
                    description: ''
                    additionalProperties: false
                required:
                  - error
                description: ''
                additionalProperties: false
components:
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: >-
        KEY_ID:KEY_SECRET from the owning account. Keep it server-side. A
        verified personal dashboard Bearer session may be used where the
        operation documents role-based access.

````

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