shiftlabs Start free
Menu API reference

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.

Routes
RouteMethodMinimum role
/v1/me principal, workspace, limits, and entitlements: {paid, sso, byok, modelCatalog, seats}, what the workspace's plan includes; seats is null for no capGETviewer
/v1/me/sessions/revoke signs you out of every other dashboard session, in any workspace; {ended}; signed-in members onlyPOSTviewer
/v1/workspace {"name"}, 1 to 64 characters; auditedPATCHadmin
/v1/workspace/agents {"enabled"}: turns agents on or off; {on, chosen, override}PUTadmin
/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); auditedGET · PUTviewer · admin
/v1/workspace/approvals/slack {url} to connect Slack from the dashboard; Slack sends the browser back to Settings, which finishes with {code, state}POSTadmin
/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 SlackGET · PUT · DELETEadmin
/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 itPOST · DELETEapprover
/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); auditedGET · POSTadmin
/v1/approval-rules/:id PUT the whole rule, a version up; requests made under it keep it as it was; auditedPUT · DELETEadmin
/v1/approval-rules/order {"ids"}: every rule's id once, in the order to try them; auditedPUTadmin
/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); limitsGETviewer
/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 themGETviewer
/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 billingGETviewer
/v1/billing {"spendingLimitCents"}, 0 to 1,000,000: the Pro spending limit; 409 above spendingLimitMaxCents, 5,000 until the subscription's first monthly renewalPATCHadmin
/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 openPOSTadmin
/v1/billing/invoice {poNumber, taxIds}; PATCH {"poNumber"}, up to 140 characters, or null to remove it: the PO number and tax ID on invoicesGET · PATCHadmin
/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 nowGETviewer
/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 defaultPUTdeveloper
/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}POSTdeveloper
/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}DELETEdeveloper
/v1/workflows/:workflow/versionsGETviewer
/v1/workflows/:workflow/versions/:hash/source {hash, language, source}, and entry and files for a workflow of several files; auditedGETdeveloper
/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 runPOSTdeveloper
/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 keyGETviewer
/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 untakenPOSTdeveloper
/v1/workflows/:workflow/rollback {"hash"}: new runs use that versionPOSTdeveloper
/v1/workflows/:workflow/pause pauses the workflow: new runs are held, schedule ticks skipped, runs already started go on; {workflow, paused, pausedAt, pausedBy, heldRuns}; auditedPOSTdeveloper
/v1/workflows/:workflow/resume {"drop"?}: the held runs start in the order they arrived, or with drop end cancelled, unbilled; {workflow, paused, resumed, dropped}; auditedPOSTdeveloper
/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 runsPerDayPOSTdeveloper
/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 workflowGETdeveloper
/v1/releases {"workflows": {"name": "versionHash"}, "agents": {"name": definition}, "schedules"?: {"name": schedule}}: up to 50 staged workflow versions, any agents and every schedule, made current togetherGET · POSTviewer · developer
/v1/releases/:seqGETviewer
/v1/releases/:seq/rollback that release's versions and schedules, current again as a new releasePOSTdeveloper
/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 lacksPOSTadmin, 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 failedGETadmin, 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 workspacesGET · PUT · DELETEviewer · 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 itPATCHadmin, 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 backfillGETviewer
/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; auditedPOSTdeveloper
/v1/schedules/:schedule/trigger 202 {schedule, runId} or {schedule, conversationId}: one run or conversation now, whatever its overlap; 409 while the schedule is paused; auditedPOSTdeveloper
/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; auditedPOST · DELETEdeveloper
/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-BeforeGETviewer
/v1/workflows/:workflow/connections {"connections": [...]}GET · PUTviewer · developer
/v1/workflows/:workflow/vars/:NAME {"value"}; DELETE moves it to the trashPUT · DELETEdeveloper
/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 requiredGET · POSTviewer · developer
/v1/triggers/:id/rotate its delivery log moves to the new idPOSTdeveloper
/v1/triggers/:id {"signing"?: {"scheme", "secret"?} | null, "name"?, "description"?, "event"?: name | null, "adapter"?: {"kind", "config"} | null}, at least one; the URL staysPATCHdeveloper
/v1/triggers/:id its delivery log goes tooDELETEdeveloper
/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_viewGETdeveloper
/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 wholePOSTdeveloper
/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 beganGETviewer
/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}; auditedPOSTdeveloper
/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}POSTdeveloper
/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)GETviewer
/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-IDGETviewer
/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 itPOSTdeveloper
/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; auditedPOSTdeveloper
/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; auditedPOSTadmin
/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; auditedPOSTdeveloper
/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; auditedPOSTdeveloper
/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 keptPOSTdeveloper
/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 beGETviewer
/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 eventsPerRunPOSTdeveloper
/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 endsGETviewer
/v1/runs/:id/payload the delivered body; 410 after 14 days; auditedGETdeveloper
/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; auditedGETviewer
/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)GETviewer
/v1/secrets metadata, never valuesGETviewer
/v1/secrets/:NAME {"value", "hosts"?, "readable"?, "hmac"?, "workflows"?}; omitted workflows keep the scope; DELETE moves it to the trashPUT · DELETEadmin
/v1/secrets/:NAME {"hosts"?, "readable"?, "hmac"?, "workflows"?}; the value and its version stayPATCHadmin
/v1/connectionsGETviewer
/v1/connections/:name {"hosts", "template"}, OAuth 2.0 {"hosts", "oauth2", "template"?}, or TCP {"protocol": "tcp", "targets", "tls", "auth"?}; DELETE moves it to the trashPUT · DELETEadmin
/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 connectionPOST · DELETEadmin
/v1/varsGETviewer
/v1/vars/:NAME {"value"}; DELETE moves it to the trashPUT · DELETEdeveloper
/v1/trash what deletes put in the trash, newest first: [{kind, name, workflow, deletedAt, deletedBy, purgeAt}]GETadmin
/v1/trash/restore {"kind", "name", "workflow"?}: brings it back as it was, or deletes it for good and frees its name; auditedPOSTadmin
/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 daysGETadmin
/v1/audit/export?before= every entry as NDJSON, newest first: 100,000 a request, the rest from Next-BeforeGETadmin
/v1/metrics/runs?hours= · /v1/metrics/egress?hours=GETviewer
/v1/api-keys {"name", "role", "capabilities"?, "scope"?, "expiresInDays"?}GET · POSTadmin
/v1/api-keys/:idDELETEadmin
/v1/membersGETadmin
/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 confirmedPOSTadmin
/v1/members/:membershipId {"role", "confirmPaidSeat"?, "confirmCents"?}, refused into a kind of seat the plan has no room for, as an invitation is; auditedPATCH · DELETEadmin
/v1/members/:membershipId/sessions/revoke signs the member out of this workspace's dashboard; {ended}POSTadmin
/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 itGETviewer
/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; auditedPOSTadmin
/v1/sso/providers/:id ends the sessions it made; 409 for the last verified provider while single sign-on is enforced; auditedDELETEadmin
/v1/sso/domains/:domain/verification the TXT record that proves the domain: {recordName, recordValue}; auditedPOSTadmin
/v1/sso/domains/:domain/verify looks the TXT record up once: {verified: true}, or {verified: false, reason}; auditedPOSTadmin
/v1/sso/providers/:id/test {signInUrl}: the provider's sign-in link, a real sign-in; 409 until its domain is verifiedPOSTadmin
/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}; auditedPUTadmin
/v1/agents each agent's current version, stats and canChat, the helper first with builtIn: trueGETviewer
/v1/agents/:agent the definition; adds a version: {name, version, warnings}PUTdeveloper
/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}DELETEdeveloper
/v1/agents/:agent/code body: TypeScript whose default export is tools({...}); {codeHash, tools, sizeBytes, warnings}PUTdeveloper
/v1/agents/:agent/versions newest first, 50 at mostGETviewer
/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-BeforeGET · POSTviewer
/v1/agents/:agent/conversations/:conversation status, transcript, model use (USD) and approvals; ?person= for an end user'sGETviewer
/v1/agents/:agent/conversations/:conversation/messages {"text", "person"?}: the next message in your conversation; 202; takes an Idempotency-KeyPOSTviewer
/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}POSTdeveloper 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 resultsGETviewer
/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 restGETapprover 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 secondPOSTapprover 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 emailsGET · PUTadmin
/v1/alerts/testPOSTadmin
/v1/alerts/rotate-secret a new signingSecret, shown once; the old one stops workingPOSTadmin
/v1/alerts/clear-suppression {"email"}: alert emails try a bounced recipient againPOSTadmin
/v1/alerts/me {"optedOut"}: stops or restarts alert emails to you; signed-in members onlyGET · PUTviewer
/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 advertiseGETviewer
/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 outPOSTadmin
/v1/runners/tokens/:id its runners stop at once and the commands they were running failDELETEadmin

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
MemberRole
dana@ridgeline.exampleadmin
li@ridgeline.exampledeveloper
sam@ridgeline.exampleviewer

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"}.

