API reference
Call the shiftlabs API from a script, CI or an AI agent with an API key.
API
All routes are under https://api.shiftlabs.org/v1 and act on your workspace.
The credential determines the workspace. Another workspace's trigger or run returns 404. Send an API key as Authorization: Bearer slk_…. A browser sends a chat token instead, slc_…, which reaches one agent's conversations as one person. Bodies are JSON (16 KiB at most, except a deploy, up to 512 KiB of source or 1 MiB of files, and a run's payload), and errors are {"error": "…"} with a 4xx or 5xx status. A failure on our side returns 500 {"error": "internal error"}, without details.
A re-run starts a new run with the original payload and counts against your run quotas. If the payload is older than 14 days, the re-run returns 410. A run is kept for 35 days after it ends. After that its routes return 404. When a quota is full, the API returns {"error": "quota exceeded", "limit", "max"} with 429 for runs, and 403 for counts such as workflows, triggers, secrets, connections, agents and API keys.
To retry a run start or an agent message safely, send an Idempotency-Key header: any unique string of 1 to 255 visible ASCII characters, such as a UUID. Any other key returns 400. A repeat with the same key within 24 hours returns the first answer again, with Idempotent-Replayed: true.
A repeated run start starts nothing and returns the first run's 202 {"runId", "versionHash"}. It does not count against your run quotas, even when they are full. The same key on another workflow returns 409. The shiftlabs run command sends a key with each run and retries with it.
A repeated POST /v1/agents/:agent/conversations or …/messages sends the agent nothing and returns the first 202 {"conversation", "status"}. The same key with another agent, conversation, person or text returns 409. shiftlabs/client and Python's shiftlabs.client send a key with each message, and send it again after a network error, or a 503 with Retry-After of 5 seconds or less.
| Route | Method | Minimum role |
|---|---|---|
/v1/me principal, workspace, limits, and entitlements: {paid, sso, byok, modelCatalog, seats}, what the workspace's plan includes; seats is null for no cap | GET | viewer |
/v1/me/sessions/revoke signs you out of every other dashboard session, in any workspace; {ended}; signed-in members only | POST | viewer |
/v1/workspace {"name"}, 1 to 64 characters; audited | PATCH | admin |
/v1/workspace/agents {"enabled"}: turns agents on or off; {on, chosen, override} | PUT | admin |
/v1/workspace/approvals {required, choices, slackAvailable, slack, link}; PUT {"required"}: 1 or 2, the approvals every request needs at least (two approvers; 2 needs two members who can approve); audited | GET · PUT | viewer · admin |
/v1/workspace/approvals/slack {url} to connect Slack from the dashboard; Slack sends the browser back to Settings, which finishes with {code, state} | POST | admin |
/v1/workspace/approvals/slack/channels {channels}, leaving out those another workspace on the same Slack workspace uses; PUT {"channel"}: where requests go in Slack; DELETE disconnects Slack | GET · PUT · DELETE | admin |
/v1/workspace/approvals/slack/link {url} to link your Slack account from the dashboard (Sign in with Slack); Slack sends the browser back to Settings, which finishes with {code, state}; DELETE unlinks it | POST · DELETE | approver |
/v1/approval-rules the approval rules in the order they are tried; POST {name, enabled?, match?, set} adds one, last, at most 50 a workspace (409); audited | GET · POST | admin |
/v1/approval-rules/:id PUT the whole rule, a version up; requests made under it keep it as it was; audited | PUT · DELETE | admin |
/v1/approval-rules/order {"ids"}: every rule's id once, in the order to try them; audited | PUT | admin |
/v1/usage runsLast24h, activeRuns, versionsLast24h, egressLast24h, stepsLast24h, cpuSecondsLast24h; counts: workflows, triggers, agents, approvalsPending, secrets, connections, tcpTargets; modelTokensLast24h, modelCostMonthUsd (this UTC month); state ({workflow, keys, bytes} for each workflow holding ctx.state) and stateBytes (their total); limits | GET | viewer |
/v1/usage/export NDJSON: {hour, runs, steps, cpuSeconds, outbound} for each UTC hour of the last 40 days with any, oldest first, as the meters bill them | GET | viewer |
/v1/billing {available, plan, paid, status, periodStart, periodEnd, cancelAtPeriodEnd, graceUntil, hasBillingAccount, spendingLimitCents, spendingLimitMaxCents, capped, cappedBy, usage}; paid: false on Free; spendingLimitMaxCents: the most the spending limit can be set to now; see Plans and billing | GET | viewer |
/v1/billing {"spendingLimitCents"}, 0 to 1,000,000: the Pro spending limit; 409 above spendingLimitMaxCents, 5,000 until the subscription's first monthly renewal | PATCH | admin |
/v1/billing/checkout · /v1/billing/portal {url} of a checkout page for Pro, or of the billing portal; checkout takes an optional {"poNumber"}, the PO number on every invoice; 503 until upgrades open | POST | admin |
/v1/billing/invoice {poNumber, taxIds}; PATCH {"poNumber"}, up to 140 characters, or null to remove it: the PO number and tax ID on invoices | GET · PATCH | admin |
/v1/workflows each with payload_schema, the current version's payload schema or null, search, its search keys or null, paused_at and paused_by, null unless it is paused, and held_runs, its runs a pause holds now | GET | viewer |
/v1/workflows/:workflow body: the source, or {"entry", "files"} as JSON for a workflow of several files or npm packages; ?stage=1 stores the version for a release without making it current; ?profile= gives the version a default runner profile, name or name@version, and an empty one gives none; without ?profile, the version keeps the current version's default | PUT | developer |
/v1/workflows/:workflow/validate body and ?profile: as for PUT, without ?stage; checks the code as a deploy does and deploys nothing: {ok, loadChecked, errors, warnings} | POST | developer |
/v1/workflows/:workflow moves it to the trash for 7 days with its versions, state, vars and connection links, and revokes its triggers; runs stay; {deleted, revokedTriggers, droppedVars, unlinkedConnections, purgeAt} | DELETE | developer |
/v1/workflows/:workflow/versions | GET | viewer |
/v1/workflows/:workflow/versions/:hash/source {hash, language, source}, and entry and files for a workflow of several files; audited | GET | developer |
/v1/workflows/:workflow/runs body: the payload, read like a webhook's, 1 MiB at most, also as JSON; 400 when it fails the payload schema or has no key; a key with an open run starts nothing: 200 {runId, versionHash, started: false} names that run | POST | developer |
/v1/workflows/:workflow/open-run?key= a keyed workflow's open run for the key: {workflow, key, runId, openedAt}; 404 when the key has none, 409 when the workflow has no key | GET | viewer |
/v1/workflows/:workflow/events/:name?key= body: the event's data, read like a webhook's, 256 KiB at most; sends it to the key: the key's open run gets it at its step.waitForEvent(name), or the data opens a run as its payload, which then gets it too; the key is ?key=, else the data's at the key path; 202 {runId, event, key, started}; 400 when the data has no key and opens a run, or names another key than ?key=; 409 when the workflow has no key; 429 while the run's events wait untaken | POST | developer |
/v1/workflows/:workflow/rollback {"hash"}: new runs use that version | POST | developer |
/v1/workflows/:workflow/pause pauses the workflow: new runs are held, schedule ticks skipped, runs already started go on; {workflow, paused, pausedAt, pausedBy, heldRuns}; audited | POST | developer |
/v1/workflows/:workflow/resume {"drop"?}: the held runs start in the order they arrived, or with drop end cancelled, unbilled; {workflow, paused, resumed, dropped}; audited | POST | developer |
/v1/workflows/:workflow/draft {"prompt", "files", "entry"?}: an AI draft of the workflow's files from your request (1–4,000 characters) and its files now, [] for a new one, 64,512 bytes together at most; 202 {draft, status}, or its stream with Accept: text/event-stream; takes an Idempotency-Key; counts toward the model allowance, not runsPerDay | POST | developer |
/v1/workflows/:workflow/draft/:id · /stream your draft of this workflow: {draft, status} while working, then done with {files, notes, model, tokens} or failed with {error, retry}; /stream: the same Server-Sent Events as a conversation's, redacted; 404 for anyone else or another workflow | GET | developer |
/v1/releases {"workflows": {"name": "versionHash"}, "agents": {"name": definition}, "schedules"?: {"name": schedule}}: up to 50 staged workflow versions, any agents and every schedule, made current together | GET · POST | viewer · developer |
/v1/releases/:seq | GET | viewer |
/v1/releases/:seq/rollback that release's versions and schedules, current again as a new release | POST | developer |
/v1/releases/:seq/promote {"to": "workspace"}: that release's versions, agents and schedules as a new release in a linked workspace; 202 waiting for approval where that workspace approves promotions; 409 lists the secret, var and connection names it lacks | POST | admin, or admin key with release.promote |
/v1/releases/:seq/promote ?to=workspace: the newest promotion approval for that release there and its outcome: waiting for approval, approved, applied, denied, expired or failed | GET | admin, or admin key with release.promote |
/v1/links {"direction": "to" | "from"}: this workspace promotes to :workspace, or :workspace to this one; active once an admin of each has added it; linked workspaces | GET · PUT · DELETE | viewer · admin, or admin key with workspace.link |
/v1/links/:workspace {"promotions": "approve" | "direct"}: whether promotions from :workspace wait for an approval here; only the workspace promoted to sets it | PATCH | admin, or admin key with workspace.link |
/v1/schedules the current schedules, each with nextAt and what its last tick started, or lastSkipped when its workflow was paused; pausedAt, pausedBy, pauseNote, buffered and the latest backfill | GET | viewer |
/v1/schedules/:schedule/pause {"note"?}: the schedule starts nothing until resumed; {schedule, paused, pausedAt, pausedBy, note} or {schedule, paused, nextAt}; agent schedules also need agent.deploy; audited | POST | developer |
/v1/schedules/:schedule/trigger 202 {schedule, runId} or {schedule, conversationId}: one run or conversation now, whatever its overlap; 409 while the schedule is paused; audited | POST | developer |
/v1/schedules/:schedule/backfill {"from", "to"?}: starts each tick of the last 31 days in [from, to) once, up to 1,440, paced; 202 {schedule, backfill}; DELETE stops it; workflow schedules only; audited | POST · DELETE | developer |
/v1/deploys?status=&limit=&before= · /v1/deploys/:id deploys that waited on packages, Python's or npm's; status: building, live or failed; newest first, 50 a page (limit up to 100), the next from Next-Before | GET | viewer |
/v1/workflows/:workflow/connections {"connections": [...]} | GET · PUT | viewer · developer |
/v1/workflows/:workflow/vars/:NAME {"value"}; DELETE moves it to the trash | PUT · DELETE | developer |
/v1/triggers {"workflow", "signing"?: {"scheme", "secret"?}, "name"?, "description"?, "event"?, "adapter"?: {"kind", "config"}}; with event, a keyed workflow's deliveries are that event to their key; with an adapter, each delivery is the event it makes of the body, and signing is required | GET · POST | viewer · developer |
/v1/triggers/:id/rotate its delivery log moves to the new id | POST | developer |
/v1/triggers/:id {"signing"?: {"scheme", "secret"?} | null, "name"?, "description"?, "event"?: name | null, "adapter"?: {"kind", "config"} | null}, at least one; the URL stays | PATCH | developer |
/v1/triggers/:id its delivery log goes too | DELETE | developer |
/v1/triggers/:id/deliveries?limit=&before=&bodies=1 the trigger's recent deliveries, refused ones included, newest first, 50 a page (limit up to 100), cursor in nextBefore; bodies=1 adds each kept body, needs run.payload and is audited as payload_view | GET | developer |
/v1/triggers/:id/deliveries/:delivery/replay a kept body again, or the request's body ({} without one) as a test event, through a delivery's checks but the signature's; 202 {runId, delivery}; 409 when the body isn't kept whole | POST | developer |
/v1/runs?status=&workflow=&key=&origin=&since=&until=&tag.<name>=&q=&limit=&before= newest first, cursor in nextBefore; find runs by when they were queued (since, until: ms or ISO 8601), tags (tag.customer=cus_42, every one must match) and q (the start of a run id, or text in its error, output, payload or tags), and with tags or q a page can be short or empty while nextBefore is set; key, with workflow, lists a keyed workflow's runs of that key; each run's tags, its key, its origin: trigger, rerun, resume, dashboard, api, mcp, agent, workflow, schedule, continue, or manual (a dashboard or API run from before origins were recorded), and origin_ref, who started it (for workflow, the run that called step.start; for schedule, the schedule's name; for continue, the run that continued as new); queued_reason is concurrency for a run waiting for its workflow's concurrency, paused for one held while its workflow is paused; stop_requested, stop_requested_at and stop_requested_by once someone cancelled or terminated it; paused_at and paused_by while someone has paused it; undo_at once its undo handlers began; cleanup_at once its cleanup began | GET | viewer |
/v1/runs/cancel {"workflow"?, "status"?, "origin"?, "since"?, "until"?, "tags"?, "limit"?}: cancels up to 1,000 matching runs that haven't ended, oldest first, each started one running its workflow's onCancel; {matched, cancelled, cancelling, more}; audited | POST | developer |
/v1/runs/rerun {"workflow"?, "status"?, "origin"?, "since"?, "until"?, "tags"?, "before"?, "limit"?, "version"?, "preview"?}: re-runs up to 1,000 matching runs, newest first, each waiting its turn, on its own version or with version current on its workflow's current one, leaving out a run whose payload that version's schema refuses (mismatched); {matched, rerun, skipped, mismatched, runIds, stopped, nextBefore}; audited. preview true starts nothing and answers {matched, rerunnable, older, more} | POST | developer |
/v1/runs/:id · /logs?after=&limit= · /timeline · /egress run (with its tags; undo_at: when its undo handlers began, null if none ran; cleanup_at: when its cleanup began, null if none ran; key: a keyed run's key; chain: its place among its key's runs that continued as new, {root, seq, previous, next, gone} with gone the ids past retention, null for a run in none; lifetime_ends_at: when an unfinished run's lifetime ends, null once it has), Workflows instance with a completed run's output, or outputTruncated {bytes, text} in its place for one over 64 KiB once Workflows no longer has it, decisions: each step.decide's trace, commands: each step.exec attempt, and activities: each step.activity attempt with its heartbeat progress; both the newest 200, each with the profile and requires it asked for, profileSource ("step", or "project" for the project's default; null without a profile), the profiles and imageVersion of the runner that took it, and waiting while no runner online has them. The run's resume is where Resume from here starts and until when, resumed what a resumed run resumed, retrying_until the end of a retry delay Retry now can end, and failed_step the step a failed run threw from, while its step results are kept. /logs: the run's log lines, oldest first, each with the step that printed it and its arrived_ms (when it reached the logs), 500 a page (limit up to 2,000), the next after the page's Next-After; a page without after also has a Log-Watermark header, the latest arrived_ms in the run's logs then. /timeline: dispatches, events and each step's attempts and waits (Timeline) | GET | viewer |
/v1/runs/:id/logs/stream the run's logs as Server-Sent Events, each event the lines since the last with the cursor of the furthest line sent as its id, until the run has ended and its lines are in; resumes after Last-Event-ID | GET | viewer |
/v1/runs/:id/rerun {"version"?, "payload"?}: re-runs the run as a new run of its own version, or with version current of its workflow's current one, with its payload or payload in its place; the payload must match the schema of the version it runs on (400 otherwise); 202 {runId, versionHash}; 200 {runId, versionHash, started: false} when its key has an open run, which answers it | POST | developer |
/v1/runs/:id/cancel {"undo"?}: cancels the run: the step running now finishes and no other starts; a started run then runs its cleanup, onCancel and with undo true its undo handlers first, and is cancelling until it ends; 202 {runId, status, cleanup}, cancelled or cancelling; 409 once it has ended, or for undo on a version deployed before cleanup on cancel; audited | POST | developer |
/v1/runs/:id/terminate terminates the run at once, a step in progress included; 202 {runId, status}, terminated or terminating; 409 once it has ended; audited | POST | admin |
/v1/runs/:id/pause pauses the run where it is, or lets it go on; 202 {runId, status, pausedAt, pausedBy}, status paused, pausing or running; 409 for a run not started, ended or being cancelled; audited | POST | developer |
/v1/runs/:id/retry Retry now: ends the step.run, step.exec or step.activity retry delay the run waits out; 202 {runId, retried}; 409 when it waits out none; audited | POST | developer |
/v1/runs/:id/resume {"step"?, "occurrence"?, "version"?}: resumes a failed run from that step, by default the one it failed at, as a new run with the steps before it already done, on the run's version or with "version": "current" on the workflow's current one; 202 {runId, from, seeded, versionHash}; 200 {runId, from, seeded: 0, versionHash, started: false} when its key has an open run; 400 when the payload doesn't match that version's schema; 409 when its results aren't kept | POST | developer |
/v1/runs/:id/resume every step a resume of the failed run can start at, in call order: {points: [{step, occurrence, kind, outcome}], more, until}; refused as the resume would be | GET | viewer |
/v1/runs/:id/events/:name body: the event's data, read like a webhook's, 256 KiB at most; the run's step.waitForEvent gets it, and a keyed run's even before it starts; one that continued as new passes it on to its key's open run, whose id the 202 names; 202, 409 once the run has finished, or 403 past the plan's eventsPerRun | POST | developer |
/v1/runs/:id/status · /stream {runId, state, status, publishedAt, waits, events}: what the run last published with step.status, the events it waits for, and its events sent of eventsPerRun; /stream: the same as Server-Sent Events until the run ends | GET | viewer |
/v1/runs/:id/payload the delivered body; 410 after 14 days; audited | GET | developer |
/v1/runs/:id/snapshots · /diff?device= [{device, takenAt, bytes, stage}]: the device configs the run kept with step.snapshot, redacted, in the order taken, for 35 days after the run ends; /diff: a device's first snapshot in the run against its last, {device, from, to, added, removed, hunks, truncated}, computed on read and cut at 2,000 hunk lines; 404 for a device with fewer than two; audited | GET | viewer |
/v1/runs/export?status=&workflow=&origin=&since=&until=&tag.<name>=&payloads=&before= NDJSON, a run a line as /v1/runs lists them, newest first, with its filters but q: 100,000 runs a request, the rest from Next-Before; payloads=1 adds each run's payload (developer; audited; 5,000 runs a request) | GET | viewer |
/v1/secrets metadata, never values | GET | viewer |
/v1/secrets/:NAME {"value", "hosts"?, "readable"?, "hmac"?, "workflows"?}; omitted workflows keep the scope; DELETE moves it to the trash | PUT · DELETE | admin |
/v1/secrets/:NAME {"hosts"?, "readable"?, "hmac"?, "workflows"?}; the value and its version stay | PATCH | admin |
/v1/connections | GET | viewer |
/v1/connections/:name {"hosts", "template"}, OAuth 2.0 {"hosts", "oauth2", "template"?}, or TCP {"protocol": "tcp", "targets", "tls", "auth"?}; DELETE moves it to the trash | PUT · DELETE | admin |
/v1/connections/:name/oauth/start {url} to connect an OAuth 2.0 connection from the dashboard; the provider sends the browser back to the dashboard's /oauth/callback, which finishes with {code, state}; DELETE disconnects it; callback and DELETE answer the connection | POST · DELETE | admin |
/v1/vars | GET | viewer |
/v1/vars/:NAME {"value"}; DELETE moves it to the trash | PUT · DELETE | developer |
/v1/trash what deletes put in the trash, newest first: [{kind, name, workflow, deletedAt, deletedBy, purgeAt}] | GET | admin |
/v1/trash/restore {"kind", "name", "workflow"?}: brings it back as it was, or deletes it for good and frees its name; audited | POST | admin |
/v1/audit?limit=&before=&subject= newest first, 100 a page (limit up to 500), the next from Next-Before; subject keeps one subject's entries, such as a request's answers; kept 90 days | GET | admin |
/v1/audit/export?before= every entry as NDJSON, newest first: 100,000 a request, the rest from Next-Before | GET | admin |
/v1/metrics/runs?hours= · /v1/metrics/egress?hours= | GET | viewer |
/v1/api-keys {"name", "role", "capabilities"?, "scope"?, "expiresInDays"?} | GET · POST | admin |
/v1/api-keys/:id | DELETE | admin |
/v1/members | GET | admin |
/v1/members/invitations {"email", "role", "confirmPaidSeat"?, "confirmCents"?}; 403 plan_required {reason, limit, max, needs, plans} where the plan's seats of that kind are taken; 409 seat_confirmation_required {detail, cents} until a paid seat's monthly price is confirmed | POST | admin |
/v1/members/:membershipId {"role", "confirmPaidSeat"?, "confirmCents"?}, refused into a kind of seat the plan has no room for, as an invitation is; audited | PATCH · DELETE | admin |
/v1/members/:membershipId/sessions/revoke signs the member out of this workspace's dashboard; {ended} | POST | admin |
/v1/sso the workspace's single sign-on: {providers, settings}, each provider with its domain, whether that is verified, and the URLs its identity provider needs; 403 plan_required {detail, needs, plans} where the workspace's plan doesn't include it | GET | viewer |
/v1/sso/providers {"kind": "saml", "domain", "idpMetadataXml" or "idpMetadataUrl"}, or {"kind": "oidc", "domain", "issuer", "clientId", "clientSecret"}: an identity provider for one email domain, 201 {providerId, acsUrl, spMetadataUrl, redirectUrl}; 403 plan_required {detail, needs, plans} for a kind the plan doesn't include; audited | POST | admin |
/v1/sso/providers/:id ends the sessions it made; 409 for the last verified provider while single sign-on is enforced; audited | DELETE | admin |
/v1/sso/domains/:domain/verification the TXT record that proves the domain: {recordName, recordValue}; audited | POST | admin |
/v1/sso/domains/:domain/verify looks the TXT record up once: {verified: true}, or {verified: false, reason}; audited | POST | admin |
/v1/sso/providers/:id/test {signInUrl}: the provider's sign-in link, a real sign-in; 409 until its domain is verified | POST | admin |
/v1/sso/settings {"enforce": true, "breakGlassUserId"} enforces single sign-on for the verified domains, keeping that admin's password and authenticator app; {"enforce": false} stops it; {enforce, breakGlassUserId, ended}; audited | PUT | admin |
/v1/agents each agent's current version, stats and canChat, the helper first with builtIn: true | GET | viewer |
/v1/agents/:agent the definition; adds a version: {name, version, warnings} | PUT | developer |
/v1/agents/:agent moves it to the trash for 7 days with its versions, conversations, code and schedules; its turns stop and its pending approvals are withdrawn; {deleted, stoppedConversations, withdrawnApprovals, purgeAt} | DELETE | developer |
/v1/agents/:agent/code body: TypeScript whose default export is tools({...}); {codeHash, tools, sizeBytes, warnings} | PUT | developer |
/v1/agents/:agent/versions newest first, 50 at most | GET | viewer |
/v1/agents/:agent/conversations {"text", "person"?}: starts a conversation, 202 {conversation, status}; takes an Idempotency-Key; GET lists your own, ?all=1 everyone's (developer), ?person= an end user's, latest message first, 50 a page (limit up to 100), the next from Next-Before | GET · POST | viewer |
/v1/agents/:agent/conversations/:conversation status, transcript, model use (USD) and approvals; ?person= for an end user's | GET | viewer |
/v1/agents/:agent/conversations/:conversation/messages {"text", "person"?}: the next message in your conversation; 202; takes an Idempotency-Key | POST | viewer |
/v1/chat-tokens {"agent", "person", "ttl"?}: a chat token for one agent and end user, 1 minute to 1 hour (the default); 201 {token, agent, person, expiresAt} | POST | developer key with agent.chat_as |
/v1/agents/:agent/conversations/:conversation/stream Server-Sent Events: text as it is written, tool calls and results, approvals and status, until the conversation comes to rest; ?person= for an end user's, and a chat token gets no tool calls or results | GET | viewer |
/v1/approvals?status=&kinds=&q=&limit=&before= status: pending (default), approved, denied, expired, withdrawn or all; kinds: agent (default), workflow or agent,workflow; q: text in a request, who asked or answered, or a workflow request's run tags; newest first, 100 a page, the next from Next-Before; only the requests you may answer, each with kind, approvers, required and approvals, and a workflow request with its run's tags: your own helper changes, and for admins the rest | GET | approver or admin, or developer for their own helper changes |
/v1/approvals/:id {"decision": "approve" | "deny", "note"?}: answers a request once; a deny needs note, its reason, or 400; 403 when it names other approvers, and for anyone but admins unless it is their own helper change, which only they answer; one needing two approvers stays pending until the second | POST | approver or admin, or developer for their own helper changes |
/v1/alerts {"emails", "webhookUrl", "workflows", "refusals", "approvals"?}; returns signingSecret once, when it creates one; 409 for a member who stopped alert emails | GET · PUT | admin |
/v1/alerts/test | POST | admin |
/v1/alerts/rotate-secret a new signingSecret, shown once; the old one stops working | POST | admin |
/v1/alerts/clear-suppression {"email"}: alert emails try a bounced recipient again | POST | admin |
/v1/alerts/me {"optedOut"}: stops or restarts alert emails to you; signed-in members only | GET · PUT | viewer |
/v1/runners {image, tokens, runners, activities}: the workspace's runner tokens, without their secrets; the runners seen in the last 7 days, each with online, running, how many activities it lists, and the profiles, imageVersion and tools its image manifest names; and the registered activities they advertise | GET | viewer |
/v1/runners/tokens {"name", "pool"?, "workflows"?}: a runner token, 201 {id, token, …}; the token is shown once. workflows limits it to those workflows, all of them when left out | POST | admin |
/v1/runners/tokens/:id its runners stop at once and the commands they were running fail | DELETE | admin |
Roles
Roles rank viewer < approver < developer < admin. Each role can do everything the roles below it can, except answer approval requests, which only approvers and admins do. Roles work the same for API keys and for members signed in to the dashboard, but a key is never an approver: POST /v1/api-keys takes viewer, developer or admin.
- viewer
Read workflows, versions, runs, logs, timelines, egress, metrics, usage, billing, vars, secret metadata (no values), and connections with their hosts and templates. Trigger ids are masked and URLs are hidden. List agents and chat with them.
- approver
What a viewer can, and answer approval requests. Nothing else: no edits, deploys or runs.
- developer
Deploy, run, roll back and delete workflows, read their deployed source and a run's payload, set a workflow's connections and vars, set workspace vars, create, rotate and revoke triggers or change their signing, re-run and cancel runs, and pause workflows. Deploy and delete agents and read other people's conversations with them. A developer doesn't answer approval requests.
- admin
Rename the workspace, turn agents on or off, manage billing and alerts, answer approval requests, terminate runs, set secrets (or change only their hosts and flags) and connections, read the audit log, manage API keys, invite, re-role, sign out and remove members, restore or delete for good what's in the trash, and set up single sign-on in an Enterprise workspace.
Members · ridgeline-ops
3| Member | Role |
|---|---|
| dana@ridgeline.example | admin |
| li@ridgeline.example | developer |
| sam@ridgeline.example | viewer |
The last active admin cannot be demoted or removed.
Each route needs one capability, such as workflow.deploy or run.view, and each role holds the capabilities at or below it. There are three exceptions. Only approvers and admins hold approval.decide, never developers. No role holds agent.chat_as: only a developer or admin key that lists it in capabilities can chat as your app's users. Signed-in admins hold workspace.link and release.promote, which link this workspace to another and send releases there, but an API key holds them only when it lists them, so admin keys made without a list can't link or promote. A caller without the route's capability gets 403 {"error": "forbidden", "required": "<minimum role>", "capability": "<name>"}. GET /v1/me lists the caller's capabilities. The last active admin cannot be demoted or removed (409). A suspended workspace can still read and revoke triggers, API keys and members. Any other write returns 403 {"error": "tenant suspended"}.
| Role | Capabilities |
|---|---|
| viewer | workspace.view workflow.view run.view trigger.view secret.view connection.view var.view agent.view agent.chat |
| approver and admin, not developer | approval.decide |
| developer | workflow.source workflow.deploy workflow.pause run.payload run.start run.cancel trigger.manage var.manage agent.deploy conversation.read_others |
| admin | workspace.rename workspace.features billing.manage alerts.manage secret.manage connection.manage audit.view key.manage member.manage trash.manage run.terminate sso.manage |
| admin signed in, or listed in an admin key | workspace.link release.promote |
| none: listed in a developer or admin key | agent.chat_as |
API keys
An API key is shown only once, when an admin creates it. We store only its SHA-256 hash.
Key created · deploy-bot
developerslk_7Qh2mZ0vYp4cN8xW1sR6tL3kJ9bF5dG0aE2uI7oP4yT
- Id
key_3f9a0c7e21b4d856- Prefix
slk_7Qh2mZ0v- Expires
- 2027-01-18, in 90 days
Copy the key now. It's shown only once.
- An admin creates a key with
POST /v1/api-keys {"name", "role", "capabilities"?, "scope"?, "expiresInDays"?}. The response is{id, key, prefix, role, capabilities, scope, expiresAt}. Thekeyis shown only once. Anameis 1 to 64 characters, without control characters or line breaks. - A key is 256 random bits, belongs to one workspace and one role, and expires after
expiresInDays(1–365, default 90).capabilitiesnarrows it to some of what its role allows, for example["workflow.deploy"]for a CI key, and is the only way to give a keyagent.chat_as.scopelimits it to named workflows, agents or both, 1 to 50 names each, for example{"workflows": ["billing"]}. Lists show only those workflows with their runs and triggers, and only those agents. A kind the scope leaves out is not limited. A key never reaches further than the key or person that created it. Signed-in admins, and admin keys created without acapabilitieslist, can also giveagent.chat_as. - A scoped key gets
403 {"error": "forbidden", "reason": "this key is limited to other agents or workflows"}when the path names a workflow or agent outside its scope, and on routes that don't act on workflows, runs, triggers, releases, deploys or agents, such as secrets, vars, usage or alerts. Unlike a missing capability, the answer has norequiredorcapability. A run or trigger of another workflow returns404, as if it did not exist.GET /v1/mealways answers. - A conversation a workflow started with ask is that workflow's: a key whose scope leaves it out gets
404for it, and lists leave it out. Another person's conversation with the helper holds tool output made with that person's access, so a key reads it only without a scope and with every developer capability. - A key whose scope names workflows can't use
conversation.read_otherson people's conversations, a member's agent schedule's included: their tool results and the agent's answers can hold what other workflows returned.?all=1returns403with the reason above, and another person's conversation and its stream return404. So do MCP'slist_conversationswithallandget_conversation, and the helper. The key still reads its own conversations, its end users', and those its workflows started with ask. - A workflow deployed with a key whose scope names agents can ask only those agents. Asking another fails the run with
this workflow's deployer can't reach agent <name>. The same code deployed again from the dashboard, or with a key whose scope names no agents, can ask any agent. - A workflow deployed with a key whose scope names workflows can start and call only those workflows. Starting or calling another fails the step with
this workflow's deployer can't reach workflow <name>, whether that workflow exists or not, and starts nothing. The same code deployed again from the dashboard, or with a key whose scope names no workflows, can start any workflow. A version deployed before 30 October 2026 can start any workflow, also when the same code is deployed again. - A key whose scope names workflows talks to an agent with only those workflows' tools, and so do the end users it names, the agent schedules it adds or changes, and a workflow deployed with it when it asks an agent. A call of a tool for another workflow, in a conversation that still has one, fails with
this key is limited to other workflowsand starts nothing. The helper'sdeploy_workflow,run_workflowandcreate_triggerfor another workflow fail the same way and ask the key nothing. The key answers an agent's approval request only when the request's tool starts one of those workflows and the request comes from a conversation the key may read, and Trigger now of an agent schedule that may start another workflow returns403with that reason.
- A workspace holds at most 20 active keys.
GET /v1/api-keyslists metadata only, andlast_used_atupdates at most once a minute. Revoke a key withDELETE /v1/api-keys/:id. - Bad API keys are rate limited per IP: after 10 in a minute, the API returns
429. A refused MCP sign-in token doesn't count. - The sign-in pages count every password, authenticator code and sign-up or password email, right or wrong: 10 a minute for one account from one IP, and 60 a minute from one IP. Past either they return
429withRetry-After: 60.
Sessions
A dashboard session ends after 30 days, or 7 days without use.
- Settings → Sign out other sessions ends every other session you have, in every workspace. The session you use stays.
POST /v1/me/sessions/revokedoes the same and answers{ended, grants}: the sessions and the MCP connections it ended. An API key gets403. - An admin ends a member's sessions in this workspace with Revoke sessions on the Workspace screen, or
POST /v1/members/:membershipId/sessions/revoke. - Both also end MCP connections: Sign out other sessions ends all of yours, also one you connected while signed in to the session you use, and Revoke sessions ends the member's for this workspace. Removing a member, a password reset and setting up or resetting an authenticator end them too. A client can still use the token it holds for up to 5 minutes, except a removed member's. Signing out of one browser ends none.
- A sign-out is written to the audit log as
sessions_revoke, with whose sessions ended, how many sessions (ended) and MCP connections (grants) ended, and who ended them. The Audit screen reads it as, say, "signed out 2 sessions and 1 MCP connection". Your own is written only when it ended a session or an MCP connection. - A passkey can sign you in in place of your password: on the sign-in page, type your email address and choose Sign in with a passkey. Your authenticator code is still asked for. Only that address's passkeys sign in to its account. Add, rename and remove passkeys in Settings → Security; adding one takes a sign-in with your password or a passkey and your authenticator code in the last 15 minutes, not a Google, GitHub or single sign-on one. You can't remove your last way to sign in, a password or a passkey: add another first. Removing a passkey doesn't end your sessions; Sign out other sessions does. A new account's emailed link can set a passkey instead of a password.
- Lost your authenticator? Email security@shiftlabs.org. We confirm the request through the phone number in your contract, if you have one, or another admin of one of your workspaces. If you're an admin of a Pro workspace, we can instead hold a random amount from 0.50 to 9.99 USD on its card, and you read us the amount from your bank. The hold is never charged. Keep a second admin: without any of these, we can't reset it. The dashboard reminds a workspace's only admin. Then we delete your authenticator and your passkeys, which also signs you out everywhere and ends your MCP connections, and you set up a new one at your next sign-in. If you signed up with a passkey and have no password, set one from Forgot your password? first. The audit log of each workspace you belong to shows the reset as
mfa_reset. The workspace we reset it from also shows how we confirmed it, and each card check ascard_check.
Trash
A delete moves a workflow, agent, secret, connection or var to the workspace's trash for 7 days. Until then, an admin can restore it or delete it for good.
- What goes there
A workflow with its versions, state and triggers, and its own vars and connection links. An agent with its versions, conversations, code and schedules. A secret with its sealed value. A connection, HTTP or TCP, with its links to workflows. A workspace var, or a workflow's own var. A workflow's vars and links are part of its entry and aren't listed apart.
- Gone at once
It leaves every list and can't be used. A workflow's triggers are revoked, and their URLs answer
404. It starts no runs: run now, schedules,step.start,step.calland re-runs are refused asworkflow not found. Its source can't be read. Runs in flight finish on their version, and theirctx.statewrites are refused. Its run history stays. An agent answers asagent not found, and its conversations can't be listed or read. Its turns in progress stop, and its pending approval requests are withdrawn. A secret can't be used, sent or revealed: stand-ins, connections,hmac,reveal,step.exec,step.activityand an agent'sproviderKeytreat it as missing. - After 7 days
It is erased, a workflow's versions and state, an agent's conversations and code, and a secret's sealed value included.
DELETEanswerspurgeAt, when that happens, in milliseconds since the epoch. - Restore
An admin brings it back as it was, on the dashboard's Trash screen or with
POST /v1/trash/restore. A workflow comes back with its versions, current version, paused state,ctx.state, its own vars and links, and the triggers its delete revoked, with the same URLs and signing. An agent comes back with its versions, current version, conversations, code and schedules. A secret comes back with its sealed value, version, hosts and flags. A connection comes back with its links. - Delete for good
An admin erases it at once, on the Trash screen or with
POST /v1/trash/purge. Its name is free at once.
{
"error": "workflow nightly is in the trash until 2026-11-07 14:03 UTC",
"trash": {
"kind": "workflow",
"name": "nightly",
"workflow": null,
"deletedAt": 1793455392000,
"deletedBy": "dana@ridgeline.example",
"purgeAt": 1794060192000
},
"hint": "An admin can restore it, or delete it for good to use the name now, on the dashboard's Trash screen or with POST /v1/trash/restore or POST /v1/trash/purge."
}
- A name in the trash stays taken until it is restored, deleted for good or erased after 7 days. Creating or deploying it returns
409with the item intrashand ahint. Match on thetrashfield, not the text. - That covers
PUT /v1/workflows/:workflow, staged too,PUT /v1/agents/:agent,PUT /v1/agents/:agent/code,POST /v1/releasesand rollbacks to a release that names it, promotions into the workspace,PUT /v1/secrets/:NAME,PUT /v1/connections/:nameandPUT /v1/vars/:NAME. While a workflow is in the trash,PUT /v1/workflows/:workflow/vars/:NAMEandPUT /v1/workflows/:workflow/connectionsfor it return the same409. So does linking a connection that is in the trash. - A deploy never replaces what's in the trash, so an admin can still restore it. To use the name now, delete it for good.
shiftlabs deployprints the message and the hint and exits7. See Errors. GET /v1/trashlists the trash, newest deletion first:[{kind, name, workflow, deletedAt, deletedBy, purgeAt}].kindisworkflow,agent,secret,connectionorvar.workflowis a var's workflow, and null for a workspace var and every other kind.deletedByis the email or API key id that deleted it.POST /v1/trash/restoreandPOST /v1/trash/purgetake{"kind", "name", "workflow"?}. Sendworkflowonly for a workflow's var. A restore answers{restored: {kind, name, workflow}}, and for a workflow alsotriggers, how many came back live. A purge answers{purged: {kind, name, workflow}}. Either returns404 {"error": "<kind> <name> is not in the trash"}for something that isn't there.- A restore returns
403 {"error": "quota exceeded", "limit", "max"}when the workspace is at a limit now:workflows,triggers,agents,secrets,connectionsortcpTargets. A connection whose secrets no longer exist returns409with their names inmissing. Restore or create them first. A workflow's var returns409withtrashwhile its workflow is in the trash. - These routes need
trash.manage, which admins hold. A scoped key can't use them. - The audit log records deletes as before:
workflow_delete,secret_delete,connection_deleteandvar_delete, and an agent's asagent_delete, with how many conversations stopped and approvals were withdrawn. A restore isworkflow_restore,agent_restore,secret_restore,connection_restoreorvar_restore, withby, a var'sworkflow, and for a workflow how manyvarsandconnectionscame back. A purge isworkflow_purge,agent_purge,secret_purge,connection_purgeorvar_purge, withby: the admin, orexpiryafter 7 days. - Deleting the workspace still erases everything at once, its trash included.
Workspaces
You can create up to 5 workspaces, and join as many as you're invited to.
- Create one with New workspace in the workspace menu, at the top of the dashboard's sidebar. You're its admin. Workspaces you join don't count toward the 5, and a suspended one counts until it's deleted. A sixth gets
403 {"error": "You've created 5 workspaces, the most one person can."}. - The workspace menu lists every workspace you belong to, with your role in each. Choosing one opens it at Runs, with your role there. Nothing from the workspace you left stays on screen, and other tabs open the new one on their next request.
- Switching keeps your session: it ends when it would have, and you don't sign in again. A workspace that needs you to sign in to it sends you to its sign-in.
- When you belong to several workspaces, signing in opens the one this browser opened last.
- An API key reaches its own workspace only, and so does an MCP connection: the one you chose when you connected.
Rate limits
Over a limit, a request gets 429 and a Retry-After header with the seconds to wait. Request rates are the same on every plan.
| Requests | Limit | Counted | Retry-After |
|---|---|---|---|
| Any request to the API or dashboard | 600 a minute | per IP | 60 |
| Failed authentication: a bad API key or chat token, not an MCP sign-in token (an expired chat token doesn't count either) | 10 a minute | per IP | 60 |
| Sign-in pages: each password, authenticator code and sign-up or password email, right or wrong | 10 a minute for one account, 60 for all | per IP | 60 |
/v1 calls, from API keys, MCP tool calls and the dashboard | 1,200 a minute | per workspace | 60 |
/v1 calls with chat tokens, counted apart from the row above | 1,200 a minute, and 120 for each person | per workspace | 60 |
Run logs and log stream reads, timelines and egress, and /v1/metrics a read repeated within 10 seconds is served from cache and not counted | 120 a minute | per workspace | 60 |
Run status and log streams opened, GET /v1/runs/:id/status/stream and /logs/stream | 60 a minute | per workspace | 60 |
Deploys, PUT /v1/workflows/:workflow and PUT /v1/agents/:agent/code, an agent deploy or release that names code, and promotions into the workspace, applied or asked for | 20 a minute | per workspace | 60 |
Code checks, POST /v1/workflows/:workflow/validate, which deploy nothing | 20 a minute | per workspace | 60 |
| Member invitations | 5 a minute | per workspace | 60 |
| Agent messages, starting or adding to a conversation | 30 a minute | per workspace | 60 |
| Agent messages from one person, API key or end user | 10 a minute | per person | 60 |
Test alerts, POST /v1/alerts/test | 1 a minute | per workspace | 60 |
Exports, GET /v1/runs/export, /v1/audit/export and /v1/usage/export | 10 a minute | per workspace | 60 |
| Webhook deliveries to one trigger | 100 per 10 seconds | per trigger | 10 |
| Events sent to one run's event URLs | 100 per 10 seconds | per run | 10 |
| Webhook deliveries to all of a workspace's triggers and event URLs | 300 per 10 seconds | per workspace | 10 |
| Any request to shiftlabs.org or its subdomains the IP is blocked for 10 seconds, and the body is not our JSON | 150 per 10 seconds | per IP | wait 10 seconds |
- Request rates are counted per edge location and are approximate. A rate-limited request returns
{"error": "rate limited"}. Test alerts are the exception: they are counted exactly, per workspace, and a second one within a minute returns{"error": "one test a minute"}. - No response carries
RateLimitorX-RateLimitheaders.Retry-Afteris the signal: wait that many seconds, then retry. Clients that share a budget should add some random delay. - A full quota also returns
429, with{"error": "quota exceeded", "limit", "max"}. That covers runs per 24 hours and runs at once, runs waiting for a workflow's concurrency or held while it is paused (concurrencyQueue: 1,000 per workflow on the free tier), steps and seconds of CPU per 24 hours (stepsPerDay,cpuSecondsPerDay: 5,000 and 300 on the free tier), agent messages per 24 hours and the model allowance, new versions per 24 hours (100) and member invitations per 24 hours (20 on the free tier). ItsRetry-Afteris the time until enough of them age out (steps and CPU by the hour; for the monthly model use, the next month), or for runs at once, until the next check, at most 30 seconds, and for waiting runs, 60 seconds. Runs already started continue past the step and CPU quotas. Pricing lists the quotas. - A run that waits or is held counts toward runs per 24 hours from when it arrives, but not toward runs at once until it starts. A bulk re-run never gets
concurrentRuns: its new runs wait their turn instead. A run that waits doesn't start while the workspace is atstepsPerDayorcpuSecondsPerDay, past the spending limit or with a payment failing, or while new runs are paused across the platform. - shiftlabs can pause new runs across the platform. Starting a run (webhooks, run now, re-runs) or sending an agent message then returns
503with{"error": "runs paused", "detail", "retryAt"}and aRetry-After. Over MCP the error result starts withHTTP 503, and an agent's tool call fails withNew runs are paused. Try again after <time>.. Runs already started continue, and runs waiting to start wait. Retry afterRetry-After. Webhook senders that retry on5xxdeliver later. - During announced platform maintenance, every request that changes something returns
503with{"error": "under maintenance", "detail"}andRetry-After: 60: every method butGET, from API keys, chat tokens, MCP tools and the dashboard, and signing in to the dashboard. Nothing was changed, so send it again afterRetry-After. Reads continue, and so do webhook deliveries, the runs they start and runs already started. Over MCP the error result starts withHTTP 503. - On Pro, past the spending limit or while a payment is failing, starting a run or sending an agent message returns
429with{"error": "spending limit reached", "detail"}or{"error": "payment failed", "detail"}, andRetry-After: 3600. - A message to an agent past its own monthly budget returns
429with{"error": "monthly budget reached", "monthlyUsd"}, andRetry-Afteruntil the UTC month ends. - A message from an end user past the agent's daily budget for each end user returns
429with{"error": "daily budget reached", "detail", "endUserDailyUsd", "resetsAt"}, a chat token's without the amount orresetsAt, andRetry-Afteruntil the UTC day ends. - When the API, webhooks or the dashboard briefly can't reach a workspace's storage, the database or one another, a request returns
503with{"error": "temporarily unavailable"}andRetry-After: 1, webhook deliveries and events included. Reads of a workspace's storage are retried before that answer. A change that gets it may have been saved, and its answer says so in"hint": "The change may have been saved. Check before sending it again.". Run starts and agent messages with the sameIdempotency-Keyare safe to send again. Over MCP the error result starts withHTTP 503. Webhook senders that retry on5xxdeliver later. - A deploy whose code takes more than 60 seconds to load returns
503with{"error": "temporarily unavailable"}, adetail, andRetry-After: 30, and so do an agent's code upload, an agent deploy or release that namescode, and a code check. Nothing was deployed, so it's safe to send again. See The entry. - A webhook delivery, run now or release whose payload takes more than 2 seconds to check against the workflow's payload schema returns
503with{"error": "temporarily unavailable"}, adetail, andRetry-After: 5. It started no run and changed nothing. See Deploy and triggers. - Package builds answer
429too: Python package builds and npm installs share these limits. A workspace can start 20 new builds in 24 hours:{"error": "package build quota exceeded", "limit", "period"}, withRetry-Afteruntil the oldest build ages out. It can have 5 deploys waiting on builds at once:{"error": "too many deploys are waiting on package builds", "limit"}, withRetry-After: 30. Its builds run one at a time, and each fails after 3 minutes. Follow a waiting deploy atGET /v1/deploys/:id. - Over MCP, a refused tool call returns an error result that starts with
HTTP 429, withoutRetry-After. Wait a minute before calling again. - Requests your workflows send have their own limits: a rate to one host (30 a minute on Free, 600 on Pro), and an outbound quota per 24 hours. See At the gateway.
Pages and exports
Lists answer a page at a time, newest first. Exports answer a whole list as a file.
| List | Next page's cursor | Page | Largest limit |
|---|---|---|---|
GET /v1/runs | nextBefore in the body | 50 | 100 |
GET /v1/audit | Next-Before header | 100 | 500 |
GET /v1/approvals | Next-Before header | 100 | 100 |
GET /v1/deploys | Next-Before header | 50 | 100 |
GET /v1/agents/:agent/conversations | Next-Before header | 50 | 100 |
GET /v1/runs/:id/logs, oldest first | Next-After header | 500 | 2,000 |
- Send the cursor back as
?before=for the next page. No cursor means the last page. - A run's logs page the other way: send
Next-Afterback as?after=. Every page with lines has one, so a page shorter thanlimitholds the lines so far, and the same cursor later gets the lines that came since. See Logs. - A page can hold fewer than
limitrows and still have a cursor after it. - A cursor is opaque. Send it only to the list it came from. A malformed one answers
400 {"error": "invalid cursor"}. - Browser pages on any origin can read
Next-Before. GET /v1/runs/export,GET /v1/audit/exportandGET /v1/usage/exportanswer NDJSON, one JSON object per line, as a file to download.- The runs export takes the filters of
GET /v1/runsbutq, time range and tags included, and its lines are the runs that list shows.qanswers400: an export reads every run that matches. - An export reads up to 100,000 runs or entries, newest first. When more remain,
Next-Beforeholds where the next export starts. Send it back as?before=. - A workspace can start 10 exports a minute. See Rate limits.
?payloads=1adds each run'spayload,nullonce erased after 14 days. It needs developer or above, reads up to 5,000 runs, and is written to the audit log aspayload_view.- The usage export is one line per UTC hour with any use in the last 40 days, oldest first:
{hour, runs, steps, cpuSeconds, outbound}, the counts the meters bill. - While shiftlabs deploys, an export can answer
503 {"error": "export isn't available yet"}withRetry-After: 60.
MCP
AI agents work with your workspace through the Model Context Protocol at https://api.shiftlabs.org/mcp, with an API key or by signing in.
Coding agents can read these docs as Markdown. https://docs.shiftlabs.org/llms.txt lists every page with a short description, /llms-full.txt holds every page in one file, and each page is also at its address plus .md, such as /workflows.md.
// In your MCP client's server list (streamable HTTP).
{ "shiftlabs": {
"type": "http",
"url": "https://api.shiftlabs.org/mcp",
"headers": { "Authorization": "Bearer slk_…" } } }
# The tools a key can call.
curl -X POST https://api.shiftlabs.org/mcp \
-H "authorization: Bearer $SHIFTLABS_API_KEY" \
-H "content-type: application/json" \
-d '{"jsonrpc": "2.0", "id": 1, "method": "tools/list"}'
- Each tool call makes the matching
/v1request with the same key. The key's role, your limits and the audit log apply as they do for curl. A viewer key lists only read tools. - Read:
list_workflows,list_versions,list_runs,get_run,get_open_run,get_run_logs,get_run_timeline,get_run_status,list_triggers,list_secrets,list_connections,list_schedules,get_usage. Developer:get_workflow_source,deploy_workflow,run_workflow,rerun,create_trigger,list_trigger_deliveries,replay_delivery,send_test_event,cancel_run,pause_run,unpause_run,retry_run,resume_run,pause_workflow,resume_workflow,pause_schedule,resume_schedule,trigger_schedule,backfill_schedule,stop_backfill,send_eventandsend_workflow_event. reruntakes a runid, an optionalversion,sameorcurrent, and an optionalpayloadthat replaces the run's; see Re-run a run.list_trigger_deliveriestakes a triggerid, and optionalbeforeandbodies, and lists its delivery log.replay_deliverytakes the trigger'sidand adeliveryfrom it and delivers it again.send_test_eventtakes a triggeridand an optionalpayload,{}by default.cancel_runtakes a runidand cancels it, which runs the workflow'sonCancelfor a started run, and an optionalundothat also runs the run's undo handlers.pause_workflowtakes aworkflowand pauses it.resume_workflowtakes aworkflowand an optionaldrop, which ends its held runs instead of starting them. No tool terminates a run: an admin does that in the dashboard or withPOST /v1/runs/:id/terminate.pause_runandunpause_runtake a runidand pause it where it is or let it go on.retry_runtakes a runidand does Retry now.resume_runtakes a failed run'sidand an optionalstep,occurrenceandversion,sameorcurrent, and resumes it as a new run from that step, by default the one it failed at, on the run's own version unlessversioniscurrent.pause_scheduletakes ascheduleand an optionalnote, andresume_schedule,trigger_scheduleandstop_backfillaschedule.backfill_scheduletakes aschedule,fromand an optionalto. See Pause, trigger or backfill a schedule.get_run_statustakes a runidand returns its status and the events it waits for.send_eventtakes a runid, an eventnameand optionaldata, and sends the run that event.run_workflowtakes an optionalidempotencyKey. Calling it again with the same key within 24 hours returns the first run instead of starting another.get_run_logstakes a runid, an optionallimit, up to 2,000, and an optionalafter, and returns{lines, nextAfter}: the lines, oldest first, and the cursor to pass back asafterfor the lines after them, since a tool can't read theNext-Afterheader. Fewer lines thanlimitmeans you have every line so far; the samenextAfterlater returns the lines that came since. A page with no lines gives back theafteryou sent, ornullwithout one.get_open_runtakes aworkflowand akey, and returns the keyed workflow's open run for that key.list_runstakes akeywith itsworkflow.send_workflow_eventtakes aworkflow, an eventname, an optionalkeyand optionaldata, and sends the event to the key: the key's open run gets it, or the data starts one.create_triggertakes an optionalevent, which makes a keyed workflow's deliveries that event, and an optionaladapter,{kind, config}, which makes each delivery's JSON body an event; it needssigningwith a scheme that adapter lists.list_triggersshows each trigger'sadapter, ornull.list_workflowsreturns each workflow'spayload_schema.run_workflowsays a payload must match it, and a payload that fails it gets the API's400with what doesn't match. See Payload schemas.- Admin:
list_approvals, the approval requests waiting or answered, promotions from linked workspaces included. A workspace with agents off lists no agent requests. - Where agents are on, there are agent tools too. Read:
list_agents,list_agent_versions,list_conversations,get_conversation. Write:send_message, which sends a message as the key, and for a developer,deploy_agent. send_messagestarts a conversation, or adds to one when you passconversation. The agent answers in the background, so read its reply withget_conversation.- With a key that holds
agent.chat_as,list_conversations,get_conversationandsend_messagetakepersonand act for that end user of your app. - No tool answers an approval request, turns agents on or off, or manages members or keys. A person answers approvals in the dashboard or with
POST /v1/approvals/:id. - No tool returns secret values.
list_secretsreturns names, hosts and flags, and connections hold expressions only. Give an agent a key with the lowest role it needs and a short expiry.
MCP sign-in
Clients that connect by signing in, such as claude.ai, ChatGPT, Claude Code and VS Code, need only the address https://api.shiftlabs.org/mcp. You sign in with your shiftlabs account, and the connection acts as you.
- In claude.ai, open Customize → Connectors, choose Add custom connector, enter the address, and choose Connect. In ChatGPT, create an app with the address in developer mode. Either one sends you to the shiftlabs sign-in page.
- Each new connection asks you to choose its workspace, also when you belong to only one, or to cancel.
- Tools act as you, with your role in that workspace. Your limits and the audit log apply as in the dashboard, and runs they start show your email.
- Changing your role or removing you from the workspace applies on the connection's next call.
- Removing the connector in the client stops that client, but the sign-in it held stays valid for up to 30 days after the client last used it. To end it at once, use Sign out other sessions, which ends all your connections. See Sessions.
- If you belong to no workspace, the page asks you to create or join one first. A token that has expired or wasn't issued for this address gets
401, and the client signs you in again. - Clients that take a header, such as coding agents and scripts, use an API key instead. Cursor can't sign in, as it registers only by Dynamic Client Registration, which shiftlabs doesn't offer: give it an API key in its MCP config,
Authorization: Bearer slk_….
Alert webhooks
Alerts post JSON to the webhook you set with PUT /v1/alerts: failed runs, approval requests waiting for an answer, and OAuth 2.0 connections whose sign-in changed. The body's type says which. Each post is signed with your workspace's secret.
runs.failed{id, type, test, workspace, since, until, text, workflows, otherEvents, settingsUrl}. Each entry inworkflowshasworkflow,failed,refused(counts by limit:runsPerDay,concurrentRuns,concurrencyQueue,stepsPerDayorcpuSecondsPerDay) and up to 3runs, each withid,errorandurl. SetworkflowsonPUT /v1/alertsto some workflow names, ornullfor all, andrefusals: trueto include runs refused at a limit. A test alert has"test": true.approvals.waiting{id, type, test, workspace, count, text, requests, approvalsUrl, settingsUrl}.countis how many requests are still waiting. Up to 3requestshavekind,id,requestedAtandexpiresAt: an agent's (kindagent) alsoagent,toolandaskedBy, a workflow run's (kindworkflow)workflow,name,runIdandrunUrl, a promotion's (kindpromotion) the promotingworkspace, itsreleaseandaskedBy. Tool arguments and workflow messages are never included. It is sent a minute after the first request, then at most once every 15 minutes, to the same emails and webhook."approvals": falseonPUT /v1/alertsturns it off. It is on by default. See Approval notices.connections.status{id, type, test, workspace, connection, status, error, at, text, connectionUrl, settingsUrl}. A refresh changed an OAuth 2.0 connection'sstatus: torefresh_failedorrevoked, witherrorsaying why, or back toconnected, witherrornull. One per change, sent at once to the same emails and webhook, whateverworkflowssays. An admin's own connect or disconnect sends none.
// secret: the signingSecret. header: the Shiftlabs-Signature header.
// body: the raw request body as a string, before any JSON parsing.
import { createHmac, timingSafeEqual } from "node:crypto";
function verify(secret, header, body) {
const parts = Object.fromEntries(
header.split(",").map((part) => part.trim().split("=")),
);
const t = Number(parts.t);
if (!Number.isInteger(t) || Math.abs(Date.now() / 1000 - t) > 300)
return false;
const expected = createHmac("sha256", secret).update(`${t}.${body}`).digest();
const given = Buffer.from(parts.v1 ?? "", "hex");
return given.length === expected.length && timingSafeEqual(given, expected);
}
- Each post carries
Shiftlabs-Signature: t=<unix seconds>,v1=<hex>, wherev1is HMAC-SHA256 of<t>.<body>keyed with the whole secret,whsec_included. It is the header a trigger withshiftlabssigning checks. Reject atmore than 5 minutes off. - The secret is made when you save a webhook and the workspace has none. It is returned once, as
signingSecretin that answer, andGET /v1/alertsnever returns it.POST /v1/alerts/rotate-secretreturns a new one, and the old one stops working at once. Removing the webhook deletes the secret. - A 5xx, a
429, a timeout (10 s) or a network error is retried 1, 5, 15 and 60 minutes later. The fifth attempt is the last, and any other answer is final. Every attempt sends the same body with the sameid, and is signed when it is sent. GET /v1/alertslists the last 20 attempts indeliveries, newest first, each withat,id,kind,attempt,statusorerror,finalandretryAt.- Alert emails are limited per workspace and UTC day: 50 on the free tier, 500 on Pro. Each recipient an alert is sent to counts, test alerts included, even when the send fails or is refused. Members who stopped alert emails and suppressed addresses don't count, and neither do webhook posts.
- Past the limit, each recipient gets one last email, and email alerts pause until 00:00 UTC.
GET /v1/alertsthen returnsemailPausedwithuntil(Unix milliseconds) andlimit.
Alert emails
Alert emails go to the members an admin picks with PUT /v1/alerts. A new workspace starts with the person who created it, for failed runs and waiting approvals. Each member can stop them for themselves.
- Every alert email ends with a link that stops alert emails from that workspace to you. It works without signing in while you're on the workspace's alert list. Mail apps that show an Unsubscribe button use the same link.
PUT /v1/alerts/mewith{"optedOut": true}stops them, and{"optedOut": false}turns them back on.GET /v1/alerts/mereturnsemail,recipient,optedOut,optedOutAtandsuppressed. Any member can, for themselves only, while signed in. An API key gets403.GET /v1/alertslists who stopped them inoptedOut, each withuserId,emailandat. An admin can't add them back:PUT /v1/alertsreturns409. One still on the list stays there and gets nothing.- A removed member leaves the alert list and
optedOut. If shiftlabs support removes them, that takes up to an hour. - Alert emails skip an address whose mail bounced, or that marked an email from shiftlabs as spam. Billing emails skip only an address that marked one as spam.
GET /v1/alertslists the recipients this affects insuppressed, each withemail,reason(bounced,complainedorsuppressed),detailandat. POST /v1/alerts/clear-suppressionwith{"email"}makes alert emails try a bounced recipient again. If it still can't take mail, it's suppressed again. Each clear is written to the audit log asalerts_suppression_clear. A spam complaint can't be cleared there: the person asks at alerts@shiftlabs.org.- Billing emails about the spending limit and failed payments go to the billing contact and have no unsubscribe link.
Versioning
Every route is under /v1. Within v1, changes only add.
- What we add
New routes, new optional fields in requests, new fields in responses, and new values in lists of values, such as a run's
origin. Ignore fields you don't know, and accept values you haven't seen. - Breaking changes
Removing or renaming a route or field, changing a type or a status code, or making an optional field required comes in a new version, such as
/v2.v1keeps working beside it until it is deprecated as below. - Deprecation
Anything we will remove is announced on the changelog. Its responses carry
DeprecationandSunsetheaders at least 90 days before it is removed.Sunsetgives the date it stops working.
# No API key needed. Answers {"sdk": "0.4.0", "minimumCli": "0.1.0", "environment": "production"}.
curl https://api.shiftlabs.org/v1/version
- Every
/v1answer carries aShiftlabs-Sdk-Versionheader, errors included: the version of the SDK the platform runs. Theshiftlabsnpm package has the same version. GET /v1/versionreturns{"sdk", "minimumCli", "environment"}: the SDK version, the oldestshiftlabsCLI the API accepts, and the platform's environment,productionatapi.shiftlabs.org.- A request whose
User-Agentisshiftlabs-cli/<version>, older thanminimumCli, returns426with{"error": "cli too old", "detail", "hint", "minimumCli"}before its key is checked.hintsays what to install. Other clients are never refused for their version.