# List threads

List threads by recent user activity, newest first. Supply the opaque nextCursor value unchanged to continue pagination.

`GET /api/threads`

Required permission: `thread:read`.

## Parameters

| Name | In | Type | Required | Description |

| --- | --- | --- | --- | --- |

| `projectId` | query | `string` | No | Return threads from one project. |

| `status` | query | `ThreadStatus` | No | Return threads in one lifecycle status. |

| `archived` | query | `boolean` | No | Filter by archive state. |

| `q` | query | `string` | No | Search thread titles. |

| `limit` | query | `integer` | No | Page size, from 1 to 100. |

| `cursor` | query | `string` | No | Opaque cursor returned by the previous page. |

## Example request

```bash
curl --request GET \
  --url https://api.hoplite.sh/api/threads \
  --header "X-Api-Key: $HOPLITE_API_KEY"
```

## 200 response

A page of threads.

Content type: `application/json`. Response type: `ThreadsResponse`.

| Field | Type | Required | Constraints | Description |
| --- | --- | --- | --- | --- |
| `ok` | `boolean` | Yes | constant true | — |
| `threads` | `Thread[]` | Yes | — | — |
| `threads.id` | `string` | Yes | — | — |
| `threads.projectId` | `string` | Yes | — | — |
| `threads.modelId` | `string \| null` | No | — | — |
| `threads.githubPullRequestNumber` | `integer \| null` | No | min 1 | — |
| `threads.title` | `string \| null` | No | — | — |
| `threads.status` | `ThreadStatus` | Yes | queued · running · waiting · blocked · ready · failed · archived | — |
| `threads.archivedAt` | `string \| null` | No | — | — |
| `threads.initializationState` | `string` | No | accepted · preparing · completed · failed · cancelled | — |
| `threads.initializationPhase` | `string \| null` | No | provisioning_workspace · resolving_repository · allocating_sandbox · fetching_repository · configuring_workspace · dispatching_run ·  | — |
| `threads.initializationAttemptCount` | `integer` | No | min 0 | — |
| `threads.initializationErrorCode` | `string \| null` | No | — | — |
| `threads.initializationErrorMessage` | `string \| null` | No | — | — |
| `threads.initializationUpdatedAt` | `string \| null` | No | — | — |
| `threads.waitingOn` | `string[]` | Yes | — | — |
| `threads.waitingOn.[item]` | `string` | No | — | — |
| `threads.blockedOn` | `string[]` | Yes | — | — |
| `threads.blockedOn.[item]` | `string` | No | — | — |
| `threads.pendingWakeups` | `integer` | Yes | min 0 | — |
| `threads.tasks` | `ThreadTask[]` | Yes | — | — |
| `threads.tasks.id` | `string` | Yes | — | — |
| `threads.tasks.identifier` | `string` | No | — | — |
| `threads.tasks.title` | `string` | No | — | — |
| `threads.tasks.status` | `string` | No | — | — |
| `threads.tasks.threadIndex` | `number \| null` | No | — | — |
| `threads.pullRequests` | `PullRequest[]` | Yes | — | — |
| `threads.pullRequests.id` | `string` | No | — | — |
| `threads.pullRequests.threadId` | `string` | No | — | — |
| `threads.pullRequests.number` | `number` | Yes | — | — |
| `threads.pullRequests.url` | `string<uri>` | Yes | — | — |
| `threads.pullRequests.repoFullName` | `string` | Yes | — | — |
| `threads.pullRequests.state` | `string` | Yes | — | — |
| `threads.pullRequests.headRef` | `string` | No | — | — |
| `threads.pullRequests.headSha` | `string` | No | — | — |
| `threads.pullRequests.baseRef` | `string` | No | — | — |
| `threads.pullRequests.draft` | `boolean` | No | — | — |
| `threads.pullRequests.version` | `integer` | No | min 0 | — |
| `threads.pullRequests.githubSummary` | `PullRequestSummary \| null` | No | — | — |
| `threads.pullRequests.githubSummary.Option 1` | `PullRequestSummary` | No | — | — |
| `threads.pullRequests.githubSummary.Option 1.state` | `string` | Yes | — | — |
| `threads.pullRequests.githubSummary.Option 1.draft` | `boolean` | Yes | — | — |
| `threads.pullRequests.githubSummary.Option 1.mergeable` | `string` | Yes | mergeable · conflicting · unknown | — |
| `threads.pullRequests.githubSummary.Option 1.mergeQueued` | `boolean` | No | — | — |
| `threads.pullRequests.githubSummary.Option 1.checks` | `PullRequestChecksSummary` | Yes | — | — |
| `threads.pullRequests.githubSummary.Option 1.checks.total` | `integer` | Yes | min 0 | — |
| `threads.pullRequests.githubSummary.Option 1.checks.succeeded` | `integer` | Yes | min 0 | — |
| `threads.pullRequests.githubSummary.Option 1.checks.failing` | `integer` | Yes | min 0 | — |
| `threads.pullRequests.githubSummary.Option 1.checks.running` | `integer` | Yes | min 0 | — |
| `threads.pullRequests.githubSummary.Option 1.checksAvailable` | `boolean` | Yes | — | — |
| `threads.pullRequests.githubSummary.Option 1.commentsAvailable` | `boolean` | Yes | — | — |
| `threads.pullRequests.githubSummary.Option 1.unresolvedCount` | `integer` | Yes | min 0 | — |
| `threads.pullRequests.githubSummary.Option 2` | `null` | No | — | — |
| `threads.pullRequests.githubSummaryUpdatedAt` | `string \| null` | No | — | — |
| `threads.pullRequests.reviewLoop` | `PullRequestReviewLoop \| null` | No | — | — |
| `threads.pullRequests.reviewLoop.Option 1` | `PullRequestReviewLoop` | No | — | — |
| `threads.pullRequests.reviewLoop.Option 1.id` | `string` | Yes | — | — |
| `threads.pullRequests.reviewLoop.Option 1.threadId` | `string` | Yes | — | — |
| `threads.pullRequests.reviewLoop.Option 1.pullRequestId` | `string` | Yes | — | — |
| `threads.pullRequests.reviewLoop.Option 1.enabled` | `boolean` | Yes | — | — |
| `threads.pullRequests.reviewLoop.Option 1.autoMerge` | `boolean` | Yes | — | — |
| `threads.pullRequests.reviewLoop.Option 1.disabledBy` | `string \| null` | No | user · system ·  | — |
| `threads.pullRequests.reviewLoop.Option 1.status` | `string` | Yes | disabled · observing · waiting_checks · fixing · finalizing · ready · blocked · error | — |
| `threads.pullRequests.reviewLoop.Option 1.headSha` | `string \| null` | No | — | — |
| `threads.pullRequests.reviewLoop.Option 1.lastProcessedHeadSha` | `string \| null` | No | — | — |
| `threads.pullRequests.reviewLoop.Option 1.lastObservedAt` | `string \| null` | No | — | — |
| `threads.pullRequests.reviewLoop.Option 1.waitUntil` | `string \| null` | No | — | — |
| `threads.pullRequests.reviewLoop.Option 1.lastFixRunId` | `string \| null` | No | — | — |
| `threads.pullRequests.reviewLoop.Option 1.passCount` | `integer` | Yes | min 0 | — |
| `threads.pullRequests.reviewLoop.Option 1.operationalRetryCount` | `integer` | Yes | min 0 | — |
| `threads.pullRequests.reviewLoop.Option 1.lastErrorCode` | `string \| null` | No | — | — |
| `threads.pullRequests.reviewLoop.Option 1.lastErrorMessage` | `string \| null` | No | — | — |
| `threads.pullRequests.reviewLoop.Option 1.blockedReason` | `string \| null` | No | — | — |
| `threads.pullRequests.reviewLoop.Option 1.createdAt` | `string<date-time>` | No | — | — |
| `threads.pullRequests.reviewLoop.Option 1.updatedAt` | `string<date-time>` | No | — | — |
| `threads.pullRequests.reviewLoop.Option 2` | `null` | No | — | — |
| `threads.taskId` | `string` | No | — | — |
| `threads.taskIdentifier` | `string \| null` | No | — | — |
| `threads.linearIssueUrl` | `string \| null` | No | — | — |
| `threads.primaryPullRequest` | `PullRequest \| null` | No | — | — |
| `threads.primaryPullRequest.Option 1` | `PullRequest` | No | — | — |
| `threads.primaryPullRequest.Option 1.id` | `string` | No | — | — |
| `threads.primaryPullRequest.Option 1.threadId` | `string` | No | — | — |
| `threads.primaryPullRequest.Option 1.number` | `number` | Yes | — | — |
| `threads.primaryPullRequest.Option 1.url` | `string<uri>` | Yes | — | — |
| `threads.primaryPullRequest.Option 1.repoFullName` | `string` | Yes | — | — |
| `threads.primaryPullRequest.Option 1.state` | `string` | Yes | — | — |
| `threads.primaryPullRequest.Option 1.headRef` | `string` | No | — | — |
| `threads.primaryPullRequest.Option 1.headSha` | `string` | No | — | — |
| `threads.primaryPullRequest.Option 1.baseRef` | `string` | No | — | — |
| `threads.primaryPullRequest.Option 1.draft` | `boolean` | No | — | — |
| `threads.primaryPullRequest.Option 1.version` | `integer` | No | min 0 | — |
| `threads.primaryPullRequest.Option 1.githubSummary` | `PullRequestSummary \| null` | No | — | — |
| `threads.primaryPullRequest.Option 1.githubSummary.Option 1` | `PullRequestSummary` | No | — | — |
| `threads.primaryPullRequest.Option 1.githubSummary.Option 1.state` | `string` | Yes | — | — |
| `threads.primaryPullRequest.Option 1.githubSummary.Option 1.draft` | `boolean` | Yes | — | — |
| `threads.primaryPullRequest.Option 1.githubSummary.Option 1.mergeable` | `string` | Yes | mergeable · conflicting · unknown | — |
| `threads.primaryPullRequest.Option 1.githubSummary.Option 1.mergeQueued` | `boolean` | No | — | — |
| `threads.primaryPullRequest.Option 1.githubSummary.Option 1.checks` | `PullRequestChecksSummary` | Yes | — | — |
| `threads.primaryPullRequest.Option 1.githubSummary.Option 1.checks.total` | `integer` | Yes | min 0 | — |
| `threads.primaryPullRequest.Option 1.githubSummary.Option 1.checks.succeeded` | `integer` | Yes | min 0 | — |
| `threads.primaryPullRequest.Option 1.githubSummary.Option 1.checks.failing` | `integer` | Yes | min 0 | — |
| `threads.primaryPullRequest.Option 1.githubSummary.Option 1.checks.running` | `integer` | Yes | min 0 | — |
| `threads.primaryPullRequest.Option 1.githubSummary.Option 1.checksAvailable` | `boolean` | Yes | — | — |
| `threads.primaryPullRequest.Option 1.githubSummary.Option 1.commentsAvailable` | `boolean` | Yes | — | — |
| `threads.primaryPullRequest.Option 1.githubSummary.Option 1.unresolvedCount` | `integer` | Yes | min 0 | — |
| `threads.primaryPullRequest.Option 1.githubSummary.Option 2` | `null` | No | — | — |
| `threads.primaryPullRequest.Option 1.githubSummaryUpdatedAt` | `string \| null` | No | — | — |
| `threads.primaryPullRequest.Option 1.reviewLoop` | `PullRequestReviewLoop \| null` | No | — | — |
| `threads.primaryPullRequest.Option 1.reviewLoop.Option 1` | `PullRequestReviewLoop` | No | — | — |
| `threads.primaryPullRequest.Option 1.reviewLoop.Option 1.id` | `string` | Yes | — | — |
| `threads.primaryPullRequest.Option 1.reviewLoop.Option 1.threadId` | `string` | Yes | — | — |
| `threads.primaryPullRequest.Option 1.reviewLoop.Option 1.pullRequestId` | `string` | Yes | — | — |
| `threads.primaryPullRequest.Option 1.reviewLoop.Option 1.enabled` | `boolean` | Yes | — | — |
| `threads.primaryPullRequest.Option 1.reviewLoop.Option 1.autoMerge` | `boolean` | Yes | — | — |
| `threads.primaryPullRequest.Option 1.reviewLoop.Option 1.disabledBy` | `string \| null` | No | user · system ·  | — |
| `threads.primaryPullRequest.Option 1.reviewLoop.Option 1.status` | `string` | Yes | disabled · observing · waiting_checks · fixing · finalizing · ready · blocked · error | — |
| `threads.primaryPullRequest.Option 1.reviewLoop.Option 1.headSha` | `string \| null` | No | — | — |
| `threads.primaryPullRequest.Option 1.reviewLoop.Option 1.lastProcessedHeadSha` | `string \| null` | No | — | — |
| `threads.primaryPullRequest.Option 1.reviewLoop.Option 1.lastObservedAt` | `string \| null` | No | — | — |
| `threads.primaryPullRequest.Option 1.reviewLoop.Option 1.waitUntil` | `string \| null` | No | — | — |
| `threads.primaryPullRequest.Option 1.reviewLoop.Option 1.lastFixRunId` | `string \| null` | No | — | — |
| `threads.primaryPullRequest.Option 1.reviewLoop.Option 1.passCount` | `integer` | Yes | min 0 | — |
| `threads.primaryPullRequest.Option 1.reviewLoop.Option 1.operationalRetryCount` | `integer` | Yes | min 0 | — |
| `threads.primaryPullRequest.Option 1.reviewLoop.Option 1.lastErrorCode` | `string \| null` | No | — | — |
| `threads.primaryPullRequest.Option 1.reviewLoop.Option 1.lastErrorMessage` | `string \| null` | No | — | — |
| `threads.primaryPullRequest.Option 1.reviewLoop.Option 1.blockedReason` | `string \| null` | No | — | — |
| `threads.primaryPullRequest.Option 1.reviewLoop.Option 1.createdAt` | `string<date-time>` | No | — | — |
| `threads.primaryPullRequest.Option 1.reviewLoop.Option 1.updatedAt` | `string<date-time>` | No | — | — |
| `threads.primaryPullRequest.Option 1.reviewLoop.Option 2` | `null` | No | — | — |
| `threads.primaryPullRequest.Option 2` | `null` | No | — | — |
| `threads.createdAt` | `string<date-time>` | No | — | — |
| `threads.updatedAt` | `string<date-time>` | No | — | — |
| `threads.spendLimitMicros` | `integer \| null` | No | min 1 | — |
| `threads.version` | `integer` | No | min 0 | — |
| `threads.titleVersion` | `integer` | No | min 0 | — |
| `threads.archiveVersion` | `integer` | No | min 0 | — |
| `threads.latestUserMessageAt` | `string<date-time>` | No | — | — |
| `threads.workspaceStatus` | `string \| null` | No | preparing · cancelled · ready · archived · cleanup_pending · error ·  | — |
| `threads.workspaceSetupStatus` | `string \| null` | No | pending · running · ready · failed ·  | — |
| `threads.latestRunId` | `string \| null` | No | — | — |
| `threads.sourceId` | `string \| null` | No | — | Initial immutable Platform source, when source-backed. |
| `threads.latestSourceId` | `string \| null` | No | — | Latest successful immutable Platform source. |
| `threads.runStartedAt` | `string \| null` | No | — | — |
| `threads.runTurnStartedAt` | `string \| null` | No | — | Durable anchor for the admitted turn; unlike runStartedAt it spans compaction and follow-up runs. |
| `threads.runStatus` | `string \| null` | No | queued · running · waiting · completed · failed · cancelled ·  | Status of the latest run; distinguishes a genuinely queued run from a previous terminal run during the optimistic new-run window. |
| `threads.runSteerable` | `boolean \| null` | No | — | Whether the active run accepts same-run steering; false while a compact, repair, or foreign-workflow run holds the thread, so a follow-up would queue behind it. Null with no active run. |
| `threads.stopRequestedAt` | `string \| null` | No | — | — |
| `threads.runActiveDurationMs` | `integer \| null` | No | min 0 | — |
| `threads.runActiveDurationProvenance` | `string` | No | accounted · legacy_default · unknown | Whether the active duration was actively accounted, inherited from the legacy database default, or cannot be attributed during rollout. |
| `threads.runActiveSegmentStartedAt` | `string \| null` | No | — | — |
| `threads.sentryIssue` | `SentryIssueLink \| null` | No | — | — |
| `threads.sentryIssue.Option 1` | `SentryIssueLink` | No | — | — |
| `threads.sentryIssue.Option 1.issueId` | `string` | Yes | — | — |
| `threads.sentryIssue.Option 1.shortId` | `string \| null` | No | — | — |
| `threads.sentryIssue.Option 1.title` | `string \| null` | No | — | — |
| `threads.sentryIssue.Option 1.level` | `string \| null` | No | — | — |
| `threads.sentryIssue.Option 1.projectId` | `string` | Yes | — | — |
| `threads.sentryIssue.Option 1.projectSlug` | `string` | Yes | — | — |
| `threads.sentryIssue.Option 1.organizationSlug` | `string` | Yes | — | — |
| `threads.sentryIssue.Option 1.url` | `string<uri>` | Yes | — | — |
| `threads.sentryIssue.Option 2` | `null` | No | — | — |
| `threads.createdByUserId` | `string \| null` | No | — | — |
| `threads.createdByAutomation` | `boolean` | No | — | — |
| `threads.participantUserIds` | `string[]` | No | — | — |
| `threads.participantUserIds.[item]` | `string` | No | — | — |
| `threads.executionTarget` | `LocalAgentExecutionTarget \| null` | No | — | — |
| `threads.executionTarget.Option 1` | `LocalAgentExecutionTarget` | No | — | — |
| `threads.executionTarget.Option 1.bindingId` | `string` | Yes | min length 1, max length 128 | — |
| `threads.executionTarget.Option 1.hostId` | `string` | Yes | min length 1, max length 128 | — |
| `threads.executionTarget.Option 1.kind` | `string` | Yes | constant "local" | — |
| `threads.executionTarget.Option 1.model` | `string \| null` | No | min length 1, max length 128 | — |
| `threads.executionTarget.Option 1.provider` | `string` | Yes | codex · claude | — |
| `threads.executionTarget.Option 1.workspaceMode` | `string` | Yes | direct · worktree | — |
| `threads.executionTarget.Option 2` | `null` | No | — | — |
| `nextCursor` | `string \| null` | Yes | — | — |
| `hasMore` | `boolean` | Yes | — | — |
| `statusCounts` | `object` | Yes | — | — |
| `statusCounts.queued` | `integer` | No | min 0 | — |
| `statusCounts.running` | `integer` | No | min 0 | — |
| `statusCounts.waiting` | `integer` | No | min 0 | — |
| `statusCounts.blocked` | `integer` | No | min 0 | — |
| `statusCounts.ready` | `integer` | No | min 0 | — |
| `statusCounts.failed` | `integer` | No | min 0 | — |
| `statusCounts.archived` | `integer` | No | min 0 | — |
| `totalCount` | `integer` | Yes | min 0 | — |