Capabilities by minimum role
RoleCapabilities
viewerworkspace.view workflow.view run.view trigger.view secret.view connection.view var.view agent.view agent.chat
approver and admin, not developerapproval.decide
developerworkflow.source workflow.deploy workflow.pause run.payload run.start run.cancel trigger.manage var.manage agent.deploy conversation.read_others
adminworkspace.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 keyworkspace.link release.promote
none: listed in a developer or admin keyagent.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

developer

slk_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}. The key is shown only once. A name is 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). capabilities narrows it to some of what its role allows, for example ["workflow.deploy"] for a CI key, and is the only way to give a key agent.chat_as. scope limits 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 a capabilities list, can also give agent.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 no required or capability. A run or trigger of another workflow returns 404, as if it did not exist. GET /v1/me always answers.
  • A conversation a workflow started with ask is that workflow's: a key whose scope leaves it out gets 404 for 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_others on 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=1 returns 403 with the reason above, and another person's conversation and its stream return 404. So do MCP's list_conversations with all and get_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 workflows and starts nothing. The helper's deploy_workflow, run_workflow and create_trigger for 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 returns 403 with that reason.
  • A workspace holds at most 20 active keys. GET /v1/api-keys lists metadata only, and last_used_at updates at most once a minute. Revoke a key with DELETE /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 429 with Retry-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/revoke does the same and answers {ended, grants}: the sessions and the MCP connections it ended. An API key gets 403.
  • 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 as card_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.call and re-runs are refused as workflow not found. Its source can't be read. Runs in flight finish on their version, and their ctx.state writes are refused. Its run history stays. An agent answers as agent 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.activity and an agent's providerKey treat 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. DELETE answers purgeAt, 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.

