---
title: "Public"
description: "The public 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.

# Public

## GET /dashboards/{id}/public-links

List the public links of a dashboard.

Lists at most 100 links, newest first. Only someone who manages the dashboard's folder may list them; anyone else with access gets 403 `forbidden_role`, and a dashboard in My Dashboards answers 409 `personal_folder`, because it cannot have links. `expired` is true once `expires_at` has passed, and `usable` is false when the link is expired or the dashboard's latest version reads the viewer's identity (`${__user.*}`).

### Parameters

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

### Responses

| Status | Description | Body |
| --- | --- | --- |
| `200` | The links, without their tokens. | `object` |
| `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 dashboard is in My Dashboards (`personal_folder`). | [`Error`](/docs/reference/api/schemas/#error) |
| `500` | The server failed to handle the request. | [`Error`](/docs/reference/api/schemas/#error) |

## POST /dashboards/{id}/public-links

Create a public link that opens the dashboard read-only without sign-in.

Needs Manage on the dashboard's folder, because the link widens access beyond the folder's permission list; service-account keys with that level may call it too. The link always shows the dashboard's latest version. The response carries the token and the link's URL once; the server keeps only the token's SHA-256 and a 12 character prefix, so a lost token cannot be shown again. `frozen` variables always use `selections`; `free` variables let the viewer choose values of query, custom, interval and datasource variables among the options the server computes, starting from `selections`. A `free` link's `selections` are checked against the options the server computes for each variable when the link is created, so a value that is not an option is refused with 422 `selection_not_allowed` instead of producing a link whose panels all fail; a `frozen` link keeps whatever it is given. A dashboard has at most 20 unexpired links; an expired link no longer counts. An optional `label` of up to 80 characters says what the link is for; a longer one or one with a control character is refused with 400 `invalid_request`.

### Parameters

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

### Request body

`application/json`, required.

A [`CreatePublicLinkRequest`](/docs/reference/api/schemas/#createpubliclinkrequest) object.

### Responses

| Status | Description | Body |
| --- | --- | --- |
| `201` | The link is created. | [`CreatedPublicLink`](/docs/reference/api/schemas/#createdpubliclink) |
| `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 dashboard is in My Dashboards (`personal_folder`; move it to a shared folder first) or in a folder only Admins can read (`admins_only_folder`; move it to a folder that is not Only Admins, unless it reads an Admins-only datasource, which the `datasource` field names and which keeps it where it is). | [`Error`](/docs/reference/api/schemas/#error) |
| `413` | The request body exceeds the size limit. | [`Error`](/docs/reference/api/schemas/#error) |
| `422` | The latest version reads the viewer's identity (`user_scoped`), `expires_at` is not in the future (`invalid_expiry`), `selections` names a variable the latest version does not declare (`unknown_variable`), a `free` link's `selections` holds a value that is not one of its variable's options (`selection_not_allowed`), or the dashboard already has 20 unexpired links (`too_many_links`). | [`Error`](/docs/reference/api/schemas/#error) |
| `500` | The server failed to handle the request. | [`Error`](/docs/reference/api/schemas/#error) |
| `502` | A `free` link's selections could not be checked because a variable's options could not be read from its datasource (`variable_options_unavailable`); try again or create a `frozen` link. | [`Error`](/docs/reference/api/schemas/#error) |

## DELETE /dashboards/{id}/public-links/{link_id}

Revoke a public link.

Deletes the link, so its URL stops working at once. Needs Manage on the dashboard's folder, like creating it.

### Parameters

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

### Responses

| Status | Description | Body |
| --- | --- | --- |
| `204` | The link is revoked. |   |
| `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 dashboard or the link does not exist (`not_found`). | [`Error`](/docs/reference/api/schemas/#error) |
| `409` | The dashboard is in My Dashboards (`personal_folder`). | [`Error`](/docs/reference/api/schemas/#error) |
| `500` | The server failed to handle the request. | [`Error`](/docs/reference/api/schemas/#error) |

## GET /public/{token}

Read the dashboard a public link shows.

Needs no session or key: the token in the path is the only credential. Returns the latest version's Spec without query text, tags and links: every panel query's `query` and every variable's `query` are left out, and so are the dashboard's `tags` and `links`. `datasources` lists the uid and type of each datasource the Spec can reach, so the page needs no other call. A token that is malformed, unknown, revoked or expired, or whose dashboard's latest version reads the viewer's identity, answers 404 `not_found`. Opening the link records its last view, at most once a minute.

No authentication.

### Parameters

| Name | In | Type | Description |
| --- | --- | --- | --- |
| `token` (required) | path | `string` | The public link's token, the only credential of this request. |

### Responses

| Status | Description | Body |
| --- | --- | --- |
| `200` | The dashboard to render. | [`PublicDashboard`](/docs/reference/api/schemas/#publicdashboard) |
| `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) |

## GET /public/{token}/panels/{panel_id}/data

Run the saved queries of one panel of a public link's dashboard.

Needs no session or key: the token in the path is the only credential. Behaves like the panel data of a dashboard version, for the link's latest version, with the same parameters, query-text refusal, limits and cache. A `frozen` link ignores every `var-<name>` parameter and uses its stored selections. A `free` link accepts a value for a query, custom, interval or datasource variable only when it is one of the options the server lists for it under the choices of the variables before it, `$__all` when the variable includes All, and answers 400 `selection_not_allowed` otherwise; textbox, adhoc, group by and constant variables always use the stored selections or the dashboard's defaults. Each link may have at most 8 requests in flight.

No authentication.

### Parameters

| Name | In | Type | Description |
| --- | --- | --- | --- |
| `token` (required) | path | `string` | The public link's token, the only credential of this request. |
| `panel_id` (required) | path | `string` |   |
| `from` | query | `string` |   |
| `to` | query | `string` |   |
| `tz` | query | `string` | The browser's IANA time zone, as for panel data. |
| `max_data_points` | query | `integer` | Between 10 and 11000. Default `1000`. |

### Responses

| Status | Description | Body |
| --- | --- | --- |
| `200` | The frames the saved queries returned. | [`PanelData`](/docs/reference/api/schemas/#paneldata) |
| `400` | The request is malformed, a variable selection is invalid, or a free variable value is not one of its options (`selection_not_allowed`). | [`PanelDataError`](/docs/reference/api/schemas/#paneldataerror) |
| `403` | The request carried query text; the code is `query_not_in_spec`. | [`Error`](/docs/reference/api/schemas/#error) |
| `404` | The link does not work (`not_found`), or the dashboard has no such panel (`panel_not_found`). | [`PanelDataError`](/docs/reference/api/schemas/#paneldataerror) |
| `422` | A query or a variable cannot run, as for 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 /public/{token}/variables/{name}/values

List the values of one variable of a public link's dashboard.

Needs no session or key: the token in the path is the only credential. Behaves like the variable values of a dashboard version, for the link's latest version. The `var-<name>` selections of earlier variables follow the link's rule, as for panel data, and a selection for the listed variable or a later one is ignored.

No authentication.

### Parameters

| Name | In | Type | Description |
| --- | --- | --- | --- |
| `token` (required) | path | `string` | The public link's token, the only credential of this request. |
| `name` (required) | path | `string` |   |
| `from` | query | `string` |   |
| `to` | query | `string` |   |
| `tz` | query | `string` | The browser's IANA time zone, as for panel data. |

### Responses

| Status | Description | Body |
| --- | --- | --- |
| `200` | Up to 1000 values; `truncated` is true when there were more. | [`VariableValues`](/docs/reference/api/schemas/#variablevalues) |
| `400` | The request is malformed, or a free variable value is not one of its options (`selection_not_allowed`). | [`PanelDataError`](/docs/reference/api/schemas/#paneldataerror) |
| `403` | The request carried query text; the code is `query_not_in_spec`. | [`Error`](/docs/reference/api/schemas/#error) |
| `404` | The link does not work (`not_found`). | [`PanelDataError`](/docs/reference/api/schemas/#paneldataerror) |
| `422` | The variable's query cannot run, as for variable values. | [`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) |

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