---
title: "Messages"
description: "REST endpoints for messages. Bearer-auth required."
section: "API"
group: "REST"
order: 46
---

## GET /api/messages

List messages.

**Query parameters**

- `limit` (optional): Page size (1–100, default 100).
- `after` (optional): Keyset cursor — return the page after this row (next page).
- `before` (optional): Keyset cursor — return the page before this row (prev page).
- `ids` (optional): Comma-separated list of IDs. Narrows results to these IDs within the caller's accessible scope (does not bypass access checks).
- `filter` (optional): Nested filter expression (`<Entity>Filter`): AND/OR/NOT + per-field comparison operators + relation traversal. JSON-encoded on the query string.
- `orderBy` (optional): Multi-key sort (`<Entity>OrderBy[]`): array of `{ field: direction }` applied in order. Directions: asc/desc plus the four explicit nulls variants. JSON-encoded on the query string.
- `thread_id` (optional): Filter to messages in this thread.
- `workspace_id` (optional): Filter to messages in threads in this workspace.
- `author_participant_id` (optional): Shorthand: filter where `authorParticipantId` equals this value.
- `run_id` (optional): Shorthand: filter where `runId` equals this value.

**Response**

```json
{
  "data": [
    {
      "id": "<...>",
      "threadId": "<...>",
      "authorParticipantId": "<...>",
      "content": "<...>",
      "runId": "<...>",
      "createdAt": "<...>"
    }
  ],
  "pageInfo": {
    "total": "number",
    "hasNextPage": "boolean",
    "hasPreviousPage": "boolean",
    "startCursor": "string",
    "endCursor": "string"
  }
}
```

## GET /api/messages/{id}

Get a message by ID.

**Path parameters**

- `id` (required): Message to retrieve.

**Response**

```json
{
  "id": "string",
  "threadId": "string",
  "authorParticipantId": "string",
  "content": ["<...>"],
  "runId": "string",
  "createdAt": "string"
}
```