json409
{
  "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 409 with the item in trash and a hint. Match on the trash field, not the text.
  • That covers PUT /v1/workflows/:workflow, staged too, PUT /v1/agents/:agent, PUT /v1/agents/:agent/code, POST /v1/releases and rollbacks to a release that names it, promotions into the workspace, PUT /v1/secrets/:NAME, PUT /v1/connections/:name and PUT /v1/vars/:NAME. While a workflow is in the trash, PUT /v1/workflows/:workflow/vars/:NAME and PUT /v1/workflows/:workflow/connections for it return the same 409. 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 deploy prints the message and the hint and exits 7. See Errors.
  • GET /v1/trash lists the trash, newest deletion first: [{kind, name, workflow, deletedAt, deletedBy, purgeAt}]. kind is workflow, agent, secret, connection or var. workflow is a var's workflow, and null for a workspace var and every other kind. deletedBy is the email or API key id that deleted it.
  • POST /v1/trash/restore and POST /v1/trash/purge take {"kind", "name", "workflow"?}. Send workflow only for a workflow's var. A restore answers {restored: {kind, name, workflow}}, and for a workflow also triggers, how many came back live. A purge answers {purged: {kind, name, workflow}}. Either returns 404 {"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, connections or tcpTargets. A connection whose secrets no longer exist returns 409 with their names in missing. Restore or create them first. A workflow's var returns 409 with trash while 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_delete and var_delete, and an agent's as agent_delete, with how many conversations stopped and approvals were withdrawn. A restore is workflow_restore, agent_restore, secret_restore, connection_restore or var_restore, with by, a var's workflow, and for a workflow how many vars and connections came back. A purge is workflow_purge, agent_purge, secret_purge, connection_purge or var_purge, with by: the admin, or expiry after 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.

Request rates
RequestsLimitCountedRetry-After
Any request to the API or dashboard600 a minuteper IP60
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 minuteper IP60
Sign-in pages: each password, authenticator code and sign-up or password email, right or wrong10 a minute for one account, 60 for allper IP60
/v1 calls, from API keys, MCP tool calls and the dashboard1,200 a minuteper workspace60
/v1 calls with chat tokens, counted apart from the row above1,200 a minute, and 120 for each personper workspace60
Run logs and log stream reads, timelines and egress, and /v1/metrics a read repeated within 10 seconds is served from cache and not counted120 a minuteper workspace60
Run status and log streams opened, GET /v1/runs/:id/status/stream and /logs/stream60 a minuteper workspace60
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 for20 a minuteper workspace60
Code checks, POST /v1/workflows/:workflow/validate, which deploy nothing20 a minuteper workspace60
Member invitations5 a minuteper workspace60
Agent messages, starting or adding to a conversation30 a minuteper workspace60
Agent messages from one person, API key or end user10 a minuteper person60
Test alerts, POST /v1/alerts/test1 a minuteper workspace60
Exports, GET /v1/runs/export, /v1/audit/export and /v1/usage/export10 a minuteper workspace60
Webhook deliveries to one trigger100 per 10 secondsper trigger10
Events sent to one run's event URLs100 per 10 secondsper run10
Webhook deliveries to all of a workspace's triggers and event URLs300 per 10 secondsper workspace10
Any request to shiftlabs.org or its subdomains the IP is blocked for 10 seconds, and the body is not our JSON150 per 10 secondsper IPwait 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 RateLimit or X-RateLimit headers. Retry-After is 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). Its Retry-After is 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 at stepsPerDay or cpuSecondsPerDay, 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 503 with {"error": "runs paused", "detail", "retryAt"} and a Retry-After. Over MCP the error result starts with HTTP 503, and an agent's tool call fails with New runs are paused. Try again after <time>.. Runs already started continue, and runs waiting to start wait. Retry after Retry-After. Webhook senders that retry on 5xx deliver later.
  • During announced platform maintenance, every request that changes something returns 503 with {"error": "under maintenance", "detail"} and Retry-After: 60: every method but GET, from API keys, chat tokens, MCP tools and the dashboard, and signing in to the dashboard. Nothing was changed, so send it again after Retry-After. Reads continue, and so do webhook deliveries, the runs they start and runs already started. Over MCP the error result starts with HTTP 503.
  • On Pro, past the spending limit or while a payment is failing, starting a run or sending an agent message returns 429 with {"error": "spending limit reached", "detail"} or {"error": "payment failed", "detail"}, and Retry-After: 3600.
  • A message to an agent past its own monthly budget returns 429 with {"error": "monthly budget reached", "monthlyUsd"}, and Retry-After until the UTC month ends.
  • A message from an end user past the agent's daily budget for each end user returns 429 with {"error": "daily budget reached", "detail", "endUserDailyUsd", "resetsAt"}, a chat token's without the amount or resetsAt, and Retry-After until 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 503 with {"error": "temporarily unavailable"} and Retry-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 same Idempotency-Key are safe to send again. Over MCP the error result starts with HTTP 503. Webhook senders that retry on 5xx deliver later.
  • A deploy whose code takes more than 60 seconds to load returns 503 with {"error": "temporarily unavailable"}, a detail, and Retry-After: 30, and so do an agent's code upload, an agent deploy or release that names code, 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 503 with {"error": "temporarily unavailable"}, a detail, and Retry-After: 5. It started no run and changed nothing. See Deploy and triggers.
  • Package builds answer 429 too: 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"}, with Retry-After until 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"}, with Retry-After: 30. Its builds run one at a time, and each fails after 3 minutes. Follow a waiting deploy at GET /v1/deploys/:id.
  • Over MCP, a refused tool call returns an error result that starts with HTTP 429, without Retry-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.

