Use the API when your agent or test harness is not one of the supported agents: create a run, add frames, commands, and artifacts as they happen, then finalize it and share the link. The CLI, hooks, and overlay use these same endpoints.
The base URL is https://api.23step.com. Send Authorization: Bearer st_... on every call. A key in a query string is rejected. Create keys on Account from a signed-in session: runs:write creates and writes runs, runs:read reads manifests/frames and connects to MCP, and ui opens the web viewer and /s/{share_id} routes (via Authorization: Bearer or POST https://app.23step.com/auth/token). Write and ui tokens cannot create or revoke API keys or mint upload tokens. Requests are rate limited per key and per organization, and image uploads have a daily byte allowance; both depend on the plan. Over a limit the API answers 429 with Retry-After.
New runs get your organization's default visibility (set in Settings, private unless an admin changed it). Change it per step in the browser or with PATCH /s/{share_id}. Secrets (API keys, tokens, passwords, cookies, private keys) are always redacted before storage; PII redaction (email addresses across prompts, commands, traces, session titles, notes, and DOM snapshots) is enabled by default and can be toggled on or off per organization in Settings.
Describe one frame (or up to 50 as {"frames":[…]}) and get an upload URL for each PNG.
PUT <upload_url>
none
Upload the PNG. The URL is valid for 15 minutes.
POST /runs/{id}/commands
runs:write or up_
Record one shell command: text, cwd, exit code, timing. Never stdout or stderr.
POST /runs/{id}/artifacts
runs:write
Attach a Markdown document or a PNG the agent produced.
POST /runs/{id}/frames/{seq}/note
runs:write
Add an agent note to a frame ({"text":"…"}).
POST /runs/{id}/heartbeat
runs:write
Mark a long, quiet run as alive.
POST /runs/{id}/upload-token
session (owner)
Mint an up_ token for a subagent that may write only to this run. Write and ui tokens cannot mint tokens.
POST /runs/{id}/finalize
runs:write
Close the run and write its manifest.
POST /runs/{id}/share
runs:write
Get the step link (step_url).
GET /runs/{id}
runs:read
Manifest: frames in seq order, gaps, finalized.
GET /runs/{id}/frames/{seq}
runs:read or ui
Download the stored PNG for one frame.
GET /runs/{id}/feedback
runs:read or runs:write
Review comments left on the step. ?include_session=1 adds the session's other runs.
DELETE /runs/{id}
runs:write (owner)
Delete the run and its images. Returns 204.
Steps (browser session, `ui` key, or unauthenticated when public)https://app.23step.com
Method and path
Purpose
GET /s/{share_id}.json
The step as JSON (schema 23step.run/v4). Public steps need no auth; private/org steps accept a browser session or a ui-scoped API key.
GET /s/{share_id}.md
The step as Markdown, for handing to another AI.
PATCH /s/{share_id}
Owner session or ui key: change visibility (private, squad, team, org, public), discoverability, or retention (retention_mode: default, days, forever, with retention_days). apply_to_session: true updates every run in the session.
POST /s/{share_id}/comments
Viewer in the org (session or ui key): comment on the step ({"text":"…"}). Comments reach a running agent through feedback.
POST /auth/token
Exchange a ui-scoped st_ key ({"token":"st_…"}) for an HttpOnly browser session cookie on https://app.23step.com.
screen_w, screen_h, and scale describe the coordinate space of the frames you will send (scale must be above 0). Everything else is optional. prompt is redacted and capped at 16 KB. session_id chains successive prompts of one conversation; previous_step names an earlier run explicitly; correlation_id puts a parent agent and its subagents in one run. Set join_session: true to attach to a run already open for session_id instead of creating a second one.
Each frame is two requests: a JSON description, then a PUT of the PNG to the upload_url it returns. seq runs from 1 to 5000, orders the timeline, and is the idempotency key: sending the same seq again returns the same object and a fresh URL. Send Content-Type: image/png and x-goog-if-generation-match: 0 on the PUT; a 412 means the image is already stored and counts as success.
Required fields: seq, trigger (click, key, or timer), ts (RFC 3339), x, y, window_title, app. Optional: url, button, key_category (a class such as letter or enter, never the key), description, and dom_snapshot (page text, so an AI can read the frame without the image).
TerminalPOST /runs/{id}/frames + PUT
RUN=6f0c2a7e-5d1b-4c39-9a51-0b7f3f8e2c11
# 1. Describe the frame. The response holds a short-lived upload URL.
UP=$(curl -sS https://api.23step.com/runs/$RUN/frames \
-H "Authorization: Bearer $STEP23_TOKEN" -H "Content-Type: application/json" \
-d '{"seq":1,"trigger":"click","ts":"2026-11-23T10:00:00Z","x":640,"y":360,
"window_title":"Checkout","app":"chrome","url":"https://shop.example/checkout","button":1}' \
| python3 -c 'import json,sys; print(json.load(sys.stdin)["upload_url"])')
# 2. PUT the PNG there. No bearer on this request.
curl -sS -X PUT "$UP" -H "Content-Type: image/png" \
-H "x-goog-if-generation-match: 0" --data-binary @frame-0001.png
Commands go on the same timeline as frames. They are redacted and capped at 8 KB, and limited to 10 per second per key. Artifacts are files the agent produced: kind is markdown (with text, up to 256 KB) or image (with base64 png). Each becomes one or more frames.
A run that stops receiving anything is eventually closed by the server. Send a heartbeat during long quiet stretches. finalize takes an optional body: outcome (such as completed, error, or stopped_by_user), reason, killed, and the same session and git metadata as POST /runs. A run that was never finalized still has a manifest from GET /runs/{id}.
Terminalheartbeat, finalize, share
# Keep a long run from being reaped as idle
curl -sS -X POST https://api.23step.com/runs/$RUN/heartbeat -H "Authorization: Bearer $STEP23_TOKEN"
# Close it
curl -sS https://api.23step.com/runs/$RUN/finalize -H "Authorization: Bearer $STEP23_TOKEN" \
-H "Content-Type: application/json" -d '{"outcome":"completed"}'
# {"ok":true,"frame_count":3,"gaps":[]}
# Get the step link
curl -sS -X POST https://api.23step.com/runs/$RUN/share -H "Authorization: Bearer $STEP23_TOKEN"
# {"share_id":"9b1c...","step_url":"https://app.23step.com/s/9b1c...","visibility":"private",...}
From a signed-in session, mint an up_ token for a subagent instead of handing out your key (write and ui API keys cannot mint new tokens). It lasts one hour by default and at most 24 hours (ttl_seconds, up to 86400) and can only add frames and commands to that one run: it cannot read, delete, mint tokens, or touch another run. Send it as Authorization: Bearer up_.... Mark the subagent's entries with branch and parent_branch so the step draws them as their own lane.
Agents that already emit OpenTelemetry can send it directly: POST https://api.23step.com/v1/traces and POST /v1/logs accept OTLP/HTTP as protobuf (application/x-protobuf) or JSON, optionally gzip-compressed, with the same bearer key. Spans are mapped with the GenAI semantic conventions: gen_ai.conversation.id groups a session, prompts, thoughts, tool calls and results, responses, and token counts (gen_ai.usage.*) become the step's timeline.