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

# Read an inbox thread

> Read retained messages in one owned Nixflex inbox thread. The newest page is selected first, with its messages returned in chronological order.

**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)

Read retained messages in one owned inbox conversation. The newest page is selected first and returned in chronological order; this read does not mark messages as read.

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

**The important part**

* Read only an account-owned thread in its original channel.
* Keep private messages out of logs and shared AI prompts.

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

## 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. |
| `limit` (query) | integer | No | `100` | Messages per page. Minimum 1. Maximum 200. |
| `before` (query) | string | No | Omitted | Oldest returned created\_at for the next older page; supply before\_id too. Format: date-time. |
| `before_id` (query) | string | No | Omitted | Oldest returned message ID paired with before. Web IDs must contain 1–19 digits. Maximum 80 characters. |

Do not send a request body.

Use both created\_at and id from the oldest message in the returned page to request older messages. Rows are selected newest-first with an ID tie-break, then returned oldest-first within the selected page. With SMS, thread is the contact key; with web, it is the session key from the list response. URL-encode either.

An owned number with no matching messages can return 200 and an empty list. Retention can remove content between reads. read\_version covers the entire thread, not only the returned page: acknowledge it only if your application intends to mark all messages through that version read. 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 |
| - | - | - |
| `messages` | array of object | Saved value. |
| `messages[].id` | string | Message ID; use verbatim in the before\_id cursor. |
| `messages[].thread_key` | string | Conversation key. |
| `messages[].content` | string or null | Retained message content. |
| `messages[].created_at` | string or null | Saved timestamp, or null. Format: date-time. |
| `messages[].incoming` | boolean | Incoming visitor or customer message. |
| `messages[].inbox_version` | integer or null | Per-message sequence when tracked; use the string read\_version for acknowledgements. |
| `messages[].visit_id` | string or null | Web visit ID; null for SMS. |
| `messages[].visitor_name` | string or null | Visitor label when present. |
| `messages[].visitor_phone` | string or null | Visitor phone when present. |
| `messages[].visitor_fields` | array or null | Web messages only; up to nine saved fields. Maximum 9 items. |
| `messages[].knowledge_given` | object or array or null | Optional saved outgoing knowledge evidence when available. This additive data does not change thread pagination. |
| `read_version` | string | Maximum tracked version across the whole thread, including messages outside this page. Opaque decimal string; default 0. |
| `has_more` | boolean | More older messages remain before this page boundary. |

## 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 is the first page; use only cursors returned by the API for subsequent pages.

```bash cURL theme={"dark"}
curl --request GET \
  --url "https://api.nixflex.com/v1/agent-inbox/web/%2B12025550123/thread/visitor%2Fplus%2B%20%C3%BC?limit=2" \
  --header "Authorization: Bearer $NIXFLEX_API_KEY"
```

```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.thread("web", "+12025550123", "visitor/plus+ \u00fc", {"limit": 2});
```

```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.thread('web', '+12025550123', 'visitor/plus+ ü', limit=2)
```

```powershell CLI (PowerShell) theme={"dark"}
nixflex inbox thread web '+12025550123' --thread 'visitor/plus+ ü' --limit 2 --json --base-url "https://api.nixflex.com"
```

```json MCP theme={"dark"}
{
  "name": "get_inbox_thread",
  "arguments": {
    "channel": "web",
    "number": "+12025550123",
    "thread": "visitor/plus+ ü",
    "limit": 2
  }
}
```

## Example response

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

```json Response theme={"dark"}
{
  "messages": [],
  "read_version": "0",
  "has_more": false
}
```

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

This is a read-only request. Retry transient connection or server failures with bounded backoff; respect Retry-After for 429. Do not retry validation or ownership errors unchanged. A later read can return newer state.

## 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 GET /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}:
    get:
      tags:
        - Agent inbox
      summary: Read an inbox thread
      description: >-
        Read retained messages in one owned inbox conversation. The newest page
        is selected first and returned in chronological order; this read does
        not mark messages as read. Use both created_at and id from the oldest
        message in the returned page to request older messages. Rows are
        selected newest-first with an ID tie-break, then returned oldest-first
        within the selected page. With SMS, thread is the contact key; with web,
        it is the session key from the list response. URL-encode either.


        An owned number with no matching messages can return 200 and an empty
        list. Retention can remove content between reads. read_version covers
        the entire thread, not only the returned page: acknowledge it only if
        your application intends to mark all messages through that version read.
        Requests return Cache-Control: no-store.
      operationId: get_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
        - name: limit
          in: query
          required: false
          schema:
            type: integer
            description: Messages per page.
            default: 100
            minimum: 1
            maximum: 200
        - name: before
          in: query
          required: false
          schema:
            type: string
            description: >-
              Oldest returned created_at for the next older page; supply
              before_id too.
            format: date-time
        - name: before_id
          in: query
          required: false
          schema:
            type: string
            description: >-
              Oldest returned message ID paired with before. Web IDs must
              contain 1–19 digits.
            maxLength: 80
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  messages:
                    type: array
                    items:
                      type: object
                      properties:
                        id:
                          type: string
                          description: Message ID; use verbatim in the before_id cursor.
                        thread_key:
                          type: string
                          description: Conversation key.
                        content:
                          type:
                            - string
                            - 'null'
                          description: Retained message content.
                        created_at:
                          type:
                            - string
                            - 'null'
                          description: Saved timestamp, or null.
                          format: date-time
                        incoming:
                          type: boolean
                          description: Incoming visitor or customer message.
                        inbox_version:
                          type:
                            - integer
                            - 'null'
                          description: >-
                            Per-message sequence when tracked; use the string
                            read_version for acknowledgements.
                        visit_id:
                          type:
                            - string
                            - 'null'
                          description: Web visit ID; null for SMS.
                        visitor_name:
                          type:
                            - string
                            - 'null'
                          description: Visitor label when present.
                        visitor_phone:
                          type:
                            - string
                            - 'null'
                          description: Visitor phone when present.
                        visitor_fields:
                          type:
                            - array
                            - 'null'
                          items:
                            type: object
                            properties: {}
                            description: Saved web contact field evidence.
                            additionalProperties: true
                          description: Web messages only; up to nine saved fields.
                          maxItems: 9
                        knowledge_given:
                          description: >-
                            Optional saved outgoing knowledge evidence when
                            available. This additive data does not change thread
                            pagination.
                          type:
                            - object
                            - array
                            - 'null'
                          additionalProperties: true
                      required:
                        - id
                        - thread_key
                        - content
                        - created_at
                        - incoming
                        - inbox_version
                        - visit_id
                        - visitor_name
                        - visitor_phone
                      description: ''
                      additionalProperties: false
                    description: ''
                  read_version:
                    type: string
                    description: >-
                      Maximum tracked version across the whole thread, including
                      messages outside this page. Opaque decimal string; default
                      0.
                  has_more:
                    type: boolean
                    description: More older messages remain before this page boundary.
                required:
                  - messages
                  - read_version
                  - has_more
                description: ''
                additionalProperties: false
              example:
                messages: []
                read_version: '0'
                has_more: false
        '400':
          description: >-
            invalid_inbox_request: A path, query, body or settings value is
            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
        '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
        '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.