# POST /api/v2/automations/{automation}/actions/check-flow

Check an automation flow without saving it

- MCP id: automations.actions.check-flow
- Scope: api:write:automations
- Scope: api:write:project_automations
- Scope: api:write:customer_automations
- Permission: automations::update
- Needs the automations feature on your organisation
- Rate cost: 1 unit, write bucket. A write costs the same whatever `view` you ask for.
- Cache-Control: private, no-store

Checks a flow exactly the way saving it would, for you and for the owner whose permissions runs use, and saves nothing: no version, and no secret typed into a step.

Send a `definition` in the shape of `POST /api/v2/automations/{automation}/versions`, steps kept as they were included, or leave it out to check the current version. `problems` lists every problem of every step, each with the JSON Pointer a save would refuse it at; `attention` lists steps that may be saved but need another look. Fix every problem, then save. The declared permission is `automations::update`; for a project or customer automation, the `project_automations` or `customer_automations` permission of the same action applies instead.

## Parameters
- automation (integer, path): The Automation's numeric id. Accepts a soft-deleted record.
- view (string, optional): Which field set to render.
- X-Request-Id (header, optional): A correlation id of your own. It is recorded in our logs next to the server's request id but never returned: the response header always carries the server's id. A value that does not match the pattern is discarded silently, never rejected.
- If-Match (header, optional): The ETag a write is conditional on. A stale validator is 412 precondition-failed.
- Idempotency-Key (header, optional): A caller-chosen key that makes this POST safe to retry. Replaying it returns the original response with Idempotency-Replayed: true.

## Request body
- definition (object, optional): The flow to check, as a save takes it. Leave it out to check the current version.
  - nodes (array of any ≤ 100, optional): Required when definition is present.
  - edges (array of object ≤ 300, optional)
- base_version (integer ≥ 0, optional): The version the steps sent as `{key, unchanged: true}` are taken from; the current one when left out.

Unknown keys are refused with `422` validation-failed, naming the key.

## Response 200
- valid (boolean, required): Whether the flow could be saved as it is.
- checked_version (integer or null, required): The version that was checked, when no `definition` was sent; `null` for a sent definition.
- problems (array of object, required): Every problem, of every step. Saving refuses the same ones, as a `422` with the same pointers.
- attention (array of object, required): Steps that may be saved but need another look, such as a step that starts an automation whose inputs changed, or one whose secret the automation does not keep.

## Errors
- 403 forbidden-by-policy | insufficient-permission | insufficient-token-scope: Forbidden.
- 409 idempotency-key-in-flight | idempotency-key-reused: Conflict.
- 412 precondition-failed: Precondition failed.
- 415 unsupported-media-type: Unsupported media type.
- 422 unprocessable-relationship | validation-failed: Unprocessable content.
- 400 idempotency-key-required | invalid-cursor | invalid-query-parameter | malformed-request | unsupported-parameter: Bad request.
- 401 token-expired | unauthenticated: Unauthenticated.
- 404 endpoint-not-found | resource-not-found: Not found.
- 406 not-acceptable: Not acceptable.
- 429 rate-limit-exceeded: Too many requests.
- 500 internal-error: Server error.
- 503 tenant-unavailable: Service unavailable.

## Example
```bash
curl -X POST \
  'https://<your-url>/api/v2/automations/1/actions/check-flow' \
  -H 'Authorization: Bearer <token>' \
  -H 'Accept: application/json' \
  -H 'Content-Type: application/json' \
  -H 'Idempotency-Key: <key>' \
  -d '{}'
```
