---
title: "Observations"
description: "The observations 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.

# Observations

## GET /observations

List the observations in the folders the caller can see, most recently changed first.

Lists the observations of every folder the caller can view, or of one folder with `folder_id`; a folder the caller cannot view gives 404. The items carry no blocks; read one observation for them. `q` keeps the observations whose title contains it, ignoring case, and `created_by=me` keeps those the caller started. `sort` orders by `updated` (the default, newest first), `created` (newest first) or `title` (A to Z), and `order` reverses or sets the direction. Page with `cursor` (the default order only) or with `offset`, which also returns `total`, the number of observations that match the filters, so a client can show page numbers.

### Parameters

| Name | In | Type | Description |
| --- | --- | --- | --- |
| `folder_id` | query | `string` (uuid) |   |
| `state` | query | [`ObservationState`](/docs/reference/api/schemas/#observationstate) |   |
| `q` | query | `string` | Title text to look for, at most 200 characters; `%` and `_` match themselves. |
| `created_by` | query | `"me"` |   |
| `sort` | query | `"updated"`, `"created"`, `"title"` | Default `"updated"`. |
| `order` | query | `"asc"`, `"desc"` | `desc` by default, and `asc` when `sort` is `title`. |
| `limit` | query | `integer` | Between 1 and 100. Default `20`. |
| `cursor` | query | `string` | The `next_cursor` of the previous page. It works only with the default order and not with `offset`. |
| `offset` | query | `integer` | How many matching observations to skip; the response then carries `total`. Between 0 and 100000. |

### Responses

| Status | Description | Body |
| --- | --- | --- |
| `200` | One page of observations. | [`ObservationList`](/docs/reference/api/schemas/#observationlist) |
| `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) |
| `500` | The server failed to handle the request. | [`Error`](/docs/reference/api/schemas/#error) |

## POST /observations

Start an observation, a page of blocks in a folder.

Needs Edit on the folder; without `folder_id` it is filed in the caller's My Dashboards, then General. `first_block` writes a text or panel block in the same transaction. The observation is `open`, has no discussion thread until someone opens one, and is found by search by its title, summary and text blocks.

### Request body

`application/json`, required.

A [`CreateObservationRequest`](/docs/reference/api/schemas/#createobservationrequest) object.

### Responses

| Status | Description | Body |
| --- | --- | --- |
| `201` | The observation. | [`ObservationEnvelope`](/docs/reference/api/schemas/#observationenvelope) |
| `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 folder does not exist or the caller cannot see it. | [`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, with `issues` (empty unless a Spec panel is at fault, with its paths under `/panel`): `invalid_title`, `invalid_summary`, `invalid_range` (both or neither, from before to, at most 400 days), `invalid_block` (a body that is not the block kind's shape, a text body of 0 or over 8000 characters, a `from_block_id` that is not a panel block of the observation, a width that is not `third`, `half`, `two_thirds` or `full`, a height outside 120 to 960, or a layout that names a block twice), `invalid_panel` (the panel fails the Spec or is not a data panel; a text panel says to use a text block), `variable_missing` (the panel's queries or datasource use a variable that `variables` or `variable_values` does not define, and the message names it), `kind_not_addable` (a run block), `body_not_editable` (a snapshot or run block's body), `too_many_blocks` (100), `too_many_panels` (24 panel and snapshot blocks together) or `snapshot_too_large` (the frozen data is over 2 MiB). | [`ValidationError`](/docs/reference/api/schemas/#validationerror) |
| `500` | The server failed to handle the request. | [`Error`](/docs/reference/api/schemas/#error) |

## GET /observations/{id}

Read one observation with its blocks.

Anyone who can view the observation's folder reads the live blocks. A requested block is returned only to its author and to people who can edit the folder, and `position` stays dense in what the caller sees. `allowed_actions` on the observation and on each block say what the caller may do now. An observation the caller cannot see gives 404, never 403.

### Parameters

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

### Responses

| Status | Description | Body |
| --- | --- | --- |
| `200` | The observation, its folder and the caller's permissions. | [`ObservationEnvelope`](/docs/reference/api/schemas/#observationenvelope) |
| `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) |
| `500` | The server failed to handle the request. | [`Error`](/docs/reference/api/schemas/#error) |

## PATCH /observations/{id}

Change an observation's title or time range.

Needs Edit on the folder. Allowed whether the observation is open or resolved. A new title also renames the chat with no dashboard that this observation is the one observation made from, when the caller started that chat, and `chat_rename` says which happened.

### Parameters

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

### Request body

`application/json`, required.

A [`UpdateObservationRequest`](/docs/reference/api/schemas/#updateobservationrequest) object.

### Responses

| Status | Description | Body |
| --- | --- | --- |
| `200` | The observation. | [`ObservationEnvelope`](/docs/reference/api/schemas/#observationenvelope) |
| `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, with `issues` (empty unless a Spec panel is at fault, with its paths under `/panel`): `invalid_title`, `invalid_summary`, `invalid_range` (both or neither, from before to, at most 400 days), `invalid_block` (a body that is not the block kind's shape, a text body of 0 or over 8000 characters, a `from_block_id` that is not a panel block of the observation, a width that is not `third`, `half`, `two_thirds` or `full`, a height outside 120 to 960, or a layout that names a block twice), `invalid_panel` (the panel fails the Spec or is not a data panel; a text panel says to use a text block), `variable_missing` (the panel's queries or datasource use a variable that `variables` or `variable_values` does not define, and the message names it), `kind_not_addable` (a run block), `body_not_editable` (a snapshot or run block's body), `too_many_blocks` (100), `too_many_panels` (24 panel and snapshot blocks together) or `snapshot_too_large` (the frozen data is over 2 MiB). | [`ValidationError`](/docs/reference/api/schemas/#validationerror) |
| `500` | The server failed to handle the request. | [`Error`](/docs/reference/api/schemas/#error) |

## DELETE /observations/{id}

Delete an observation with its blocks, snapshots, RCA revisions, public links and discussion.

Needs Manage on the folder, or Edit on it for the person who started the observation; `allowed_actions` lists `delete` when the caller may. The delete cannot be undone, and an RCA's public links stop working with it. The activity log keeps the observation's events, ending with `observation.deleted`. It is refused with 409 `run_in_progress` while an investigation on the observation is queued or running, because the run would file a new observation when it finished. No MCP tool deletes anything, so an agent cannot call this.

### Parameters

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

### Responses

| Status | Description | Body |
| --- | --- | --- |
| `204` | The observation and everything that belongs to it are 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 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 action is not allowed in the observation's state (`invalid_transition`), the target folder is My Dashboards (`personal_folder`), or an investigation is still running on the observation (`run_in_progress`, on delete). | [`Error`](/docs/reference/api/schemas/#error) or [`InvalidTransition`](/docs/reference/api/schemas/#invalidtransition) |
| `500` | The server failed to handle the request. | [`Error`](/docs/reference/api/schemas/#error) |

## POST /observations/{id}/move

Move an observation to another folder.

Needs Edit on both folders, and a personal folder takes no moves (409 `personal_folder`). Its discussion, its blocks and its past activity move with it; moving to the folder it is in changes nothing.

### Parameters

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

### Request body

`application/json`, required.

A [`MoveObservationRequest`](/docs/reference/api/schemas/#moveobservationrequest) object.

### Responses

| Status | Description | Body |
| --- | --- | --- |
| `200` | The observation in its new folder. | [`ObservationEnvelope`](/docs/reference/api/schemas/#observationenvelope) |
| `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 observation or the target folder does not exist for the caller. | [`Error`](/docs/reference/api/schemas/#error) |
| `409` | The action is not allowed in the observation's state (`invalid_transition`), the target folder is My Dashboards (`personal_folder`), or an investigation is still running on the observation (`run_in_progress`, on delete). Or the content reads a datasource only Admins can query and the folder is not one only Admins can read (`restricted_content`, naming the `datasource`). Or the content holds an answer that read Admin-only data and the folder is not one only Admins can read (`restricted_answer`). Or an RCA of the observation has an unexpired public link and the folder is one only Admins can read (`admins_only_folder`). | [`Error`](/docs/reference/api/schemas/#error) or [`InvalidTransition`](/docs/reference/api/schemas/#invalidtransition) or [`RestrictedContentError`](/docs/reference/api/schemas/#restrictedcontenterror) |
| `413` | The request body exceeds the size limit. | [`Error`](/docs/reference/api/schemas/#error) |
| `500` | The server failed to handle the request. | [`Error`](/docs/reference/api/schemas/#error) |

## POST /observations/{id}/resolve

Close an open observation with a one-line summary.

Needs Edit on the folder. A resolved observation answers 409 `invalid_transition`.

### Parameters

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

### Request body

`application/json`, required.

A [`ResolveObservationRequest`](/docs/reference/api/schemas/#resolveobservationrequest) object.

### Responses

| Status | Description | Body |
| --- | --- | --- |
| `200` | The resolved observation. | [`ObservationEnvelope`](/docs/reference/api/schemas/#observationenvelope) |
| `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 action is not allowed in the observation's state (`invalid_transition`), the target folder is My Dashboards (`personal_folder`), or an investigation is still running on the observation (`run_in_progress`, on delete). | [`Error`](/docs/reference/api/schemas/#error) or [`InvalidTransition`](/docs/reference/api/schemas/#invalidtransition) |
| `413` | The request body exceeds the size limit. | [`Error`](/docs/reference/api/schemas/#error) |
| `422` | The request is well formed but refused, with `issues` (empty unless a Spec panel is at fault, with its paths under `/panel`): `invalid_title`, `invalid_summary`, `invalid_range` (both or neither, from before to, at most 400 days), `invalid_block` (a body that is not the block kind's shape, a text body of 0 or over 8000 characters, a `from_block_id` that is not a panel block of the observation, a width that is not `third`, `half`, `two_thirds` or `full`, a height outside 120 to 960, or a layout that names a block twice), `invalid_panel` (the panel fails the Spec or is not a data panel; a text panel says to use a text block), `variable_missing` (the panel's queries or datasource use a variable that `variables` or `variable_values` does not define, and the message names it), `kind_not_addable` (a run block), `body_not_editable` (a snapshot or run block's body), `too_many_blocks` (100), `too_many_panels` (24 panel and snapshot blocks together) or `snapshot_too_large` (the frozen data is over 2 MiB). | [`ValidationError`](/docs/reference/api/schemas/#validationerror) |
| `500` | The server failed to handle the request. | [`Error`](/docs/reference/api/schemas/#error) |

## POST /observations/{id}/reopen

Reopen a resolved observation.

Needs Edit on the folder. The summary is kept. An open observation answers 409 `invalid_transition`.

### Parameters

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

### Responses

| Status | Description | Body |
| --- | --- | --- |
| `200` | The reopened observation. | [`ObservationEnvelope`](/docs/reference/api/schemas/#observationenvelope) |
| `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 action is not allowed in the observation's state (`invalid_transition`), the target folder is My Dashboards (`personal_folder`), or an investigation is still running on the observation (`run_in_progress`, on delete). | [`Error`](/docs/reference/api/schemas/#error) or [`InvalidTransition`](/docs/reference/api/schemas/#invalidtransition) |
| `500` | The server failed to handle the request. | [`Error`](/docs/reference/api/schemas/#error) |

## POST /observations/{id}/blocks

Add a block to an observation.

With Edit on the folder the block is `live`; with only Comment it is `requested`, and an editor keeps or discards it; with only View the answer is 403. A `snapshot` block names a panel block of the same observation in `from_block_id` and freezes its data now, under the draft query limits and the caller's own view, so `user_scoped` says when the data is one person's. Freezing runs queries, so it can answer 429, 502 and 504 with the codes of panel data. An observation holds at most 100 blocks and 24 panel and snapshot blocks together. A panel block added with a service-account key, as the CLI and scripts do, must run and return data in its range, the check the `add_block` tool runs; a panel that fails it answers 422 `invalid_spec` with `issues` and adds nothing. A person's session is not held to it, because the web app shows an empty result before the person saves.

### Parameters

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

### Request body

`application/json`, required.

A [`AddObservationBlockRequest`](/docs/reference/api/schemas/#addobservationblockrequest) object.

### Responses

| Status | Description | Body |
| --- | --- | --- |
| `201` | The block. | [`BlockEnvelope`](/docs/reference/api/schemas/#blockenvelope) |
| `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 content reads a datasource only Admins can query and the folder is not one only Admins can read (`restricted_content`, naming the `datasource`). | [`RestrictedContentError`](/docs/reference/api/schemas/#restrictedcontenterror) |
| `413` | The request body exceeds the size limit. | [`Error`](/docs/reference/api/schemas/#error) |
| `422` | The refusals of `ObservationInvalid`, or a query of a snapshot's panel cannot run, with the codes of panel data (`query_invalid`, `query_forbidden`, `limit_exceeded`, `unknown_datasource`, `variable_empty`, `expression_error`). | [`ValidationError`](/docs/reference/api/schemas/#validationerror) or [`PanelDataError`](/docs/reference/api/schemas/#paneldataerror) |
| `429` | The caller already has the maximum number of query requests in flight, or the server's shared upstream call slots stayed busy for 5 seconds. | [`Error`](/docs/reference/api/schemas/#error) |
| `500` | The server failed to handle the request. | [`Error`](/docs/reference/api/schemas/#error) |
| `502` | A datasource is unavailable (`datasource_unavailable`). | [`PanelDataError`](/docs/reference/api/schemas/#paneldataerror) |
| `504` | A datasource did not answer within the query timeout (`query_timeout`). | [`PanelDataError`](/docs/reference/api/schemas/#paneldataerror) |

## POST /observations/{id}/blocks/preview

Run an unsaved panel for a panel block of an observation and return its frames.

The draft is the panel an edit of the block `block_id` would store, or a new panel block when `block_id` is absent, and it is checked like a panel block write. An edit keeps the block's variables and range; a new panel block has none of its own and uses the observation's range. Only signed-in users who may add a block, with Edit or Comment on the observation's folder, may call it: a service-account key gets 403 `user_session_required` and uses `query_range` instead, and a Viewer gets 403 `forbidden_role`. The draft's queries run with the agent tools' limits (15 seconds, 200 series, 100,000 points, 1,000 rows), and a datasource only Admins may query answers only in an Admins-only folder, as the block's own data does. Nothing is cached, and the call counts against the caller's 8 in-flight query requests. `from`, `to`, `tz`, `max_data_points` and `variables` behave as the parameters of panel data, and the response has the shape of panel data, with `meta.cached` always false.

### Parameters

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

### Request body

`application/json`, required.

| Field | Type | Description |
| --- | --- | --- |
| `block_id` | `string` (uuid) | The panel block being edited; absent for a new panel block. |
| `panel` (required) | `object` | The draft panel, in the Spec's panel shape. |
| `from` | `string` |   |
| `to` | `string` |   |
| `tz` | `string` |   |
| `max_data_points` | `integer` | Between 10 and 11000. Default `1000`. |
| `variables` | `object` |   |

### Responses

| Status | Description | Body |
| --- | --- | --- |
| `200` | The frames the draft's queries returned. | [`PanelData`](/docs/reference/api/schemas/#paneldata) |
| `400` | The request is malformed or fails validation. | [`PanelDataError`](/docs/reference/api/schemas/#paneldataerror) |
| `401` | Authentication is missing or invalid. | [`Error`](/docs/reference/api/schemas/#error) |
| `403` | The caller is not a signed-in user (`user_session_required`), or may not add a block to the observation (`forbidden_role`). | [`Error`](/docs/reference/api/schemas/#error) |
| `404` | There is no such observation, or no such panel block in it, for the caller (`not_found`). | [`PanelDataError`](/docs/reference/api/schemas/#paneldataerror) |
| `413` | The request body exceeds the size limit. | [`Error`](/docs/reference/api/schemas/#error) |
| `422` | The draft is not a valid panel block (`invalid_panel`, `invalid_block` or `variable_missing`, with `issues`), or a query or a variable cannot run, with the codes of panel data. | [`ValidationError`](/docs/reference/api/schemas/#validationerror) or [`PanelDataError`](/docs/reference/api/schemas/#paneldataerror) |
| `429` | The caller already has the maximum number of query requests in flight, or the server's shared upstream call slots stayed busy for 5 seconds. | [`Error`](/docs/reference/api/schemas/#error) |
| `500` | The server failed to handle the request. | [`PanelDataError`](/docs/reference/api/schemas/#paneldataerror) |
| `502` | A datasource is unavailable. | [`PanelDataError`](/docs/reference/api/schemas/#paneldataerror) |
| `504` | A datasource did not answer within the draft's 15 second query timeout, or the request did not finish within 20 seconds. | [`PanelDataError`](/docs/reference/api/schemas/#paneldataerror) |

## PUT /observations/{id}/layout

Arrange the blocks of an observation.

Sets the order of the page and, for each block that names one, its `width` and `height`; a field a block leaves out keeps its value, and a `height` of `null` returns it to the default. A number for a `height` on a text block is refused with 422 `invalid_block`, because only panel and snapshot blocks take a height. Needs Edit on the folder; a caller who can only comment answers 403. It never reads or changes a block's `version` or `updated_at`, so an arrangement cannot make someone's edit of a block's text stale, and the last arrangement to arrive wins. An id that names no block of this observation, or one the caller cannot see, refuses the whole request with 422 `invalid_block` and the id, and nothing changes; a block the list leaves out stays right after the block it followed, so a block someone added meanwhile keeps its place. The answer is the page as stored, and an arrangement that changes nothing records nothing.

### Parameters

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

### Request body

`application/json`, required.

A [`ObservationLayoutRequest`](/docs/reference/api/schemas/#observationlayoutrequest) object.

### Responses

| Status | Description | Body |
| --- | --- | --- |
| `200` | The blocks the caller sees, in order. | [`ObservationLayout`](/docs/reference/api/schemas/#observationlayout) |
| `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, with `issues` (empty unless a Spec panel is at fault, with its paths under `/panel`): `invalid_title`, `invalid_summary`, `invalid_range` (both or neither, from before to, at most 400 days), `invalid_block` (a body that is not the block kind's shape, a text body of 0 or over 8000 characters, a `from_block_id` that is not a panel block of the observation, a width that is not `third`, `half`, `two_thirds` or `full`, a height outside 120 to 960, or a layout that names a block twice), `invalid_panel` (the panel fails the Spec or is not a data panel; a text panel says to use a text block), `variable_missing` (the panel's queries or datasource use a variable that `variables` or `variable_values` does not define, and the message names it), `kind_not_addable` (a run block), `body_not_editable` (a snapshot or run block's body), `too_many_blocks` (100), `too_many_panels` (24 panel and snapshot blocks together) or `snapshot_too_large` (the frozen data is over 2 MiB). | [`ValidationError`](/docs/reference/api/schemas/#validationerror) |
| `500` | The server failed to handle the request. | [`Error`](/docs/reference/api/schemas/#error) |

## PATCH /blocks/{id}

Change a block's body, width, height or position, or let a panel follow the page's range.

Needs Edit on the folder and the block's current `version`; another version answers 409 `version_conflict` with the current block. Every change here raises the version, a width, height or position change included, so a person editing the block's text meets `version_conflict` when someone resizes it; arrange a page with `PUT /observations/{id}/layout` instead, which leaves versions alone. A `height` of `null` returns the block to its default height, and a number for a text block is refused with `invalid_block`, because only panel and snapshot blocks take a height. Only the body of a text or panel block can change (`body_not_editable`). `follow_page: true` clears a panel block's own `from` and `to`, so it shows the observation's range again; it goes without a `body` and only on a panel block (`invalid_block`). A new panel body sent with a service-account key gets the check that panel blocks get when they are added, and a failure answers 422 `invalid_spec` with `issues`. A `position` moves the block and shifts the blocks between, which keep their versions.

### Parameters

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

### Request body

`application/json`, required.

A [`UpdateObservationBlockRequest`](/docs/reference/api/schemas/#updateobservationblockrequest) object.

### Responses

| Status | Description | Body |
| --- | --- | --- |
| `200` | The updated block. | [`BlockEnvelope`](/docs/reference/api/schemas/#blockenvelope) |
| `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 block's version is not the one named (`version_conflict`, with the current block), or the action is not allowed in the block's state (`invalid_transition`). Or the content reads a datasource only Admins can query and the folder is not one only Admins can read (`restricted_content`, naming the `datasource`). | [`BlockConflict`](/docs/reference/api/schemas/#blockconflict) or [`InvalidTransition`](/docs/reference/api/schemas/#invalidtransition) or [`RestrictedContentError`](/docs/reference/api/schemas/#restrictedcontenterror) |
| `413` | The request body exceeds the size limit. | [`Error`](/docs/reference/api/schemas/#error) |
| `422` | The request is well formed but refused, with `issues` (empty unless a Spec panel is at fault, with its paths under `/panel`): `invalid_title`, `invalid_summary`, `invalid_range` (both or neither, from before to, at most 400 days), `invalid_block` (a body that is not the block kind's shape, a text body of 0 or over 8000 characters, a `from_block_id` that is not a panel block of the observation, a width that is not `third`, `half`, `two_thirds` or `full`, a height outside 120 to 960, or a layout that names a block twice), `invalid_panel` (the panel fails the Spec or is not a data panel; a text panel says to use a text block), `variable_missing` (the panel's queries or datasource use a variable that `variables` or `variable_values` does not define, and the message names it), `kind_not_addable` (a run block), `body_not_editable` (a snapshot or run block's body), `too_many_blocks` (100), `too_many_panels` (24 panel and snapshot blocks together) or `snapshot_too_large` (the frozen data is over 2 MiB). | [`ValidationError`](/docs/reference/api/schemas/#validationerror) |
| `500` | The server failed to handle the request. | [`Error`](/docs/reference/api/schemas/#error) |

## DELETE /blocks/{id}

Remove a live block.

Needs Edit on the folder and the block's current `version`, as a query parameter. A requested block is kept or discarded instead (409 `invalid_transition`). The blocks after it close the gap.

### Parameters

| Name | In | Type | Description |
| --- | --- | --- | --- |
| `id` (required) | path | `string` (uuid) |   |
| `version` (required) | query | `integer` |   |

### Responses

| Status | Description | Body |
| --- | --- | --- |
| `204` | The block is removed. |   |
| `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 block's version is not the one named (`version_conflict`, with the current block), or the action is not allowed in the block's state (`invalid_transition`). | [`BlockConflict`](/docs/reference/api/schemas/#blockconflict) or [`InvalidTransition`](/docs/reference/api/schemas/#invalidtransition) |
| `500` | The server failed to handle the request. | [`Error`](/docs/reference/api/schemas/#error) |

## POST /observations/{id}/pin

Pin an observation to a dashboard as an annotation.

Anyone who can read the observation may call it, and the caller needs Edit on the dashboard. The annotation's text is the observation's title and a link to it, tagged `finding`, at the end of the observation's range, or now when it has none. Without `dashboard_id` it pins to the dashboard the observation's run was about (`dashboard_id` on the observation); an observation with none answers 409 `observation_has_no_dashboard`. Pinning an observation to a dashboard it is already pinned to answers 200 with the same annotation. An observation that holds an answer that read Admin-only data is pinned only onto a dashboard in a folder only Admins can read, and the annotation then holds that answer.

### Parameters

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

### Request body

`application/json`, required.

A [`PinObservationRequest`](/docs/reference/api/schemas/#pinobservationrequest) object.

### Responses

| Status | Description | Body |
| --- | --- | --- |
| `200` | The observation was already pinned to that dashboard; this is its annotation. | [`ObservationPin`](/docs/reference/api/schemas/#observationpin) |
| `201` | The annotation made for the observation. | [`ObservationPin`](/docs/reference/api/schemas/#observationpin) |
| `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 observation names no dashboard to pin to and none was given (`observation_has_no_dashboard`). Or the content reads a datasource only Admins can query and the folder is not one only Admins can read (`restricted_content`, naming the `datasource`). Or the observation holds an answer that read Admin-only data and the dashboard is not in a folder only Admins can read (`restricted_answer`). | [`Error`](/docs/reference/api/schemas/#error) or [`RestrictedContentError`](/docs/reference/api/schemas/#restrictedcontenterror) |
| `500` | The server failed to handle the request. | [`Error`](/docs/reference/api/schemas/#error) |

## POST /observations/{id}/dashboard

Make a dashboard from the live panel blocks of an observation.

Anyone who can read the observation may call it; the dashboard lands in the caller's My Dashboards and every query is run again before it is saved. The dashboard holds the live panel blocks in order, with the variables each block carries, over the observation's range or, when it has none, the range of the first panel. Making a dashboard again from the same observation answers 200 with the one the caller made first, unless the body sets `new`. The caller's own chat that wrote the observation becomes a chat about the new dashboard, when it is about no dashboard or observation yet; it stays private to the caller, and a failure to attach it does not fail the call. An observation without a live panel block answers 409 `observation_has_no_panels`.

### Parameters

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

### Request body

`application/json`, required.

A [`MakeDashboardRequest`](/docs/reference/api/schemas/#makedashboardrequest) object.

### Responses

| Status | Description | Body |
| --- | --- | --- |
| `200` | The dashboard the caller already made from this observation, with its latest version. | [`DashboardWithVersion`](/docs/reference/api/schemas/#dashboardwithversion) |
| `201` | The new dashboard and its first version. | [`DashboardWithVersion`](/docs/reference/api/schemas/#dashboardwithversion) |
| `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 observation has no live panel block (`observation_has_no_panels`). Or the content reads a datasource only Admins can query and the folder is not one only Admins can read (`restricted_content`, naming the `datasource`). Or the observation holds an answer that read Admin-only data, which a dashboard in My Dashboards would carry out of folders only Admins can read (`restricted_answer`). | [`Error`](/docs/reference/api/schemas/#error) or [`RestrictedContentError`](/docs/reference/api/schemas/#restrictedcontenterror) |
| `422` | The Spec fails validation or one of its queries fails; every problem is listed in `issues`. | [`ValidationError`](/docs/reference/api/schemas/#validationerror) |
| `500` | The server failed to handle the request. | [`Error`](/docs/reference/api/schemas/#error) |

## POST /blocks/{id}/dashboard

Make a dashboard from one panel block.

Works as making a dashboard from the observation, with only this block; a block that is not a live panel block the caller can see answers 404. The same caller making a dashboard again from the same block gets the first one back, unless the body sets `new`. The chat attached is the chat of the run that wrote the block, or of the run that wrote the observation when the block has none, on the same terms.

### Parameters

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

### Request body

`application/json`, required.

A [`MakeDashboardRequest`](/docs/reference/api/schemas/#makedashboardrequest) object.

### Responses

| Status | Description | Body |
| --- | --- | --- |
| `200` | The dashboard the caller already made from this block, with its latest version. | [`DashboardWithVersion`](/docs/reference/api/schemas/#dashboardwithversion) |
| `201` | The new dashboard and its first version. | [`DashboardWithVersion`](/docs/reference/api/schemas/#dashboardwithversion) |
| `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 content reads a datasource only Admins can query and the folder is not one only Admins can read (`restricted_content`, naming the `datasource`). Or the observation holds an answer that read Admin-only data, which a dashboard in My Dashboards would carry out of folders only Admins can read (`restricted_answer`). | [`Error`](/docs/reference/api/schemas/#error) or [`RestrictedContentError`](/docs/reference/api/schemas/#restrictedcontenterror) |
| `422` | The Spec fails validation or one of its queries fails; every problem is listed in `issues`. | [`ValidationError`](/docs/reference/api/schemas/#validationerror) |
| `500` | The server failed to handle the request. | [`Error`](/docs/reference/api/schemas/#error) |

## POST /blocks/{id}/keep

Keep a requested block, which makes it live.

Needs Edit on the folder and the block's current `version`. A live block answers 409 `invalid_transition`.

### Parameters

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

### Request body

`application/json`, required.

A [`KeepObservationBlockRequest`](/docs/reference/api/schemas/#keepobservationblockrequest) object.

### Responses

| Status | Description | Body |
| --- | --- | --- |
| `200` | The live block. | [`BlockEnvelope`](/docs/reference/api/schemas/#blockenvelope) |
| `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 block's version is not the one named (`version_conflict`, with the current block), or the action is not allowed in the block's state (`invalid_transition`). | [`BlockConflict`](/docs/reference/api/schemas/#blockconflict) or [`InvalidTransition`](/docs/reference/api/schemas/#invalidtransition) |
| `413` | The request body exceeds the size limit. | [`Error`](/docs/reference/api/schemas/#error) |
| `500` | The server failed to handle the request. | [`Error`](/docs/reference/api/schemas/#error) |

## POST /blocks/{id}/discard

Discard a requested block.

Needs Edit on the folder, or being the person or key that asked for the block. A live block answers 409 `invalid_transition`.

### Parameters

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

### Responses

| Status | Description | Body |
| --- | --- | --- |
| `204` | The block is gone. |   |
| `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 block's version is not the one named (`version_conflict`, with the current block), or the action is not allowed in the block's state (`invalid_transition`). | [`BlockConflict`](/docs/reference/api/schemas/#blockconflict) or [`InvalidTransition`](/docs/reference/api/schemas/#invalidtransition) |
| `500` | The server failed to handle the request. | [`Error`](/docs/reference/api/schemas/#error) |

## GET /blocks/{id}/data

Run the query of a panel block and return its frames.

Runs a panel block's stored queries under the draft query limits, never cached. Only browser sessions may call it; a key gets 403 `user_session_required`. Anyone who can view the observation's folder may call it, and `from` and `to` default to the block's range, then the observation's, then the last hour. The response has the shape of panel data.

### Parameters

| Name | In | Type | Description |
| --- | --- | --- | --- |
| `id` (required) | path | `string` (uuid) |   |
| `from` | query | `string` |   |
| `to` | query | `string` |   |
| `tz` | query | `string` |   |
| `max_data_points` | query | `integer` | Between 10 and 11000. Default `1000`. |

### Responses

| Status | Description | Body |
| --- | --- | --- |
| `200` | The frames the panel block's queries returned. | [`PanelData`](/docs/reference/api/schemas/#paneldata) |
| `400` | The request is malformed or fails validation. | [`PanelDataError`](/docs/reference/api/schemas/#paneldataerror) |
| `401` | Authentication is missing or invalid. | [`Error`](/docs/reference/api/schemas/#error) |
| `403` | The request carried query text (`query_not_in_spec`), or the caller is not a signed-in user (`user_session_required`). | [`Error`](/docs/reference/api/schemas/#error) |
| `404` | There is no such panel block for the caller (`not_found`). | [`PanelDataError`](/docs/reference/api/schemas/#paneldataerror) |
| `422` | A query or a variable cannot run, with the codes of panel data. | [`PanelDataError`](/docs/reference/api/schemas/#paneldataerror) |
| `429` | The caller already has the maximum number of query requests in flight, or the server's shared upstream call slots stayed busy for 5 seconds. | [`Error`](/docs/reference/api/schemas/#error) |
| `500` | The server failed to handle the request. | [`PanelDataError`](/docs/reference/api/schemas/#paneldataerror) |
| `502` | A datasource is unavailable. | [`PanelDataError`](/docs/reference/api/schemas/#paneldataerror) |
| `504` | A datasource did not answer within the query timeout. | [`PanelDataError`](/docs/reference/api/schemas/#paneldataerror) |

## GET /snapshots/{id}

Read the frozen data of a snapshot block.

Anyone who can view the observation's folder may read it. `data` is exactly what the panel data route returned when the snapshot was taken, and `query` the frozen panel's queries, which stay inside the workspace.

### Parameters

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

### Responses

| Status | Description | Body |
| --- | --- | --- |
| `200` | The snapshot. | [`Snapshot`](/docs/reference/api/schemas/#snapshot) |
| `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) |
| `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).
