# Read authoritative run state

Read authoritative run state

`GET /api/threads/{id}/run-state`

Required permission: `thread:read`.

## Parameters

| Name | In | Type | Required | Description |

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

| `id` | path | `string` | Yes | — |

| `runId` | query | `string` | No | — |

## Example request

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

## 200 response

Successful response

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

| Field | Type | Required | Constraints | Description |
| --- | --- | --- | --- | --- |
| `ok` | `boolean` | Yes | constant true | — |
| `run` | `object` | Yes | — | — |
| `run.runId` | `string` | Yes | — | — |
| `run.status` | `string` | Yes | queued · running · waiting · completed · failed · cancelled | — |
| `run.finishedAt` | `string \| null` | Yes | — | — |
| `run.assistantMessage` | `object \| null` | Yes | — | — |
| `run.assistantMessage.Option 1` | `object` | No | — | — |
| `run.assistantMessage.Option 1.id` | `string` | Yes | — | — |
| `run.assistantMessage.Option 1.threadId` | `string` | Yes | — | — |
| `run.assistantMessage.Option 1.runId` | `string` | No | — | — |
| `run.assistantMessage.Option 1.queuedAfterRunId` | `string` | No | — | — |
| `run.assistantMessage.Option 1.authorUserId` | `string` | No | — | — |
| `run.assistantMessage.Option 1.author` | `object \| null` | No | — | — |
| `run.assistantMessage.Option 1.author.Option 1` | `object` | No | — | — |
| `run.assistantMessage.Option 1.author.Option 1.id` | `string` | Yes | — | — |
| `run.assistantMessage.Option 1.author.Option 1.name` | `string` | Yes | — | — |
| `run.assistantMessage.Option 1.author.Option 1.image` | `string \| null` | No | — | — |
| `run.assistantMessage.Option 1.author.Option 1.[key]` | `object` | No | — | — |
| `run.assistantMessage.Option 1.author.Option 2` | `null` | No | — | — |
| `run.assistantMessage.Option 1.role` | `string` | Yes | user · assistant · system · tool | — |
| `run.assistantMessage.Option 1.content` | `string` | Yes | — | — |
| `run.assistantMessage.Option 1.createdAt` | `string` | Yes | — | — |
| `run.assistantMessage.Option 1.kind` | `string` | No | chat · thinking · tool · status | — |
| `run.assistantMessage.Option 1.toolCallId` | `string` | No | — | — |
| `run.assistantMessage.Option 1.toolName` | `string` | No | — | — |
| `run.assistantMessage.Option 1.checkpointId` | `string` | No | — | — |
| `run.assistantMessage.Option 1.metadata` | `object` | No | — | — |
| `run.assistantMessage.Option 1.metadata.[key]` | `getThreadRunStateResponseschema0` | No | — | — |
| `run.assistantMessage.Option 1.metadata.[key].Option 1` | `string` | No | — | — |
| `run.assistantMessage.Option 1.metadata.[key].Option 2` | `number` | No | — | — |
| `run.assistantMessage.Option 1.metadata.[key].Option 3` | `boolean` | No | — | — |
| `run.assistantMessage.Option 1.metadata.[key].Option 4` | `null` | No | — | — |
| `run.assistantMessage.Option 1.metadata.[key].Option 5` | `getThreadRunStateResponseschema0[]` | No | — | — |
| `run.assistantMessage.Option 1.metadata.[key].Option 5.Recursive value` | `getThreadRunStateResponseschema0` | No | — | Recursive schema; see /docs/openapi.json. |
| `run.assistantMessage.Option 1.metadata.[key].Option 6` | `object` | No | — | — |
| `run.assistantMessage.Option 1.metadata.[key].Option 6.[key]` | `getThreadRunStateResponseschema0` | No | — | — |
| `run.assistantMessage.Option 1.metadata.[key].Option 6.[key].Recursive value` | `getThreadRunStateResponseschema0` | No | — | Recursive schema; see /docs/openapi.json. |
| `run.assistantMessage.Option 2` | `null` | No | — | — |
| `run.userMessage` | `object \| null` | Yes | — | — |
| `run.userMessage.Option 1` | `object` | No | — | — |
| `run.userMessage.Option 1.id` | `string` | Yes | — | — |
| `run.userMessage.Option 1.threadId` | `string` | Yes | — | — |
| `run.userMessage.Option 1.runId` | `string` | No | — | — |
| `run.userMessage.Option 1.queuedAfterRunId` | `string` | No | — | — |
| `run.userMessage.Option 1.authorUserId` | `string` | No | — | — |
| `run.userMessage.Option 1.author` | `object \| null` | No | — | — |
| `run.userMessage.Option 1.author.Option 1` | `object` | No | — | — |
| `run.userMessage.Option 1.author.Option 1.id` | `string` | Yes | — | — |
| `run.userMessage.Option 1.author.Option 1.name` | `string` | Yes | — | — |
| `run.userMessage.Option 1.author.Option 1.image` | `string \| null` | No | — | — |
| `run.userMessage.Option 1.author.Option 1.[key]` | `object` | No | — | — |
| `run.userMessage.Option 1.author.Option 2` | `null` | No | — | — |
| `run.userMessage.Option 1.role` | `string` | Yes | user · assistant · system · tool | — |
| `run.userMessage.Option 1.content` | `string` | Yes | — | — |
| `run.userMessage.Option 1.createdAt` | `string` | Yes | — | — |
| `run.userMessage.Option 1.kind` | `string` | No | chat · thinking · tool · status | — |
| `run.userMessage.Option 1.toolCallId` | `string` | No | — | — |
| `run.userMessage.Option 1.toolName` | `string` | No | — | — |
| `run.userMessage.Option 1.checkpointId` | `string` | No | — | — |
| `run.userMessage.Option 1.metadata` | `object` | No | — | — |
| `run.userMessage.Option 1.metadata.[key]` | `getThreadRunStateResponseschema0` | No | — | — |
| `run.userMessage.Option 1.metadata.[key].Option 1` | `string` | No | — | — |
| `run.userMessage.Option 1.metadata.[key].Option 2` | `number` | No | — | — |
| `run.userMessage.Option 1.metadata.[key].Option 3` | `boolean` | No | — | — |
| `run.userMessage.Option 1.metadata.[key].Option 4` | `null` | No | — | — |
| `run.userMessage.Option 1.metadata.[key].Option 5` | `getThreadRunStateResponseschema0[]` | No | — | — |
| `run.userMessage.Option 1.metadata.[key].Option 5.Recursive value` | `getThreadRunStateResponseschema0` | No | — | Recursive schema; see /docs/openapi.json. |
| `run.userMessage.Option 1.metadata.[key].Option 6` | `object` | No | — | — |
| `run.userMessage.Option 1.metadata.[key].Option 6.[key]` | `getThreadRunStateResponseschema0` | No | — | — |
| `run.userMessage.Option 1.metadata.[key].Option 6.[key].Recursive value` | `getThreadRunStateResponseschema0` | No | — | Recursive schema; see /docs/openapi.json. |
| `run.userMessage.Option 2` | `null` | No | — | — |

```json

```

## Response headers

| Header | Type | Statuses | Description |

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

| `RateLimit` | `string` | `200`, `400`, `401`, `402`, `403`, `404`, `409`, `410`, `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`, `404`, `409`, `410`, `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`, `404`, `409`, `410`, `429`, `500`, `501`, `503` | Maximum requests allowed in the current rolling window. |

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

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

| `x-request-id` | `string` | `200`, `400`, `401`, `402`, `403`, `404`, `409`, `410`, `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` — Successful response

- `400` — Invalid request. Validation responses include field paths.

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

- `404` — The resource is not available in the authenticated scope.

- `409` — The request conflicts with a retry receipt or current resource state.

- `410` — The event cursor has expired; capture a fresh head and resource snapshot.

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