---
title: "Query Channel Threads"
method: POST
path: "/channels/threads/query"
tags: ["Channels"]
---

# Query Channel Threads

`POST /channels/threads/query`

## Request body

- ChannelThreadQueryRequest
  - `thread` ChannelThreadQuery
    - `space_id` string, uuid, nullable
    - `agent_id` string, uuid, nullable
    - `external_key` string, uuid, nullable
    - `session_id` string, nullable
  - `windowing` Windowing
    - `newest` string, date-time, nullable
    - `oldest` string, date-time, nullable
    - `next` string, uuid, nullable
    - `limit` integer, nullable
    - `order` 'ascending' | 'descending', nullable
    - `interval` integer, nullable
    - `rate` number, nullable

## Response `200`

Successful Response

- ChannelThreadsResponse
  - `count` integer
  - `threads` ChannelThread[]
    - `created_at` string, date-time, nullable
    - `updated_at` string, date-time, nullable
    - `deleted_at` string, date-time, nullable
    - `created_by_id` string, uuid, nullable
    - `updated_by_id` string, uuid, nullable
    - `deleted_by_id` string, uuid, nullable
    - `id` string, uuid, nullable
    - `space_id` string, uuid, required
    - `agent_id` string, uuid, required
    - `external_key` string, uuid, nullable
    - `session_id` string, required
    - `data` ChannelThreadData, required
      - `external_locator` object, nullable
      - `pending_choice` ChannelPendingChoice — The thread's single open question. Written wholesale by the outbox each time a choice renders -- a newer one replaces this field entirely, which is what makes an older token stop resolving without any separate expiry bookkeeping.
        - `choices` ChannelPendingChoiceItem[], required
          - `label` string, required
          - `token` string, required
        - `posted_at` string, date-time, required
        - `interaction_id` string, nullable
        - `outbox_event_id` string, uuid, nullable
    - `flags` ChannelThreadFlags
      - `is_active` boolean

## Other responses

- `422` — Validation Error

## Changes

- **2026-09-24** `a28f1d059149` — 1 info
  - endpoint added

[Change history](https://skmtc.dev/agenta-ai/apis/agenta-api/changes/channels/threads/query/post.md)

---

[API](https://skmtc.dev/agenta-ai/apis/agenta-api.md) · [All operations](https://skmtc.dev/agenta-ai/apis/agenta-api/llms.txt) · [OpenAPI document](https://skmtc.dev/agenta-ai/apis/agenta-api/revisions/72f2feba8ccb?raw)
