---
title: "Threads"
description: "The threads endpoints of the HTTP API."
---

> Documentation Index
> Fetch the complete documentation index at: https://slashobserve.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Threads

## GET /threads

List the comment threads on a dashboard, an annotation, an observation or a proposal.

Pages through the messages of the target's threads, oldest first, and returns each message with the thread it belongs to. `limit` counts messages, so a thread can continue on the next page; `threads` holds only the threads that appear on this page. `can_comment` says whether the caller may start threads and write messages on the target. Reading needs View on the target: a dashboard follows its folder, an annotation on a dashboard follows that dashboard, a global annotation follows the General folder, an observation follows the folder it is in, and a proposal follows its dashboard. A target the caller cannot see answers 404, never 403.

### Parameters

| Name | In | Type | Description |
| --- | --- | --- | --- |
| `target` (required) | query | `string` | The object to read, as `<kind>:<id>` with kind `dashboard`, `annotation`, `observation` or `proposal`. |
| `status` | query | `"open"`, `"resolved"`, `"all"` | Default `"all"`. |
| `panel_id` | query | `string` | Only threads on this panel; dashboards only. |
| `limit` | query | `integer` | Between 1 and 500. Default `100`. |
| `cursor` | query | `string` |   |

### Responses

| Status | Description | Body |
| --- | --- | --- |
| `200` | One page of messages with their threads. | [`ThreadPage`](/docs/reference/api/schemas/#threadpage) |
| `400` | The request is malformed or fails validation. | [`Error`](/docs/reference/api/schemas/#error) |
| `401` | Authentication is missing or invalid. | [`Error`](/docs/reference/api/schemas/#error) |
| `404` | The resource does not exist, or the caller cannot see it; the two are never told apart. | [`Error`](/docs/reference/api/schemas/#error) |
| `422` | `target` is not `<kind>:<id>` (`invalid_target`), `status` is not open, resolved or all (`invalid_status`), or `panel_id` is not a panel id (`invalid_panel_id`). | [`Error`](/docs/reference/api/schemas/#error) |
| `500` | The server failed to handle the request. | [`Error`](/docs/reference/api/schemas/#error) |

## POST /threads

Start a thread on a dashboard, an annotation, an observation or a proposal.

The first message of a thread has the id of the thread, so either id names it. A dashboard thread is anchored to a version, the latest when `version` is absent, and to a panel of that version, or to the whole dashboard when `panel_id` is absent; the anchor never moves. `version` and `panel_id` are refused on an annotation or an observation. `block_id` anchors the first message to one block of an observation; absent or null means the whole observation. It is refused on a dashboard, an annotation or a proposal, and must name a block of this observation, with 422 `invalid_block` otherwise. Deleting the block keeps the message, now about the whole observation. `anchor` points the thread at one spot of a dashboard panel or, with `block_id`, of an observation block, and is refused on an annotation or a proposal (422 `invalid_target`) or when its kind lacks a field it needs (422 `invalid_anchor`). `block_id` with an anchor sets the thread's block; without an anchor it keeps its message meaning, the block the first message is about. `block_id` with an anchor of a kind that cannot sit on a block, `variable`, answers 422 `invalid_anchor` naming both fields. An observation has one page thread, its discussion, and any number of anchored threads; starting a second page thread adds the message to the first. The body is trimmed first, and the limit of 1 to 4000 characters applies to the trimmed text. Control characters other than newline, carriage return and tab, and the bidirectional override and isolate characters (U+202A to U+202E and U+2066 to U+2069), are refused, and so is text with no visible character, such as only zero-width characters (400 or 422 with a `reason`, see `docs/reference/text-rules.md`). Mention a person with `@[Name](user:<id>)`, the built-in agent with `@observe`, one of your own connected agents with `@[Name](grant:<grant id>)` and a service account that takes runs with `@[Name](service_account:<id>)`, at most 20 mentions in a message, a repeated mention counting each time (422 `too_many_mentions`). A grant that is not yours, revoked or expired, a service account that takes no runs, and a person who does not exist or cannot see the target all answer 422 `invalid_mention`; a service-account key may mention `@observe` and service accounts, never a grant. A mention is recorded, shows in the activity log, and a mentioned person gets it in their Inbox. `to` decides who the message is for. Absent, a message that mentions one agent asks it, a message that mentions a person asks no agent, and any other message asks the thread's agent unless it is off. `agent` asks the agent it mentions, else the thread's agent, else `@observe`; `everyone` asks no agent and turns the thread's agent off. The agent a message asks becomes the thread's agent, so later plain replies ask it too. More than one agent in a message answers 422 `too_many_agents` and writes nothing, whatever `to` says. The agent asked gets one run in the same transaction as the message, with the message's text as the prompt (the agent's token removed) and the earlier messages of the thread, the last 20 and at most 8000 characters, as its context. A dashboard thread starts a `comment` run on the thread's version and panel, which a Commenter may start and which ends in a proposal when the person cannot edit; an observation thread starts a read-only `investigate` run about the observation, which needs Comment on it, has no per-person cap and answers in the thread without writing on the page. An annotation or a proposal thread starts no run. A run that cannot start never fails the message: the message is stored and `message.run_refusal` says why, as `mention_target_unsupported`, `agent_unavailable` (`@observe` without a model provider, or a thread agent that was disconnected, which is then cleared), `agent_not_yours` (the thread's agent is someone else's connected agent), `forbidden_role` or `too_many_runs`. A started run is in `message.run`, and `to` in the answer says how the message was delivered. `client_id` is a UUID the caller makes for the message; sending it again answers 200 with the message already posted, `replayed: true` and no new run, and reusing it on another target answers 422 `client_id_reused`. The thread is recorded as a `thread.opened` activity event, and a dashboard thread also sends `comment.created` to the dashboard's event stream; a change of the thread's agent is audited as `thread.agent_set`. A comment sent to a dashboard with `request_revision` has its own path. Writing needs Comment on the target; a caller who can see it but not comment gets 403.

### Request body

`application/json`, required.

| Field | Type | Description |
| --- | --- | --- |
| `target` (required) | `string` | The object to comment on, as `<kind>:<id>` with kind `dashboard`, `annotation`, `observation` or `proposal`. |
| `version` | `integer` or `null` | The dashboard version to anchor to; the latest when absent. Dashboards only. Between 1 and 2147483647. |
| `panel_id` | `string` or `null` | The panel to comment on; absent or null means the whole object. Dashboards only. |
| `block_id` | `string` (uuid) or `null` | Observations only. With `anchor` it sets the thread's block, the block the anchor sits on; without `anchor` it keeps its message meaning, the block this first message is about. Absent or null means the whole observation. With an `anchor` of kind `variable`, which cannot sit on a block, it answers 422 `invalid_anchor`. |
| `anchor` | [`Anchor`](/docs/reference/api/schemas/#anchor) or `null` | The spot the thread points at; absent or null for the whole dashboard, panel or observation. Dashboards and observations only. |
| `body` (required) | `string` |   |
| `to` | `"agent"`, `"everyone"` | Who the message is for; absent decides from the mentions and the thread's agent. |
| `client_id` | `string` (uuid) or `null` | A UUID the caller makes for this message, so a resend returns the message already posted. |

### Responses

| Status | Description | Body |
| --- | --- | --- |
| `200` | The message `client_id` names was already posted; it is returned as it was, with `replayed` true. | [`ThreadSent`](/docs/reference/api/schemas/#threadsent) |
| `201` | The thread and its first message, or the observation's page thread and the new message, with `message.run` or `message.run_refusal` when the message asked an agent. | [`ThreadSent`](/docs/reference/api/schemas/#threadsent) |
| `400` | The request is malformed or fails validation. | [`Error`](/docs/reference/api/schemas/#error) |
| `401` | Authentication is missing or invalid. | [`Error`](/docs/reference/api/schemas/#error) |
| `403` | The caller is not allowed to perform the request; a role that is too low is code `forbidden_role`. | [`Error`](/docs/reference/api/schemas/#error) |
| `404` | The resource does not exist, or the caller cannot see it; the two are never told apart. | [`Error`](/docs/reference/api/schemas/#error) |
| `413` | The request body exceeds the size limit. | [`Error`](/docs/reference/api/schemas/#error) |
| `422` | The request is well formed but refused: `invalid_target`, `invalid_body` (empty, too long or with refused characters), `too_many_mentions`, `invalid_panel_id`, `invalid_version` (`version` is out of range or below the version the thread is on), `unknown_panel` (the panel is not in that version's Spec), `unknown_version` (the version does not exist on the dashboard), `invalid_block` (`block_id` is not a block of this observation, or the target is not an observation), `invalid_reply_to` (`reply_to_id` is not a message of this thread), `invalid_mention` (a `grant` mention names a connected agent that is not the caller's own or is revoked or expired, or a `service_account` mention names an account that does not take runs, or does not exist) or `too_many_agents` (a message mentions more than one agent). | [`Error`](/docs/reference/api/schemas/#error) |
| `500` | The server failed to handle the request. | [`Error`](/docs/reference/api/schemas/#error) |

## GET /threads/mentionable

List the people who can be mentioned on a target.

Returns the people, other than the caller, who can see the target and whose name or email contains `q`, ordered by name, at most `limit` of them, with `more` true when others match too. Seeing follows the target's folder, so a person without access to it is never listed, and mentioning one answers 422 `invalid_mention`. A person you mention appears in their Inbox as a `mention`. The caller must be able to comment on the target: a viewer gets 403 `forbidden_role`, and a target the caller cannot see answers 404, never 403.

### Parameters

| Name | In | Type | Description |
| --- | --- | --- | --- |
| `target` (required) | query | `string` | The object the comment is on, as `<kind>:<id>` with kind `dashboard`, `annotation`, `observation` or `proposal`. |
| `q` | query | `string` | Text to look for in the name or the email, ignoring case. Empty lists the first people by name. |
| `limit` | query | `integer` | Between 1 and 20. Default `20`. |

### Responses

| Status | Description | Body |
| --- | --- | --- |
| `200` | The people, possibly none. | [`MentionablePeople`](/docs/reference/api/schemas/#mentionablepeople) |
| `400` | The request is malformed or fails validation. | [`Error`](/docs/reference/api/schemas/#error) |
| `401` | Authentication is missing or invalid. | [`Error`](/docs/reference/api/schemas/#error) |
| `403` | The caller is not allowed to perform the request; a role that is too low is code `forbidden_role`. | [`Error`](/docs/reference/api/schemas/#error) |
| `404` | The resource does not exist, or the caller cannot see it; the two are never told apart. | [`Error`](/docs/reference/api/schemas/#error) |
| `422` | `target` is not `<kind>:<id>` (`invalid_target`). | [`Error`](/docs/reference/api/schemas/#error) |
| `500` | The server failed to handle the request. | [`Error`](/docs/reference/api/schemas/#error) |

## POST /threads/{thread_id}/messages

Add a message to a thread.

The path takes the thread's id or the id of any of its messages. A reply never reopens a resolved thread. The body rules, the mention syntax, `to`, `client_id` and the 4000 character limit are those of starting a thread; a run started from a reply is given the thread's earlier messages as context. The reply is recorded as a `thread.replied` activity event, and on a dashboard thread it sends `comment.created` to the dashboard's event stream. `block_id` anchors the reply to one block of the thread's observation, as when starting a thread, and is refused on any other target with 422 `invalid_block`. `reply_to_id` names a message of this thread that the reply answers, and the message then carries it as `reply_to`; any other id answers 422 `invalid_reply_to`. Editing a message changes neither. Writing needs Comment on the thread's target.

### Parameters

| Name | In | Type | Description |
| --- | --- | --- | --- |
| `thread_id` (required) | path | `string` (uuid) | The thread's id, or the id of any of its messages. |

### Request body

`application/json`, required.

| Field | Type | Description |
| --- | --- | --- |
| `body` (required) | `string` |   |
| `block_id` | `string` (uuid) or `null` | The block of the observation the reply is about; absent or null means the whole observation. Observations only. |
| `reply_to_id` | `string` (uuid) or `null` | A message of this thread the reply answers. |
| `to` | `"agent"`, `"everyone"` | Who the message is for; absent decides from the mentions and the thread's agent. |
| `client_id` | `string` (uuid) or `null` | A UUID the caller makes for this message, so a resend returns the message already posted. |

### Responses

| Status | Description | Body |
| --- | --- | --- |
| `200` | The message `client_id` names was already posted; it is returned as it was, with `replayed` true. | [`ThreadSent`](/docs/reference/api/schemas/#threadsent) |
| `201` | The thread and the new message, with `message.run` or `message.run_refusal` when the message asked an agent. | [`ThreadSent`](/docs/reference/api/schemas/#threadsent) |
| `400` | The request is malformed or fails validation. | [`Error`](/docs/reference/api/schemas/#error) |
| `401` | Authentication is missing or invalid. | [`Error`](/docs/reference/api/schemas/#error) |
| `403` | The caller is not allowed to perform the request; a role that is too low is code `forbidden_role`. | [`Error`](/docs/reference/api/schemas/#error) |
| `404` | The resource does not exist, or the caller cannot see it; the two are never told apart. | [`Error`](/docs/reference/api/schemas/#error) |
| `413` | The request body exceeds the size limit. | [`Error`](/docs/reference/api/schemas/#error) |
| `422` | The request is well formed but refused: `invalid_target`, `invalid_body` (empty, too long or with refused characters), `too_many_mentions`, `invalid_panel_id`, `invalid_version` (`version` is out of range or below the version the thread is on), `unknown_panel` (the panel is not in that version's Spec), `unknown_version` (the version does not exist on the dashboard), `invalid_block` (`block_id` is not a block of this observation, or the target is not an observation), `invalid_reply_to` (`reply_to_id` is not a message of this thread), `invalid_mention` (a `grant` mention names a connected agent that is not the caller's own or is revoked or expired, or a `service_account` mention names an account that does not take runs, or does not exist) or `too_many_agents` (a message mentions more than one agent). | [`Error`](/docs/reference/api/schemas/#error) |
| `500` | The server failed to handle the request. | [`Error`](/docs/reference/api/schemas/#error) |

## POST /threads/{thread_id}/resolve

Resolve a thread.

The path takes the thread's id or the id of any of its messages. The body is optional. `version` names the dashboard version that fixed the thread; it must be at least the version the thread is on (422 `invalid_version`) and at most the dashboard's latest version (422 `unknown_version`), and it is refused on a finding or an annotation. Resolving a thread that is already resolved answers 200 with the thread unchanged and records nothing. A real change is recorded as a `thread.resolved` activity event, and on a dashboard thread it sends `comment.updated` to the dashboard's event stream. Needs Comment on the thread's target, and a caller with only Comment resolves only a thread they started: for anyone else it answers 403 `not_starter`, and a caller who can edit resolves any thread.

### Parameters

| Name | In | Type | Description |
| --- | --- | --- | --- |
| `thread_id` (required) | path | `string` (uuid) | The thread's id, or the id of any of its messages. |

### Request body

`application/json`.

| Field | Type | Description |
| --- | --- | --- |
| `version` | `integer` | Between 1 and 2147483647. |

### Responses

| Status | Description | Body |
| --- | --- | --- |
| `200` | The thread with its current status. | [`ThreadEnvelope`](/docs/reference/api/schemas/#threadenvelope) |
| `400` | The request is malformed or fails validation. | [`Error`](/docs/reference/api/schemas/#error) |
| `401` | Authentication is missing or invalid. | [`Error`](/docs/reference/api/schemas/#error) |
| `403` | The caller is not allowed to perform the request; a role that is too low is code `forbidden_role`. | [`Error`](/docs/reference/api/schemas/#error) |
| `404` | The resource does not exist, or the caller cannot see it; the two are never told apart. | [`Error`](/docs/reference/api/schemas/#error) |
| `413` | The request body exceeds the size limit. | [`Error`](/docs/reference/api/schemas/#error) |
| `422` | The request is well formed but refused: `invalid_target`, `invalid_body` (empty, too long or with refused characters), `too_many_mentions`, `invalid_panel_id`, `invalid_version` (`version` is out of range or below the version the thread is on), `unknown_panel` (the panel is not in that version's Spec), `unknown_version` (the version does not exist on the dashboard), `invalid_block` (`block_id` is not a block of this observation, or the target is not an observation), `invalid_reply_to` (`reply_to_id` is not a message of this thread), `invalid_mention` (a `grant` mention names a connected agent that is not the caller's own or is revoked or expired, or a `service_account` mention names an account that does not take runs, or does not exist) or `too_many_agents` (a message mentions more than one agent). | [`Error`](/docs/reference/api/schemas/#error) |
| `500` | The server failed to handle the request. | [`Error`](/docs/reference/api/schemas/#error) |

## POST /threads/{thread_id}/reopen

Reopen a resolved thread.

The path takes the thread's id or the id of any of its messages, and the request has no body. Reopening clears who resolved the thread and the version that fixed it. Reopening a thread that is already open answers 200 with the thread unchanged and records nothing. A real change is recorded as a `thread.reopened` activity event, and on a dashboard thread it sends `comment.updated` to the dashboard's event stream. Needs Comment on the thread's target.

### Parameters

| Name | In | Type | Description |
| --- | --- | --- | --- |
| `thread_id` (required) | path | `string` (uuid) | The thread's id, or the id of any of its messages. |

### Responses

| Status | Description | Body |
| --- | --- | --- |
| `200` | The thread with its current status. | [`ThreadEnvelope`](/docs/reference/api/schemas/#threadenvelope) |
| `400` | The request is malformed or fails validation. | [`Error`](/docs/reference/api/schemas/#error) |
| `401` | Authentication is missing or invalid. | [`Error`](/docs/reference/api/schemas/#error) |
| `403` | The caller is not allowed to perform the request; a role that is too low is code `forbidden_role`. | [`Error`](/docs/reference/api/schemas/#error) |
| `404` | The resource does not exist, or the caller cannot see it; the two are never told apart. | [`Error`](/docs/reference/api/schemas/#error) |
| `500` | The server failed to handle the request. | [`Error`](/docs/reference/api/schemas/#error) |

## POST /threads/{thread_id}/read

Mark a thread read for the caller.

Clears the thread's `unread` for the caller until someone else writes in it again. The web app calls it when a person opens a thread, and a reply by the caller marks the thread read too. Needs View on the thread's target. Only signed-in people may call it: a service-account key gets 403 `forbidden`, and the CLI and MCP have no equivalent because read state belongs to the person.

### Parameters

| Name | In | Type | Description |
| --- | --- | --- | --- |
| `thread_id` (required) | path | `string` (uuid) | The thread's id, or the id of any of its messages. |

### Responses

| Status | Description | Body |
| --- | --- | --- |
| `204` | The thread is read. |   |
| `400` | The request is malformed or fails validation. | [`Error`](/docs/reference/api/schemas/#error) |
| `401` | Authentication is missing or invalid. | [`Error`](/docs/reference/api/schemas/#error) |
| `403` | The caller is not allowed to perform the request; a role that is too low is code `forbidden_role`. | [`Error`](/docs/reference/api/schemas/#error) |
| `404` | The resource does not exist, or the caller cannot see it; the two are never told apart. | [`Error`](/docs/reference/api/schemas/#error) |
| `500` | The server failed to handle the request. | [`Error`](/docs/reference/api/schemas/#error) |

## DELETE /threads/{thread_id}/share

Withdraw a shared answer back to only you.

Undoes `POST /observe/{id}/share` for the caller's own private questions shared in this thread and makes each of those runs a private question again, read only by its requester and Admins. When a share opened the thread, the whole thread is deleted; otherwise only the shared questions and the answers posted under them are, and the thread keeps its other messages. It is allowed only to the person who asked, while every message in the thread is theirs or their run's reply; once someone else wrote in it, the answer stays shared (`others_wrote`). On an observation the run's answer leaves the observation, so it is no longer read or listed through it, but the answer's text that the share wrote onto the page stays there as page content; the observation's editors remove those blocks like any other block. The run can be shared again afterwards, which opens a new thread. Each withdrawn run is recorded as `run.withdraw`, and each deletion, of the thread or of a message, as a `thread.deleted` activity event. Needs View on the thread's target; someone who cannot view it, or who has no answer shared in it, gets 404. It is a delete, so no MCP tool reaches it.

### Parameters

| Name | In | Type | Description |
| --- | --- | --- | --- |
| `thread_id` (required) | path | `string` (uuid) | The thread's id, or the id of any of its messages. |

### Responses

| Status | Description | Body |
| --- | --- | --- |
| `204` | The shares are deleted and their answers are private again. |   |
| `400` | The request is malformed or fails validation. | [`Error`](/docs/reference/api/schemas/#error) |
| `401` | Authentication is missing or invalid. | [`Error`](/docs/reference/api/schemas/#error) |
| `403` | The caller is not allowed to perform the request; a role that is too low is code `forbidden_role`. | [`Error`](/docs/reference/api/schemas/#error) |
| `404` | The resource does not exist, or the caller cannot see it; the two are never told apart. | [`Error`](/docs/reference/api/schemas/#error) |
| `409` | Someone other than the asker wrote in the thread, so the answer stays shared (`others_wrote`). | [`Error`](/docs/reference/api/schemas/#error) |
| `500` | The server failed to handle the request. | [`Error`](/docs/reference/api/schemas/#error) |

## POST /threads/{thread_id}/apply

Ask the agent to make the change an answer in this thread suggests.

An answer to a question about a dashboard may carry `suggested_change`, one sentence on a change that would help; the question's run never changes the dashboard itself. This posts the message "Revise the dashboard: &lt;suggested change>" in the thread as the caller and starts a run that revises the dashboard, with the suggested change as its prompt and the thread's earlier messages as context, so the thread shows who asked for the change. The run is the caller's and goes to the agent that wrote the answer; it saves a new version when the caller can edit the dashboard, and opens a proposal for someone who can edit to merge when the caller can only comment. `finding_id` must be the answer of a run asked in this thread, on a dashboard; any other id answers 404, and an answer with no suggested change answers 422 `no_suggested_change`. A second call for the same answer while its run is queued or running, or after it succeeded, posts nothing and returns the first message and run with `replayed` true; after that run failed or was canceled, a call starts a new one. The run counts against the dashboard's limit of 5 waiting or running revisions (429 `too_many_revisions`), needs the model provider for the built-in agent (503 `agent_unavailable`), and refuses with 409 `assignee_unavailable` when the connected agent that answered is not the caller's live agent or the service account no longer takes runs. It is recorded as `finding.apply` and the message as a `thread.replied` activity event. Needs Comment on the dashboard.

### Parameters

| Name | In | Type | Description |
| --- | --- | --- | --- |
| `thread_id` (required) | path | `string` (uuid) | The thread's id, or the id of any of its messages. |

### Request body

`application/json`, required.

| Field | Type | Description |
| --- | --- | --- |
| `finding_id` (required) | `string` (uuid) | The answer whose suggested change to apply, the `id` of the run's finding. |

### Responses

| Status | Description | Body |
| --- | --- | --- |
| `200` | The answer's change is already being applied or was applied; the first message and its run are returned with `replayed` true. | [`ThreadSent`](/docs/reference/api/schemas/#threadsent) |
| `201` | The thread, the new message and its run in `message.run`. | [`ThreadSent`](/docs/reference/api/schemas/#threadsent) |
| `400` | The request is malformed or fails validation. | [`Error`](/docs/reference/api/schemas/#error) |
| `401` | Authentication is missing or invalid. | [`Error`](/docs/reference/api/schemas/#error) |
| `403` | The caller is not allowed to perform the request; a role that is too low is code `forbidden_role`. | [`Error`](/docs/reference/api/schemas/#error) |
| `404` | The resource does not exist, or the caller cannot see it; the two are never told apart. | [`Error`](/docs/reference/api/schemas/#error) |
| `409` | The connected agent or service account that answered cannot take the run (`assignee_unavailable`), the change is being applied by a run that could not be read back (`already_applied`), or the dashboard is a starter the server keeps current with each release (`provisioned`). Or the run that wrote the answer read data only Admins can query, such as the audit trail, and the dashboard is not in a folder only Admins can read (`restricted_answer`, saying why). | [`Error`](/docs/reference/api/schemas/#error) |
| `413` | The request body exceeds the size limit. | [`Error`](/docs/reference/api/schemas/#error) |
| `422` | The thread is not on a dashboard (`invalid_thread`), or the answer suggests no change (`no_suggested_change`). | [`Error`](/docs/reference/api/schemas/#error) |
| `429` | The dashboard already has its limit of waiting or running revisions (`too_many_revisions`). | [`Error`](/docs/reference/api/schemas/#error) |
| `500` | The server failed to handle the request. | [`Error`](/docs/reference/api/schemas/#error) |
| `503` | The built-in agent answered and the server has no model provider (`agent_unavailable`). | [`Error`](/docs/reference/api/schemas/#error) |

## PATCH /messages/{message_id}

Edit the body of your own message.

Only the message's author may edit it, and only while the author can still comment on the thread's target; another caller who can see the thread gets 403 `not_author`. A reply written by an agent run is never editable, not even by the person who requested the run, and answers 403 `not_author` too. The body rules, the mention syntax and the 4000 character limit are those of starting a thread, and the mentions are recorded again from the new body; an edit never starts a run. Sending the body the message already has answers 200 and changes nothing. A real edit sets `edited_at`, is recorded as a `thread.edited` activity event, and on a dashboard thread sends `comment.updated` naming the edited message to the dashboard's event stream. An edit never records a mention event.

### Parameters

| Name | In | Type | Description |
| --- | --- | --- | --- |
| `message_id` (required) | path | `string` (uuid) |   |

### Request body

`application/json`, required.

| Field | Type | Description |
| --- | --- | --- |
| `body` (required) | `string` |   |

### Responses

| Status | Description | Body |
| --- | --- | --- |
| `200` | The thread and the message with its current body. | [`ThreadMessageEnvelope`](/docs/reference/api/schemas/#threadmessageenvelope) |
| `400` | The request is malformed or fails validation. | [`Error`](/docs/reference/api/schemas/#error) |
| `401` | Authentication is missing or invalid. | [`Error`](/docs/reference/api/schemas/#error) |
| `403` | The caller is not the author (`not_author`), or can no longer comment on the target (`forbidden_role`). | [`Error`](/docs/reference/api/schemas/#error) |
| `404` | The resource does not exist, or the caller cannot see it; the two are never told apart. | [`Error`](/docs/reference/api/schemas/#error) |
| `413` | The request body exceeds the size limit. | [`Error`](/docs/reference/api/schemas/#error) |
| `422` | The request is well formed but refused: `invalid_target`, `invalid_body` (empty, too long or with refused characters), `too_many_mentions`, `invalid_panel_id`, `invalid_version` (`version` is out of range or below the version the thread is on), `unknown_panel` (the panel is not in that version's Spec), `unknown_version` (the version does not exist on the dashboard), `invalid_block` (`block_id` is not a block of this observation, or the target is not an observation), `invalid_reply_to` (`reply_to_id` is not a message of this thread), `invalid_mention` (a `grant` mention names a connected agent that is not the caller's own or is revoked or expired, or a `service_account` mention names an account that does not take runs, or does not exist) or `too_many_agents` (a message mentions more than one agent). | [`Error`](/docs/reference/api/schemas/#error) |
| `500` | The server failed to handle the request. | [`Error`](/docs/reference/api/schemas/#error) |

## DELETE /messages/{message_id}

Delete a message from a thread.

The message's author may delete it while they can still comment on the thread's target, and anyone who manages the target's folder may delete any message, including a reply an agent run wrote. A reply an agent run wrote is never deletable by the person who requested the run unless they manage the folder. Deleting the first message of a thread deletes the whole thread with its replies and mentions, so its author may do that only while nobody else has written in the thread. Everyone else who can see the thread gets 403 `not_author`. The deletion is recorded as a `thread.deleted` activity event naming the message, and on a dashboard thread it sends `comment.updated` naming the thread to the dashboard's event stream. A reply that quoted the message keeps its text and shows no quote. An agent run that was started from the message still finishes, and its reply is dropped when the thread is gone. No MCP tool deletes anything, so an agent cannot call this.

### Parameters

| Name | In | Type | Description |
| --- | --- | --- | --- |
| `message_id` (required) | path | `string` (uuid) |   |

### Responses

| Status | Description | Body |
| --- | --- | --- |
| `204` | The message, or the whole thread when it was the first message, is deleted. |   |
| `400` | The request is malformed or fails validation. | [`Error`](/docs/reference/api/schemas/#error) |
| `401` | Authentication is missing or invalid. | [`Error`](/docs/reference/api/schemas/#error) |
| `403` | The caller may not delete this message (`not_author`), or can no longer comment on the target (`forbidden_role`). | [`Error`](/docs/reference/api/schemas/#error) |
| `404` | The resource does not exist, or the caller cannot see it; the two are never told apart. | [`Error`](/docs/reference/api/schemas/#error) |
| `500` | The server failed to handle the request. | [`Error`](/docs/reference/api/schemas/#error) |

Generated from [`api/openapi.yaml`](https://github.com/slashobserve/slashobserve/blob/c770e5e0/api/openapi.yaml) at `c770e5e0`. [Report a problem](https://github.com/slashobserve/slashobserve/issues/new).
