---
title: "Actions"
description: "The actions 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.

# Actions

## POST /dashboards/{id}/actions

Run an action that is saved in the dashboard's latest version.

The server builds the request from the saved action, so the caller chooses only the variable values, the time range and the clicked value, never the method, address, headers or body template. `version` must be the dashboard's latest version, or the call answers 409 `stale_version`. `panel`, `element` and `action` (the index in the element's `actions`) locate a canvas action; without `element`, `panel`, `override` and `action` locate a field action: the panel's own `actions`, or those of the override at index `override`. An action that is missing answers 404 `action_not_found`. `inputs` gives a value for each of the action's own `variables` by key, and may name no other key; an action variable that has no input answers 400 `action_invalid`. `variables` may name only variables the version declares, each with at most 100 values of at most 1000 bytes, and every variable the action references needs a value. `__user.login`, `__user.email`, `__user.name` and `__user.id` come from the signed-in person and cannot be supplied. The request is sent only to an https address on the outbound allowlist, to a public address, and a redirect is returned as its own status without being followed. The remote body is read up to 64 KiB and discarded, never returned or logged. The caller needs Edit on the dashboard, and service accounts cannot call this endpoint. A person has at most 2 actions in flight. Every attempt that reaches the network is logged at INFO as `action run` with the person, dashboard, version, panel, element or override when the request has one, action index, method, host, status, outcome and duration, and never with the address, headers, body, variable values or inputs.

### Parameters

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

### Request body

`application/json`, required.

| Field | Type | Description |
| --- | --- | --- |
| `version` (required) | `integer` | Between 1 and 2147483647. |
| `panel` (required) | `string` |   |
| `element` | `string` | The canvas element whose action runs. |
| `override` | `integer` | With no element, the override whose actions hold the action; absent means the panel's own field actions. |
| `action` (required) | `integer` |   |
| `variables` | `object` or `null` |   |
| `from` (required) | `string` (date-time) |   |
| `to` (required) | `string` (date-time) |   |
| `value` | `object` or `null` |   |
| `fields` | `object` or `null` |   |
| `inputs` | `object` or `null` | Values for the action's variables, by key. |

### Responses

| Status | Description | Body |
| --- | --- | --- |
| `200` | The remote server answered; `ok` is true for a 2xx status. | [`ActionResult`](/docs/reference/api/schemas/#actionresult) |
| `400` | The body is malformed, a field is out of range, or `variables` names an undeclared variable, `inputs` names a key the action does not declare, or `element` and `override` are both set (`invalid_request`); or the action cannot be built from the supplied values, for example a header value with a line break, a JSON body that is no longer valid, an address that changed host or a body above 64 KiB (`action_invalid`). | [`Error`](/docs/reference/api/schemas/#error) |
| `401` | Authentication is missing or invalid. | [`Error`](/docs/reference/api/schemas/#error) |
| `403` | The caller is a service account (`forbidden`), has no Edit access to the dashboard (`forbidden_role`), or the action's domain is not on the outbound allowlist (`outbound_domain_not_allowed`, with `host`). | [`ActionError`](/docs/reference/api/schemas/#actionerror) |
| `404` | The dashboard does not exist (`not_found`), or the version has no such panel, element, override or action (`action_not_found`). | [`Error`](/docs/reference/api/schemas/#error) |
| `409` | The dashboard has a newer version than `version` (`stale_version`); reload it before running the action. | [`Error`](/docs/reference/api/schemas/#error) |
| `413` | The request body exceeds the size limit. | [`Error`](/docs/reference/api/schemas/#error) |
| `429` | The caller already has 2 actions in flight (`too_many_actions`). | [`Error`](/docs/reference/api/schemas/#error) |
| `500` | The server failed to handle the request. | [`Error`](/docs/reference/api/schemas/#error) |
| `502` | The request did not complete, because of a connection error, a timeout or a private or reserved address (`action_failed`, with `host`). | [`ActionError`](/docs/reference/api/schemas/#actionerror) |

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