```json
{
  "ok": true,
  "threads": [
    {
      "id": "thr_01JQ7B",
      "projectId": "proj_01JQ75",
      "title": "Add checkout analytics",
      "status": "running",
      "waitingOn": [],
      "blockedOn": [],
      "pendingWakeups": 0,
      "tasks": [],
      "pullRequests": []
    }
  ],
  "hasMore": true,
  "nextCursor": "eyJpZCI6InRocl8wMUpRN0IiLCJyZWNlbmN5QXQiOiIyMDI2...",
  "statusCounts": {
    "running": 1,
    "ready": 12
  },
  "totalCount": 13
}
```

## Response headers

| Header | Type | Statuses | Description |

| --- | --- | --- | --- |

| `RateLimit` | `string` | `200`, `400`, `401`, `402`, `403`, `429`, `500`, `501`, `503` | Current ingress policy, remaining requests, and seconds until reset, for example `"ingress";r=599;t=60`. |

| `RateLimit-Policy` | `string` | `200`, `400`, `401`, `402`, `403`, `429`, `500`, `501`, `503` | Ingress quota and window, for example `"ingress";q=600;qu="requests";w=60`. |

| `X-RateLimit-Limit` | `integer` | `200`, `400`, `401`, `402`, `403`, `429`, `500`, `501`, `503` | Maximum requests allowed in the current rolling window. |

| `X-RateLimit-Remaining` | `integer` | `200`, `400`, `401`, `402`, `403`, `429`, `500`, `501`, `503` | Requests remaining in the current rolling window. |

| `X-RateLimit-Reset` | `integer` | `200`, `400`, `401`, `402`, `403`, `429`, `500`, `501`, `503` | Unix timestamp when the current rolling window resets. |

| `x-request-id` | `string` | `200`, `400`, `401`, `402`, `403`, `429`, `500`, `501`, `503` | Request correlation ID. |

| `Retry-After` | `integer` | `429`, `503` | Seconds until another request should be attempted. |

| `X-Retry-After` | `integer` | `429`, `503` | Legacy retry delay in seconds. |

## Status codes

- `200` — A page of threads.

- `400` — A filter, limit, or cursor is invalid.

- `401` — The API key is missing, invalid, or lacks the operation's permission.

- `402` — The organization does not have access to the requested product capability.

- `403` — The key's current user no longer has the required organization membership or role.

- `429` — The API-key rate limit has been exceeded.

- `500` — The API encountered an unexpected failure.

- `501` — The deployment has not configured the requested capability.

- `503` — A required API dependency, including the rate limiter, is unavailable.