Skip to content

API and personal access tokens

Reflow executes flows on your device or in CI through reflow plan and reflow apply (or MCP manage_execution). The hosted HTTP API at https://app.reflow.io/v1 provides programmatic access to read runs, stream step events, fetch signed screenshot URLs, manage knowledge-base flow content, and mint personal access tokens.

SurfaceAuthenticationExecutes flows?Primary use case
HTTP API (https://app.reflow.io/v1)Personal access token (rfl_pat_* bearer token; read, run, or admin scopes)NoCI scripts, run polling, signed screenshot retrieval, KB flow reads/writes, PAT provisioning
Local CLI & stdio MCP (reflow mcp, reflow mcp call)Saved reflow login profile (or PAT in CI)YesAuthoring, local/CI execution, --hold live debugging, coverage queries, Review Apps
Hosted HTTP MCP (https://mcp.reflow.io/mcp)OAuth 2.1 browser consentNoRead runs/evidence, inspect flows, manage collections/preferences from remote MCP hosts
PR reviews & CI reporting (reflow pr review, reflow ci report --post)GitHub App (reflow-code-review[bot]) + CLI profile/PATCI runs via CLIInline PR diff comments, PR review summaries, and CI run reports (PR review)

For shell automation that needs the full local MCP toolset without an agent host, use reflow mcp tools and reflow mcp call <tool> '<json>' (MCP reference).

Open Settings → API tokens in the Reflow dashboard (https://app.reflow.io) and grant only the required scopes (read, run, or admin). Tokens begin with rfl_pat_ and the plaintext value is shown once at creation. (App access and test execution require an approved team during closed beta.)

Send the token as a bearer header against the API base URL (replace https://app.reflow.io/v1 only if using a custom deployment):

Terminal window
export REFLOW_API=https://app.reflow.io/v1
export REFLOW_TOKEN=rfl_pat_...

Every authenticated request sends:

Authorization: Bearer <token>

An existing admin token can also mint scoped tokens programmatically:

Terminal window
curl --fail-with-body -X POST "$REFLOW_API/tokens" \
-H "Authorization: Bearer $REFLOW_TOKEN" \
-H "Content-Type: application/json" \
--data '{"name":"CI","scopes":["run"]}'

Store the returned plaintext token immediately—it cannot be retrieved again.

reflow apply prints the ID of each run it creates, and --result-file records them as JSON. Poll a run record, long-poll step events, or fetch a short-lived step screenshot URL:

Terminal window
curl --fail-with-body \
-H "Authorization: Bearer $REFLOW_TOKEN" \
"$REFLOW_API/runs/$RUN_ID"
curl --fail-with-body \
-H "Authorization: Bearer $REFLOW_TOKEN" \
"$REFLOW_API/runs/$RUN_ID/events?wait=20"
curl --fail-with-body \
-H "Authorization: Bearer $REFLOW_TOKEN" \
"$REFLOW_API/runs/$RUN_ID/screenshot?step_idx=0"

GET /v1/runs/{run_id} is safe while a run is active. The events endpoint long-polls for up to 20 seconds and returns current status alongside new step events.

MethodPathPurpose
GET/v1/runsList recent runs, newest first.
GET/v1/runs/{run_id}Read run status and step evidence.
GET/v1/runs/{run_id}/eventsLong-poll the run timeline (?wait=20).
GET/v1/runs/{run_id}/screenshotFetch a short-lived step screenshot URL (?step_idx=N).
GET/v1/flowsList flows with version pointers (tags: latest, main) and flow-file tags (flow_tags).
POST/v1/flowsCreate a knowledge-base flow with current collection and policy storage fields.
PUT/v1/flows/{slug}/contentSave full knowledge-base source with optimistic concurrency fields.
POST/v1/tokensMint a PAT with name and scopes (admin scope required).

POST /v1/runs returns 410 Gone and points to reflow plan and reflow apply.

For interactive authoring, prefer manage_flows, reflow flows create, or reflow flows save after refreshing get_reflow_context. When calling POST /v1/flows or PUT /v1/flows/{slug}/content directly:

OperationRequired fieldsConflict / authority rule
Create KB flow (POST /v1/flows, storage-enabled team)Current storage.collectionId, storage.policyRevision, storage.sourceKind: "knowledge_base"Read live values from get_reflow_context; never guess policy revisions. Storage-disabled teams may omit storage.
Update collection-scoped KB flow (PUT /v1/flows/{slug}/content)Freshly read source_revision and exact base_version_idOn 409 Conflict, re-read the flow, rebase your edits, and retry. Unscoped saves accept optional concurrency guards.
Repository-owned flowsN/A over HTTPMust be created and saved on the connected author device with the Git checkout.

For CI execution, PR progress comments, and automated reporting, see GitHub Actions and PR review.