Pages
ListNext page's cursorPageLargest limit
GET /v1/runsnextBefore in the body50100
GET /v1/auditNext-Before header100500
GET /v1/approvalsNext-Before header100100
GET /v1/deploysNext-Before header50100
GET /v1/agents/:agent/conversationsNext-Before header50100
GET /v1/runs/:id/logs, oldest firstNext-After header5002,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-After back as ?after=. Every page with lines has one, so a page shorter than limit holds the lines so far, and the same cursor later gets the lines that came since. See Logs.
  • A page can hold fewer than limit rows 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/export and GET /v1/usage/export answer NDJSON, one JSON object per line, as a file to download.
  • The runs export takes the filters of GET /v1/runs but q, time range and tags included, and its lines are the runs that list shows. q answers 400: an export reads every run that matches.
  • An export reads up to 100,000 runs or entries, newest first. When more remain, Next-Before holds where the next export starts. Send it back as ?before=.
  • A workspace can start 10 exports a minute. See Rate limits.
  • ?payloads=1 adds each run's payload, null once erased after 14 days. It needs developer or above, reads up to 5,000 runs, and is written to the audit log as payload_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"} with Retry-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.

json · shellMCP
// 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 /v1 request 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_event and send_workflow_event.
  • rerun takes a run id, an optional version, same or current, and an optional payload that replaces the run's; see Re-run a run.
  • list_trigger_deliveries takes a trigger id, and optional before and bodies, and lists its delivery log. replay_delivery takes the trigger's id and a delivery from it and delivers it again. send_test_event takes a trigger id and an optional payload, {} by default.
  • cancel_run takes a run id and cancels it, which runs the workflow's onCancel for a started run, and an optional undo that also runs the run's undo handlers. pause_workflow takes a workflow and pauses it. resume_workflow takes a workflow and an optional drop, which ends its held runs instead of starting them. No tool terminates a run: an admin does that in the dashboard or with POST /v1/runs/:id/terminate.
  • pause_run and unpause_run take a run id and pause it where it is or let it go on. retry_run takes a run id and does Retry now. resume_run takes a failed run's id and an optional step, occurrence and version, same or current, and resumes it as a new run from that step, by default the one it failed at, on the run's own version unless version is current.
  • pause_schedule takes a schedule and an optional note, and resume_schedule, trigger_schedule and stop_backfill a schedule. backfill_schedule takes a schedule, from and an optional to. See Pause, trigger or backfill a schedule.
  • get_run_status takes a run id and returns its status and the events it waits for. send_event takes a run id, an event name and optional data, and sends the run that event.
  • run_workflow takes an optional idempotencyKey. Calling it again with the same key within 24 hours returns the first run instead of starting another.
  • get_run_logs takes a run id, an optional limit, up to 2,000, and an optional after, and returns {lines, nextAfter}: the lines, oldest first, and the cursor to pass back as after for the lines after them, since a tool can't read the Next-After header. Fewer lines than limit means you have every line so far; the same nextAfter later returns the lines that came since. A page with no lines gives back the after you sent, or null without one.
  • get_open_run takes a workflow and a key, and returns the keyed workflow's open run for that key. list_runs takes a key with its workflow. send_workflow_event takes a workflow, an event name, an optional key and optional data, and sends the event to the key: the key's open run gets it, or the data starts one. create_trigger takes an optional event, which makes a keyed workflow's deliveries that event, and an optional adapter, {kind, config}, which makes each delivery's JSON body an event; it needs signing with a scheme that adapter lists. list_triggers shows each trigger's adapter, or null.
  • list_workflows returns each workflow's payload_schema. run_workflow says a payload must match it, and a payload that fails it gets the API's 400 with 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_message starts a conversation, or adds to one when you pass conversation. The agent answers in the background, so read its reply with get_conversation.
  • With a key that holds agent.chat_as, list_conversations, get_conversation and send_message take person and 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_secrets returns 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 in workflows has workflow, failed, refused (counts by limit: runsPerDay, concurrentRuns, concurrencyQueue, stepsPerDay or cpuSecondsPerDay) and up to 3 runs, each with id, error and url. Set workflows on PUT /v1/alerts to some workflow names, or null for all, and refusals: true to include runs refused at a limit. A test alert has "test": true.

  • approvals.waiting

    {id, type, test, workspace, count, text, requests, approvalsUrl, settingsUrl}. count is how many requests are still waiting. Up to 3 requests have kind, id, requestedAt and expiresAt: an agent's (kind agent) also agent, tool and askedBy, a workflow run's (kind workflow) workflow, name, runId and runUrl, a promotion's (kind promotion) the promoting workspace, its release and askedBy. 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": false on PUT /v1/alerts turns 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's status: to refresh_failed or revoked, with error saying why, or back to connected, with error null. One per change, sent at once to the same emails and webhook, whatever workflows says. An admin's own connect or disconnect sends none.

javascriptNode.js
// 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>, where v1 is HMAC-SHA256 of <t>.<body> keyed with the whole secret, whsec_ included. It is the header a trigger with shiftlabs signing checks. Reject a t more than 5 minutes off.
  • The secret is made when you save a webhook and the workspace has none. It is returned once, as signingSecret in that answer, and GET /v1/alerts never returns it. POST /v1/alerts/rotate-secret returns 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 same id, and is signed when it is sent.
  • GET /v1/alerts lists the last 20 attempts in deliveries, newest first, each with at, id, kind, attempt, status or error, final and retryAt.
  • 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/alerts then returns emailPaused with until (Unix milliseconds) and limit.

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/me with {"optedOut": true} stops them, and {"optedOut": false} turns them back on. GET /v1/alerts/me returns email, recipient, optedOut, optedOutAt and suppressed. Any member can, for themselves only, while signed in. An API key gets 403.
  • GET /v1/alerts lists who stopped them in optedOut, each with userId, email and at. An admin can't add them back: PUT /v1/alerts returns 409. 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/alerts lists the recipients this affects in suppressed, each with email, reason (bounced, complained or suppressed), detail and at.
  • POST /v1/alerts/clear-suppression with {"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 as alerts_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. v1 keeps working beside it until it is deprecated as below.

  • Deprecation

    Anything we will remove is announced on the changelog. Its responses carry Deprecation and Sunset headers at least 90 days before it is removed. Sunset gives the date it stops working.

shellcurl
# No API key needed. Answers {"sdk": "0.4.0", "minimumCli": "0.1.0", "environment": "production"}.
curl https://api.shiftlabs.org/v1/version
  • Every /v1 answer carries a Shiftlabs-Sdk-Version header, errors included: the version of the SDK the platform runs. The shiftlabs npm package has the same version.
  • GET /v1/version returns {"sdk", "minimumCli", "environment"}: the SDK version, the oldest shiftlabs CLI the API accepts, and the platform's environment, production at api.shiftlabs.org.
  • A request whose User-Agent is shiftlabs-cli/<version>, older than minimumCli, returns 426 with {"error": "cli too old", "detail", "hint", "minimumCli"} before its key is checked. hint says what to install. Other clients are never refused for their version.