{"openapi":"3.1.0","info":{"title":"Reminix API","version":"1.0.0","description":"The Reminix API. Every rule below has a page in the [docs](https://reminix.com/docs/).\n\n- **Authentication:** send `Authorization: Bearer <token>` — a workspace API key, or a personal access token plus `X-Workspace: <workspace-slug>`. [Authentication](https://reminix.com/docs/authentication/)\n- **Errors:** every error has the same shape, `{ \"error\": { \"code\", \"message\" } }`; branch on `code`. [Errors](https://reminix.com/docs/errors/)\n- **Pagination:** lists take `limit` and `cursor`; pass back `nextCursor` until it is `null`. [Pagination](https://reminix.com/docs/pagination/)\n- **Rate limits:** too many requests answer `429` with `Retry-After`. [API rate limits](https://reminix.com/docs/errors/#api-rate-limits)\n- **Idempotency:** send an `Idempotency-Key` header to retry a write safely. [Idempotency](https://reminix.com/docs/idempotency/)"},"security":[{"apiKey":[]},{"pat":[]}],"components":{"securitySchemes":{"apiKey":{"type":"http","scheme":"bearer","description":"Workspace API key (create under Settings → API keys in the app)."},"pat":{"type":"http","scheme":"bearer","description":"Personal access token (create under Account → API tokens in the app). Acts as the user: on workspace routes send `X-Workspace: <workspace-slug>`; the token's scopes (workspaces, `<family>:<read|write>` scopes) apply. On /v1/user/* it is the only credential."}},"schemas":{"UserMe":{"type":"object","properties":{"id":{"type":"string","example":"k3TAiF2ZP5sQxWbVJd8mR1cyNGuh4Eo9"},"name":{"type":"string","example":"Casey Customer"},"email":{"type":"string","example":"casey@example.com"},"workspaces":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string","example":"Acme Inc."},"slug":{"type":"string","example":"acme"},"role":{"type":"string","example":"owner"}},"required":["id","name","slug","role"]}}},"required":["id","name","email","workspaces"]},"ErrorEnvelope":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","example":"unauthorized"},"message":{"type":"string","example":"Unauthorized"},"requestId":{"type":"string"},"docs":{"type":"string","description":"Link to this error code's entry in the documentation — how to fix it.","example":"https://example.com/docs/errors/#unauthorized"},"details":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["code","message"]}},"required":["error"]},"Workspace":{"type":"object","properties":{"id":{"type":"string","example":"k3TAiF2ZP5sQxWbVJd8mR1cyNGuh4Eo9"},"name":{"type":"string","example":"Acme Inc."}},"required":["id","name"]},"AuditEventPage":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/AuditEvent"}},"nextCursor":{"type":["string","null"],"description":"Pass as ?cursor= to fetch the next page."}},"required":["items","nextCursor"]},"AuditEvent":{"type":"object","properties":{"id":{"type":"string","example":"evt_k3TAiF2ZP5sQxWbV"},"action":{"type":"string","example":"member.invited"},"actorType":{"type":"string","example":"user","description":"Who is accountable: `user`, `staff`, `system` or `api_key`."},"credential":{"type":["object","null"],"properties":{"type":{"type":"string","example":"pat","description":"`api_key` or `pat`."},"name":{"type":["string","null"],"example":"ci"}},"required":["type","name"],"description":"The API credential the action came through, as named when it happened; null for actions taken in the app."},"createdAt":{"type":"string","example":"2026-08-19T12:00:00.000Z"}},"required":["id","action","actorType","credential","createdAt"]},"MemberPage":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/Member"}},"nextCursor":{"type":["string","null"],"description":"Pass as ?cursor= to fetch the next page."}},"required":["items","nextCursor"]},"Member":{"type":"object","properties":{"id":{"type":"string","description":"The membership's id."},"userId":{"type":"string"},"name":{"type":"string"},"email":{"type":"string"},"role":{"type":"string","example":"member","description":"`owner`, `admin`, `member` or `guest`."},"joinedAt":{"type":"string","example":"2026-08-19T12:00:00.000Z"}},"required":["id","userId","name","email","role","joinedAt"]},"InvitationPage":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/Invitation"}},"nextCursor":{"type":["string","null"],"description":"Pass as ?cursor= to fetch the next page."}},"required":["items","nextCursor"]},"Invitation":{"type":"object","properties":{"id":{"type":"string"},"email":{"type":"string"},"role":{"type":["string","null"],"example":"member"},"teamIds":{"type":"array","items":{"type":"string"},"description":"Teams the person joins on accepting (besides the default team, unless a guest)."},"expiresAt":{"type":"string","example":"2026-08-21T12:00:00.000Z"},"createdAt":{"type":"string","example":"2026-08-19T12:00:00.000Z"}},"required":["id","email","role","teamIds","expiresAt","createdAt"]},"ApprovalRequest":{"type":"object","properties":{"id":{"type":"string"},"action":{"type":"string","example":"workspace.apiKey.create"},"title":{"type":"string"},"summary":{"type":"string","description":"Exactly what will happen, as the person reads it."},"input":{"type":"object","additionalProperties":{}},"reason":{"type":"string"},"status":{"type":"string","enum":["pending","approved","completed","denied","failed","expired"],"description":"`approved` = waiting for the CLI to redeem it (a secret-producing action asked from the CLI)."},"requestedBy":{"type":["string","null"]},"expiresAt":{"type":"string"},"createdAt":{"type":"string"},"decidedAt":{"type":["string","null"]},"result":{"type":["object","null"],"additionalProperties":{},"description":"The outcome — never a secret."},"secret":{"type":["object","null"],"properties":{"name":{"type":"string"},"envVar":{"type":"string"}},"required":["name","envVar"],"description":"Set when the action creates a secret."},"approveUrl":{"type":"string","description":"Where a person approves or denies it — show it to them."}},"required":["id","action","title","summary","input","reason","status","requestedBy","expiresAt","createdAt","decidedAt","result","secret","approveUrl"]},"WorkspaceUsage":{"type":"object","properties":{"periodStart":{"type":"string","example":"2026-10-17T14:30:00.000Z","description":"When this period began: a month after the last, from the billing date."},"periodEnd":{"type":"string","example":"2026-11-17T14:30:00.000Z","description":"When the counts reset."},"meters":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","example":"webhook_deliveries"},"description":{"type":"string"},"used":{"type":"integer"},"limit":{"type":["integer","null"],"description":"The plan's limit this period; null = unlimited."}},"required":["id","description","used","limit"]}},"notices":{"type":"array","items":{"type":"string"},"description":"Things to know about these numbers, such as some usage being unavailable right now."}},"required":["periodStart","periodEnd","meters"]},"TeamPage":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/Team"}},"nextCursor":{"type":["string","null"],"description":"Pass as ?cursor= to fetch the next page."}},"required":["items","nextCursor"]},"Team":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"isDefault":{"type":"boolean","description":"The team every member (not guests) belongs to."},"memberIds":{"type":"array","items":{"type":"string"},"description":"The user ids of the team's members."},"createdAt":{"type":"string","example":"2026-08-19T12:00:00.000Z"}},"required":["id","name","isDefault","memberIds","createdAt"]},"WebhookEndpointPage":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/WebhookEndpoint"}},"nextCursor":{"type":["string","null"],"description":"Pass as ?cursor= to fetch the next page."}},"required":["items","nextCursor"]},"WebhookEndpoint":{"type":"object","properties":{"id":{"type":"string","example":"we_3f0c…"},"url":{"type":"string","example":"https://example.com/hooks"},"description":{"type":["string","null"]},"enabled":{"type":"boolean","description":"False after 20 failed attempts in a row (retries count); re-enable to resume."},"eventTypes":{"type":["array","null"],"items":{"type":"string"},"description":"The event types it receives (see event-types); null = every event."},"environment":{"type":["string","null"],"example":"live","description":"The environment it belongs to, where the product has them: it receives only that environment's events and is managed with a credential acting in it. Null otherwise."},"consecutiveFailures":{"type":"integer"},"lastStatus":{"type":["integer","null"]},"lastAttemptAt":{"type":["string","null"]},"createdAt":{"type":"string"}},"required":["id","url","description","enabled","eventTypes","environment","consecutiveFailures","lastStatus","lastAttemptAt","createdAt"]},"WebhookEndpointCreated":{"type":"object","properties":{"endpoint":{"$ref":"#/components/schemas/WebhookEndpoint"},"secret":{"type":"string"}},"required":["endpoint","secret"]},"WebhookDeliveryOutcome":{"type":"object","properties":{"deliveryId":{"type":"string"},"queued":{"type":"boolean","description":"True when queued for delivery (with retries); false when attempted immediately."},"ok":{"type":"boolean","description":"When attempted immediately: whether it was accepted."},"status":{"type":["integer","null"]}},"required":["deliveryId","queued"]},"WebhookDeliveryPage":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/WebhookDelivery"}},"nextCursor":{"type":["string","null"],"description":"Pass as ?cursor= to fetch the next page."}},"required":["items","nextCursor"]},"WebhookDelivery":{"type":"object","properties":{"id":{"type":"string","example":"del_8a1b…"},"eventId":{"type":"string","example":"evt_51c2…"},"eventType":{"type":"string","example":"workspace.member.joined"},"status":{"type":"string","example":"delivered","description":"`pending`, `delivered` or `failed`."},"attempts":{"type":"integer"},"lastStatus":{"type":["integer","null"]},"lastAttemptAt":{"type":["string","null"]},"createdAt":{"type":"string"}},"required":["id","eventId","eventType","status","attempts","lastStatus","lastAttemptAt","createdAt"]},"ScriptPage":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/Script"}},"nextCursor":{"type":["string","null"],"description":"Pass as ?cursor= to fetch the next page."}},"required":["items","nextCursor"]},"Script":{"type":"object","properties":{"id":{"type":"string","example":"cap_3f0c…"},"slug":{"type":"string","example":"unlock-account"},"name":{"type":"string","example":"Unlock an account"},"description":{"type":"string"},"status":{"type":"string","enum":["draft","published","archived"]},"ownerUserId":{"type":["string","null"]},"publishedVersion":{"type":["integer","null"],"description":"The version runs use; null until one is published."},"access":{"type":"string","enum":["workspace","teams"],"description":"Who may see and run it: everyone in the workspace, or only `teamIds`."},"teamIds":{"type":"array","items":{"type":"string"}},"approvalPolicy":{"type":"string","enum":["none","agents","always"],"description":"Which runs wait for a person: none, those started by agents, or all."},"inputSchema":{"type":["object","null"],"additionalProperties":{},"description":"The published version's input schema — what a run takes; null until one is published."},"tags":{"type":"array","items":{"type":"string"},"example":["support","accounts"]},"stats":{"$ref":"#/components/schemas/ScriptStats"},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","slug","name","description","status","ownerUserId","publishedVersion","access","teamIds","approvalPolicy","inputSchema","tags","stats","createdAt","updatedAt"]},"ScriptStats":{"type":"object","properties":{"runs30d":{"type":"integer"},"successRate":{"type":["number","null"],"description":"Of finished runs in 30 days, the share that succeeded (0–1)."},"lastRunAt":{"type":["string","null"]},"people30d":{"type":"integer","description":"Different people who ran it in 30 days."},"interfaces":{"type":"object","additionalProperties":{"type":"integer"},"description":"Runs in 30 days by where they came from (app, api, cli, mcp, schedule, trigger)."}},"required":["runs30d","successRate","lastRunAt","people30d","interfaces"]},"ScriptDetail":{"allOf":[{"$ref":"#/components/schemas/Script"},{"type":"object","properties":{"readme":{"type":["string","null"],"description":"The published version's README (markdown); null without one."},"usedBy":{"type":"object","properties":{"people":{"type":"array","items":{"type":"object","properties":{"userId":{"type":"string"},"name":{"type":"string"},"runs":{"type":"integer"}},"required":["userId","name","runs"]}},"schedules":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"cron":{"type":"string"},"enabled":{"type":"boolean"}},"required":["id","name","cron","enabled"]}},"triggers":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"eventType":{"type":"string"},"enabled":{"type":"boolean"}},"required":["id","name","eventType","enabled"]}},"followedBy":{"type":"array","items":{"type":"object","properties":{"script":{"type":"object","properties":{"slug":{"type":"string"},"name":{"type":"string"}},"required":["slug","name"]},"trigger":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"eventType":{"type":"string"}},"required":["id","name","eventType"]}},"required":["script","trigger"]},"description":"Other scripts' triggers that fire on its runs."}},"required":["people","schedules","triggers","followedBy"]}},"required":["readme","usedBy"]}]},"ScriptInput":{"type":"object","properties":{"slug":{"type":"string","example":"unlock-account","description":"Its id in URLs and commands: lowercase letters, digits and dashes, unique in the workspace."},"name":{"type":"string","minLength":1,"maxLength":100,"example":"Unlock an account","description":"What people see in the app."},"description":{"type":"string","maxLength":1000,"description":"What it does, in a sentence or two."}},"required":["slug","name"]},"ScriptPatch":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":100,"description":"What people see in the app."},"description":{"type":"string","maxLength":1000,"description":"What it does, in a sentence or two."},"access":{"type":"string","enum":["workspace","teams"],"description":"`workspace`: every member may see and run it. `teams`: only members of `teamIds` (and owners and admins)."},"teamIds":{"type":"array","items":{"type":"string"},"maxItems":50,"description":"With `access: teams`: the teams whose members may see and run it."},"tags":{"type":"array","items":{"type":"string"},"maxItems":10,"example":["support","accounts"],"description":"Up to 10; lowercase letters, digits and dashes."},"approvalPolicy":{"type":"string","enum":["none","agents","always"],"description":"Which runs wait for a person's approval: `none`, `agents` (runs started through an agent's token) or `always`."}}},"ScriptVersion":{"type":"object","properties":{"id":{"type":"string","example":"ver_9d2e…"},"number":{"type":"integer","example":3},"command":{"type":"string","example":"python unlock.py {email}","description":"What a run executes, with its inputs in `{…}`."},"build":{"type":["string","null"],"description":"The install command that replaced the usual one (requirements.txt, package.json); null: the usual one."},"buildLog":{"type":["string","null"],"description":"What installing its dependencies printed (the end)."},"inputSchema":{"type":"object","additionalProperties":{},"description":"A JSON Schema document."},"outputSchema":{"type":["object","null"],"additionalProperties":{},"description":"A JSON Schema document."},"archiveBytes":{"type":"integer","description":"The size of its folder with dependencies, compressed."},"archiveSha256":{"type":"string"},"timeoutSeconds":{"type":"integer","description":"How long a run may take; over 30 s it is a long run."},"hosts":{"type":"array","items":{"type":"string"},"description":"The only hosts its code may reach; empty: no network."},"secrets":{"type":"object","additionalProperties":{"$ref":"#/components/schemas/SecretUse"},"description":"Secrets attached to its requests, by name — never given to the code."},"env":{"type":"array","items":{"type":"string"},"description":"Secrets its code reads as plain values (each must allow it)."},"createdVia":{"type":"string","enum":["cli","api","app"]},"published":{"type":"boolean","description":"Whether runs use it now."},"publishedAt":{"type":["string","null"]},"createdAt":{"type":"string"}},"required":["id","number","command","build","buildLog","inputSchema","outputSchema","archiveBytes","archiveSha256","timeoutSeconds","hosts","secrets","env","createdVia","published","publishedAt","createdAt"]},"SecretUse":{"type":"object","properties":{"hosts":{"type":"array","items":{"type":"string"},"example":["api.yourapp.com"],"description":"Where it is attached: of these, the hosts the run's environment's value may go to."},"header":{"type":"string","example":"Authorization"},"value":{"type":"string","example":"Bearer {secret}","description":"The header's value; `{secret}` is replaced."}},"required":["hosts","header","value"]},"ScriptVersionInput":{"type":"object","properties":{"command":{"type":"string","minLength":1,"maxLength":2000,"example":"python unlock.py {email}","description":"What a run executes. `{name}` is an input; `[ … ]` is left out when its inputs are empty. Run as arguments, never through a shell. Omitted: worked out from the folder, or a 400 saying what to add."},"build":{"type":["string","null"],"maxLength":2000,"example":"pip install -r requirements.txt","description":"Replaces the usual install (requirements.txt, else pyproject.toml, into .deps; package.json with npm). Runs in the folder with the package registries reachable."},"inputSchema":{"type":"object","additionalProperties":{},"description":"The inputs, as JSON Schema. Omitted: a required text input for each `{name}` in the command (optional inside `[ … ]`)."},"outputSchema":{"type":["object","null"],"additionalProperties":{},"description":"A JSON Schema document."},"archive":{"type":"string","description":"The script's folder as a .tar.gz, base64 — at most 10 MB, without its dependencies."},"hosts":{"type":"array","items":{"type":"string"},"example":["api.yourapp.com"],"description":"The only hosts the script may reach (HTTPS). Omitted: no network."},"secrets":{"type":"object","additionalProperties":{"$ref":"#/components/schemas/SecretUseInput"},"description":"Secrets to attach to requests to some of `hosts`, by name. In each environment, the secret's value must allow at least one of them."},"env":{"type":"array","items":{"type":"string"},"description":"Secrets the script reads as environment variables (only those whose owner allowed it)."},"timeout":{"type":"integer","minimum":1,"maximum":900,"example":600,"description":"Seconds a run may take (default 30). Over 30 makes a LONG script: runs answer 202 at once and run durably, with live logs and progress, and can be cancelled."},"readme":{"type":["string","null"],"maxLength":100000,"description":"README.md (markdown), shown on the script's page while this version is published."},"tags":{"type":"array","items":{"type":"string"},"maxItems":10,"example":["support","accounts"],"description":"When given, become the script's tags."},"via":{"type":"string","enum":["cli","api","app"],"description":"How it was uploaded (for the history). Default: api."}},"required":["archive"]},"SecretUseInput":{"type":"object","properties":{"hosts":{"type":"array","items":{"type":"string"},"example":["api.yourapp.com","api.staging.yourapp.com"],"description":"Some of the version's hosts. A run attaches the secret to those its environment's value may go to."},"host":{"type":"string","example":"api.yourapp.com","description":"One host, instead of `hosts`."},"header":{"type":"string","example":"Authorization"},"value":{"type":"string","example":"Bearer {secret}","description":"The header's value; `{secret}` is replaced. Default: `{secret}`."}},"required":["header"]},"PublishRequested":{"type":"object","properties":{"approval":{"type":"object","properties":{"id":{"type":"string"},"approveUrl":{"type":"string"}},"required":["id","approveUrl"]}},"required":["approval"]},"ScriptSettings":{"type":"object","properties":{"publishNeedsSecondPerson":{"type":"boolean","description":"Publishing needs a person other than the one who asks: a publish becomes a request an owner or admin approves."}},"required":["publishNeedsSecondPerson"]},"ScriptSettingsPatch":{"type":"object","properties":{"publishNeedsSecondPerson":{"type":"boolean","description":"Publishing needs a person other than the one who asks: a publish becomes a request an owner or admin approves."}}},"Schedule":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"environment":{"type":"string","example":"production","description":"The environment its runs use."},"cron":{"type":"string","example":"0 8 1 * *"},"timezone":{"type":"string","example":"Europe/Berlin"},"inputs":{"type":"object","additionalProperties":{}},"enabled":{"type":"boolean"},"disabledReason":{"type":["string","null"],"description":"Why the system switched it off (its creator lost access, …)."},"createdByUserId":{"type":["string","null"]},"nextRunAt":{"type":["string","null"]},"lastRunAt":{"type":["string","null"]},"lastRunId":{"type":["string","null"]}},"required":["id","name","environment","cron","timezone","inputs","enabled","disabledReason","createdByUserId","nextRunAt","lastRunAt","lastRunId"]},"ScheduleInput":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":100,"example":"First of the month","description":"A name for the schedule, shown in the app."},"cron":{"type":"string","minLength":1,"maxLength":100,"example":"0 8 1 * *","description":"When it runs, as a cron expression (minute hour day month weekday)."},"timezone":{"type":"string","example":"Europe/Berlin","description":"The timezone the cron is read in. Default: UTC."},"inputs":{"type":"object","additionalProperties":{},"description":"The script's inputs for each run, by name."},"environment":{"type":"string","description":"The environment its runs use. Default: the request's (X-Environment), else the workspace's default."}},"required":["name","cron"]},"SchedulePatch":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":100,"description":"A name for the schedule, shown in the app."},"cron":{"type":"string","minLength":1,"maxLength":100,"example":"0 8 1 * *","description":"When it runs, as a cron expression (minute hour day month weekday)."},"timezone":{"type":"string","example":"Europe/Berlin","description":"The timezone the cron is read in. Default: UTC."},"inputs":{"type":"object","additionalProperties":{},"description":"The script's inputs for each run, by name."},"enabled":{"type":"boolean","description":"Whether it runs. Default: true."},"environment":{"type":"string","description":"Move its runs to another environment."}}},"Trigger":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"environment":{"type":"string","example":"production","description":"The environment its runs use."},"eventType":{"type":"string","example":"run.failed"},"filter":{"type":"object","additionalProperties":{},"description":"Event data fields (dotted paths) that must equal these values.","example":{"script.slug":"nightly-sync"}},"inputs":{"type":"object","additionalProperties":{},"description":"Inputs for the run; a value \"{{event.data.<path>}}\" takes it from the event."},"enabled":{"type":"boolean"},"disabledReason":{"type":["string","null"]},"createdByUserId":{"type":["string","null"]},"lastFiredAt":{"type":["string","null"]}},"required":["id","name","environment","eventType","filter","inputs","enabled","disabledReason","createdByUserId","lastFiredAt"]},"TriggerInput":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":100,"example":"Nightly sync failed","description":"A name for the trigger, shown in the app."},"eventType":{"type":"string","minLength":1,"example":"run.failed","description":"The event that starts a run: any webhook event type, such as run.failed."},"filter":{"type":"object","additionalProperties":{},"description":"Event data fields (dotted paths) that must equal these values.","example":{"script.slug":"nightly-sync"}},"inputs":{"type":"object","additionalProperties":{},"example":{"runId":"{{event.data.runId}}","error":"{{event.data.error}}"},"description":"The script's inputs for each run, by name; a value \"{{event.data.<path>}}\" takes it from the event."},"environment":{"type":"string","description":"The environment its runs use. Default: the request's (X-Environment), else the workspace's default."}},"required":["name","eventType"]},"TriggerPatch":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":100,"description":"A name for the trigger, shown in the app."},"filter":{"type":"object","additionalProperties":{},"description":"Event data fields (dotted paths) that must equal these values.","example":{"script.slug":"nightly-sync"}},"inputs":{"type":"object","additionalProperties":{},"example":{"runId":"{{event.data.runId}}","error":"{{event.data.error}}"},"description":"The script's inputs for each run, by name; a value \"{{event.data.<path>}}\" takes it from the event."},"enabled":{"type":"boolean","description":"Whether it fires. Default: true."},"environment":{"type":"string","description":"Move its runs to another environment."}}},"Run":{"type":"object","properties":{"id":{"type":"string","example":"run_7b1a…"},"script":{"type":"object","properties":{"id":{"type":"string"},"slug":{"type":"string"}},"required":["id","slug"]},"version":{"type":"integer","description":"The version it ran."},"environment":{"type":"string","example":"production","description":"The environment it ran in — its secret values and rules (its name then). Choose it with the X-Environment header."},"status":{"type":"string","enum":["awaiting_approval","running","succeeded","failed","cancelled"],"description":"`awaiting_approval`: held for a person (see `approvalRequestId`); `cancelled`: the approval was denied or expired."},"inputs":{},"output":{"description":"What the script returned (JSON); null on failure."},"error":{"type":["string","null"]},"startedBy":{"type":"object","properties":{"userId":{"type":["string","null"],"description":"The person; null for a workspace API key."},"credentialType":{"type":["string","null"]},"credentialName":{"type":["string","null"]}},"required":["userId","credentialType","credentialName"]},"interface":{"type":"string","enum":["app","api","cli","mcp","schedule","trigger"]},"approvalRequestId":{"type":["string","null"]},"scheduleId":{"type":["string","null"],"description":"The schedule that started it, if one did."},"triggerId":{"type":["string","null"],"description":"The trigger that started it, if one did."},"progress":{"type":["number","null"],"description":"A long run's progress, 0–1, as its script reported it (a `::progress 40` line on standard error)."},"progressMessage":{"type":["string","null"]},"test":{"type":"boolean","description":"A test run of a chosen version (a draft) — not the team's use."},"logLines":{"type":"integer"},"startedAt":{"type":"string"},"finishedAt":{"type":["string","null"]},"durationMs":{"type":["integer","null"]},"files":{"type":"array","items":{"$ref":"#/components/schemas/File"},"description":"Its files: those given as file inputs (`in`) and those it wrote to /outputs (`out`), each with a download link. On one run, not in lists."}},"required":["id","script","version","environment","status","error","startedBy","interface","approvalRequestId","scheduleId","triggerId","progress","progressMessage","test","logLines","startedAt","finishedAt","durationMs"]},"File":{"type":"object","properties":{"id":{"type":"string","example":"file_4c1e…"},"name":{"type":"string","example":"revenue-2026-09.csv","description":"Its name — for a file a run wrote, its path in /outputs."},"type":{"type":"string","example":"text/csv"},"size":{"type":"integer","description":"Bytes."},"direction":{"type":"string","enum":["in","out"],"description":"`in`: given to a run; `out`: written by one."},"runId":{"type":["string","null"],"description":"The run that took or wrote it; null for an upload not yet used."},"field":{"type":["string","null"],"description":"The input it was given as, for a file given to a run."},"sha256":{"type":["string","null"]},"createdAt":{"type":"string"},"expiresAt":{"type":"string","description":"When it is deleted: a day after upload until a run uses it; then the plan's days."},"downloadUrl":{"type":["string","null"],"description":"A link to its bytes, valid for an hour, no key needed — always a download. Null where links are off; read GET /v1/files/{fileId}/content instead."}},"required":["id","name","type","size","direction","runId","field","sha256","createdAt","expiresAt","downloadUrl"]},"HeldRun":{"allOf":[{"$ref":"#/components/schemas/Run"},{"type":"object","properties":{"approval":{"type":["object","null"],"properties":{"id":{"type":"string"},"approveUrl":{"type":"string"}},"required":["id","approveUrl"],"description":"The request a person decides; null if it could not be filed (or not held)."}},"required":["approval"]}]},"RunInput":{"type":"object","properties":{"inputs":{"type":"object","additionalProperties":{},"default":{},"example":{"email":"jane@example.com"},"description":"The script's inputs, by name. Default: none."},"via":{"type":"string","enum":["api","cli"],"description":"How it was started (for the history). Default: api; agents' runs are recorded as mcp."}}},"RunPage":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/Run"}},"nextCursor":{"type":["string","null"],"description":"Pass as ?cursor= to fetch the next page."}},"required":["items","nextCursor"]},"RunLog":{"type":"object","properties":{"lines":{"type":"array","items":{"type":"string"}}},"required":["lines"]},"Secret":{"type":"object","properties":{"name":{"type":"string","example":"ADMIN_KEY"},"allowEnv":{"type":"boolean","description":"Whether a script may read it as an environment variable instead of having it attached to requests."},"createdByUserId":{"type":["string","null"]},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"values":{"type":"array","items":{"$ref":"#/components/schemas/SecretValue"},"description":"One per environment that has a value — never the value itself. A run in an environment with none fails."}},"required":["name","allowEnv","createdByUserId","createdAt","updatedAt","values"]},"SecretValue":{"type":"object","properties":{"environment":{"type":"string","example":"production"},"hosts":{"type":"array","items":{"type":"string"},"example":["api.yourapp.com"],"description":"The only hosts this environment's value is ever sent to."},"createdByUserId":{"type":["string","null"]},"updatedAt":{"type":"string"},"lastUsedAt":{"type":["string","null"]}},"required":["environment","hosts","createdByUserId","updatedAt","lastUsedAt"]},"SecretInput":{"type":"object","properties":{"value":{"type":"string","description":"The secret itself."},"hosts":{"type":"array","items":{"type":"string"},"example":["api.yourapp.com"]},"allowEnv":{"type":"boolean","description":"Let scripts read it as a plain value. Default false — attached to requests only."}},"required":["value","hosts"]},"Environment":{"type":"object","properties":{"id":{"type":"string","example":"env_3f9c…"},"name":{"type":"string","example":"staging"},"approvalPolicy":{"type":"string","enum":["none","agents","always"],"description":"Which runs here wait for a person's approval: `none`, `agents` (runs an agent starts) or `always`. A run uses the stricter of this and its script's policy."},"agentsAllowed":{"type":"boolean","description":"Whether agents (MCP) may run scripts here, or schedule them to."},"isDefault":{"type":"boolean","description":"The workspace's default: where a request that names no environment acts."},"createdByUserId":{"type":["string","null"]},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","name","approvalPolicy","agentsAllowed","isDefault","createdByUserId","createdAt","updatedAt"]},"EnvironmentDetail":{"allOf":[{"$ref":"#/components/schemas/Environment"},{"type":"object","properties":{"usage":{"$ref":"#/components/schemas/EnvironmentUsage"}},"required":["usage"]}]},"EnvironmentUsage":{"type":"object","properties":{"secretValues":{"type":"integer","description":"Secret values it holds — deleted with it."},"schedules":{"type":"integer"},"triggers":{"type":"integer","description":"Schedules and triggers that run in it; it can't be deleted while any do."}},"required":["secretValues","schedules","triggers"]},"EnvironmentInput":{"type":"object","properties":{"name":{"type":"string","example":"staging","description":"Its name, unique in the workspace."},"approvalPolicy":{"type":"string","enum":["none","agents","always"],"description":"Which runs here wait for a person's approval: `none`, `agents` (runs an agent starts) or `always`. A run uses the stricter of this and its script's policy. Default: none."},"agentsAllowed":{"type":"boolean","description":"Whether agents (MCP) may run scripts here, or schedule them to. Default: true."}},"required":["name"]},"EnvironmentPatch":{"type":"object","properties":{"name":{"type":"string","description":"Its name, unique in the workspace."},"approvalPolicy":{"type":"string","enum":["none","agents","always"],"description":"Which runs here wait for a person's approval: `none`, `agents` (runs an agent starts) or `always`. A run uses the stricter of this and its script's policy."},"agentsAllowed":{"type":"boolean","description":"Whether agents (MCP) may run scripts here, or schedule them to."},"isDefault":{"type":"boolean","enum":[true],"description":"Make it the default. To change the default, make another one the default."}}},"FilePage":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/FileListItem"}},"nextCursor":{"type":["string","null"],"description":"Pass as ?cursor= to fetch the next page."}},"required":["items","nextCursor"]},"FileListItem":{"allOf":[{"$ref":"#/components/schemas/File"},{"type":"object","properties":{"script":{"type":"object","properties":{"slug":{"type":"string"},"name":{"type":"string"}},"required":["slug","name"],"description":"The script whose run took or wrote it."},"run":{"type":"object","properties":{"id":{"type":"string"},"startedAt":{"type":"string"}},"required":["id","startedAt"]},"startedBy":{"type":["string","null"],"description":"Who started its run: a person's name, or the key or agent it came through."}},"required":["script","run","startedBy"]}]}},"parameters":{}},"paths":{"/user/me":{"get":{"operationId":"user.me","summary":"Get the current user","description":"Returns the user the personal access token belongs to, with their workspace memberships. Useful as an integration smoke test (\"who am I?\").","x-mcp":{"expose":false,"reason":"Personal access tokens only; an agent's connection acts in one workspace (workspace_get)."},"security":[{"pat":[]}],"responses":{"200":{"description":"The user the token authenticates.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserMe"}}}},"401":{"description":"Missing, malformed, invalid, revoked, or expired credential — API key or personal access token (code: unauthorized).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"A personal access token that cannot act in the named workspace (unknown slug, not a member, or excluded by the token's scopes), is not granted this route's scope, or lacks the workspace role the route requires (code: forbidden).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Personal access tokens are disabled in this deployment (code: not_found).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"429":{"description":"Per-key quota exhausted (code: rate_limited); retry after the Retry-After header.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}},"tags":["Personal access tokens"]}},"/user/token":{"delete":{"operationId":"user.revokeToken","summary":"Revoke the token making this request","description":"Revokes the personal access token used to call it — signing out from a script or the CLI (`logout`). The token stops working immediately; other tokens are untouched.","x-mcp":{"expose":false,"reason":"Revokes a person's own credential; agents connect through OAuth, not personal tokens."},"security":[{"pat":[]}],"responses":{"204":{"description":"Revoked."},"401":{"description":"Missing, malformed, invalid, revoked, or expired credential — API key or personal access token (code: unauthorized).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"A personal access token that cannot act in the named workspace (unknown slug, not a member, or excluded by the token's scopes), is not granted this route's scope, or lacks the workspace role the route requires (code: forbidden).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Personal access tokens are disabled in this deployment (code: not_found).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"429":{"description":"Per-key quota exhausted (code: rate_limited); retry after the Retry-After header.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}},"tags":["Personal access tokens"]}},"/workspace":{"get":{"operationId":"workspace.get","summary":"Get the current workspace","description":"Returns the Workspace the credential acts in — the API key's own, or the one named by X-Workspace for a personal access token. Useful as an integration smoke test (\"who am I?\").","security":[{"apiKey":[]},{"pat":[]}],"x-scope":"workspace:read","parameters":[{"schema":{"type":"string","minLength":1,"description":"Workspace slug. REQUIRED when authenticating with a personal access token (400 without it); ignored for API keys.","example":"acme"},"required":false,"description":"Workspace slug. REQUIRED when authenticating with a personal access token (400 without it); ignored for API keys.","name":"x-workspace","in":"header"},{"schema":{"type":"string","minLength":1,"description":"The environment the request acts in; without it, the product's default. An API key bound to an environment always acts in its own (403 naming another); an unknown environment is 400.","example":"live"},"required":false,"description":"The environment the request acts in; without it, the product's default. An API key bound to an environment always acts in its own (403 naming another); an unknown environment is 400.","name":"x-environment","in":"header"}],"responses":{"200":{"description":"The Workspace the key authenticates.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Workspace"}}}},"401":{"description":"Missing, malformed, invalid, revoked, or expired credential — API key or personal access token (code: unauthorized).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"A personal access token that cannot act in the named workspace (unknown slug, not a member, or excluded by the token's scopes), is not granted this route's scope, or lacks the workspace role the route requires (code: forbidden).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"429":{"description":"Per-key quota exhausted (code: rate_limited); retry after the Retry-After header.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}},"tags":["Workspace"]}},"/workspace/audit-events":{"get":{"operationId":"workspace.auditEvents.list","summary":"List workspace audit events","description":"The workspace's audit trail, newest first. Paginate with the opaque `nextCursor` token; `limit` is clamped to 1–100 (default 25). Owner-only for personal access tokens, like the audit page in the application; a Workspace API key is its workspace and always passes.","security":[{"apiKey":[]},{"pat":[]}],"x-scope":"workspace.audit:read","parameters":[{"schema":{"type":"integer","minimum":1,"maximum":100,"default":25,"example":25,"description":"Items per page, 1–100 (default 25)."},"required":false,"description":"Items per page, 1–100 (default 25).","name":"limit","in":"query"},{"schema":{"type":"string","description":"Opaque token from a previous page's nextCursor."},"required":false,"description":"Opaque token from a previous page's nextCursor.","name":"cursor","in":"query"},{"schema":{"type":"string","minLength":1,"description":"Workspace slug. REQUIRED when authenticating with a personal access token (400 without it); ignored for API keys.","example":"acme"},"required":false,"description":"Workspace slug. REQUIRED when authenticating with a personal access token (400 without it); ignored for API keys.","name":"x-workspace","in":"header"},{"schema":{"type":"string","minLength":1,"description":"The environment the request acts in; without it, the product's default. An API key bound to an environment always acts in its own (403 naming another); an unknown environment is 400.","example":"live"},"required":false,"description":"The environment the request acts in; without it, the product's default. An API key bound to an environment always acts in its own (403 naming another); an unknown environment is 400.","name":"x-environment","in":"header"}],"responses":{"200":{"description":"One page of audit events, newest first.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AuditEventPage"}}}},"400":{"description":"Malformed cursor or query (code: invalid_request).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Missing, malformed, invalid, revoked, or expired credential — API key or personal access token (code: unauthorized).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"A personal access token that cannot act in the named workspace (unknown slug, not a member, or excluded by the token's scopes), is not granted this route's scope, or lacks the workspace role the route requires (code: forbidden).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"429":{"description":"Per-key quota exhausted (code: rate_limited); retry after the Retry-After header.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}},"tags":["Audit events"]}},"/workspace/members":{"get":{"operationId":"workspace.members.list","summary":"List workspace members","description":"The workspace's members with their roles, newest first. Paginate with the opaque `nextCursor`; `limit` is clamped to 1–100 (default 25). Members are invited, removed and given roles in the app.","security":[{"apiKey":[]},{"pat":[]}],"x-scope":"workspace.members:read","parameters":[{"schema":{"type":"integer","minimum":1,"maximum":100,"default":25,"example":25,"description":"Items per page, 1–100 (default 25)."},"required":false,"description":"Items per page, 1–100 (default 25).","name":"limit","in":"query"},{"schema":{"type":"string","description":"Opaque token from a previous page's nextCursor."},"required":false,"description":"Opaque token from a previous page's nextCursor.","name":"cursor","in":"query"},{"schema":{"type":"string","minLength":1,"description":"Workspace slug. REQUIRED when authenticating with a personal access token (400 without it); ignored for API keys.","example":"acme"},"required":false,"description":"Workspace slug. REQUIRED when authenticating with a personal access token (400 without it); ignored for API keys.","name":"x-workspace","in":"header"},{"schema":{"type":"string","minLength":1,"description":"The environment the request acts in; without it, the product's default. An API key bound to an environment always acts in its own (403 naming another); an unknown environment is 400.","example":"live"},"required":false,"description":"The environment the request acts in; without it, the product's default. An API key bound to an environment always acts in its own (403 naming another); an unknown environment is 400.","name":"x-environment","in":"header"}],"responses":{"200":{"description":"One page of members, newest first.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MemberPage"}}}},"400":{"description":"Malformed cursor or query (code: invalid_request).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Missing, malformed, invalid, revoked, or expired credential — API key or personal access token (code: unauthorized).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"A personal access token that cannot act in the named workspace (unknown slug, not a member, or excluded by the token's scopes), is not granted this route's scope, or lacks the workspace role the route requires (code: forbidden).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"429":{"description":"Per-key quota exhausted (code: rate_limited); retry after the Retry-After header.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}},"tags":["Workspace"]}},"/workspace/invitations":{"get":{"operationId":"workspace.invitations.list","summary":"List pending invitations","description":"Invitations sent and not yet accepted, declined or expired, newest first. Owners and admins only for a personal credential, as in the app. Paginate with the opaque `nextCursor`.","security":[{"apiKey":[]},{"pat":[]}],"x-scope":"workspace.members:read","parameters":[{"schema":{"type":"integer","minimum":1,"maximum":100,"default":25,"example":25,"description":"Items per page, 1–100 (default 25)."},"required":false,"description":"Items per page, 1–100 (default 25).","name":"limit","in":"query"},{"schema":{"type":"string","description":"Opaque token from a previous page's nextCursor."},"required":false,"description":"Opaque token from a previous page's nextCursor.","name":"cursor","in":"query"},{"schema":{"type":"string","minLength":1,"description":"Workspace slug. REQUIRED when authenticating with a personal access token (400 without it); ignored for API keys.","example":"acme"},"required":false,"description":"Workspace slug. REQUIRED when authenticating with a personal access token (400 without it); ignored for API keys.","name":"x-workspace","in":"header"},{"schema":{"type":"string","minLength":1,"description":"The environment the request acts in; without it, the product's default. An API key bound to an environment always acts in its own (403 naming another); an unknown environment is 400.","example":"live"},"required":false,"description":"The environment the request acts in; without it, the product's default. An API key bound to an environment always acts in its own (403 naming another); an unknown environment is 400.","name":"x-environment","in":"header"}],"responses":{"200":{"description":"One page of pending invitations, newest first.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InvitationPage"}}}},"400":{"description":"Malformed cursor or query (code: invalid_request).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Missing, malformed, invalid, revoked, or expired credential — API key or personal access token (code: unauthorized).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"A personal access token that cannot act in the named workspace (unknown slug, not a member, or excluded by the token's scopes), is not granted this route's scope, or lacks the workspace role the route requires (code: forbidden).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"429":{"description":"Per-key quota exhausted (code: rate_limited); retry after the Retry-After header.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}},"tags":["Workspace"]}},"/workspace/approval-actions":{"get":{"operationId":"workspace.approvalActions.list","summary":"List the actions you can ask approval for","description":"Actions a credential may not take itself but may ASK a person to approve: each one's input (JSON Schema), who can approve it, and whether it creates a secret.","security":[{"apiKey":[]},{"pat":[]}],"x-scope":"workspace.approvals:read","parameters":[{"schema":{"type":"string","minLength":1,"description":"Workspace slug. REQUIRED when authenticating with a personal access token (400 without it); ignored for API keys.","example":"acme"},"required":false,"description":"Workspace slug. REQUIRED when authenticating with a personal access token (400 without it); ignored for API keys.","name":"x-workspace","in":"header"},{"schema":{"type":"string","minLength":1,"description":"The environment the request acts in; without it, the product's default. An API key bound to an environment always acts in its own (403 naming another); an unknown environment is 400.","example":"live"},"required":false,"description":"The environment the request acts in; without it, the product's default. An API key bound to an environment always acts in its own (403 naming another); an unknown environment is 400.","name":"x-environment","in":"header"}],"responses":{"200":{"description":"The approvable actions.","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"title":{"type":"string"},"approverRoles":{"type":"array","items":{"type":"string"}},"createsSecret":{"type":"boolean"},"input":{"type":"object","additionalProperties":{}}},"required":["id","title","approverRoles","createsSecret","input"]}}},"required":["items"]}}}},"401":{"description":"Missing, malformed, invalid, revoked, or expired credential — API key or personal access token (code: unauthorized).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"A personal access token that cannot act in the named workspace (unknown slug, not a member, or excluded by the token's scopes), is not granted this route's scope, or lacks the workspace role the route requires (code: forbidden).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"429":{"description":"Per-key quota exhausted (code: rate_limited); retry after the Retry-After header.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}},"tags":["Approvals"]}},"/workspace/approval-requests":{"post":{"operationId":"workspace.approvalRequests.create","summary":"Ask a person to approve an action","description":"Files a request for an action you may not take yourself (see approval-actions) and notifies everyone who can approve it. Show the person `approveUrl` and why you need it; then check the request until it is decided (it expires after 24 hours). A personal access token or an app a person connected may ask — not a workspace API key.","security":[{"apiKey":[]},{"pat":[]}],"x-scope":"workspace.approvals:write","parameters":[{"schema":{"type":"string","minLength":1,"description":"Workspace slug. REQUIRED when authenticating with a personal access token (400 without it); ignored for API keys.","example":"acme"},"required":false,"description":"Workspace slug. REQUIRED when authenticating with a personal access token (400 without it); ignored for API keys.","name":"x-workspace","in":"header"},{"schema":{"type":"string","minLength":1,"description":"The environment the request acts in; without it, the product's default. An API key bound to an environment always acts in its own (403 naming another); an unknown environment is 400.","example":"live"},"required":false,"description":"The environment the request acts in; without it, the product's default. An API key bound to an environment always acts in its own (403 naming another); an unknown environment is 400.","name":"x-environment","in":"header"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"action":{"type":"string","example":"workspace.apiKey.create","description":"An action id from approval-actions."},"input":{"type":"object","additionalProperties":{},"example":{"name":"acme-web","scopes":["workspace:read"]},"description":"The action's input, per its JSON Schema."},"reason":{"type":"string","minLength":1,"maxLength":500,"description":"Why — the person reads it before deciding."}},"required":["action","input","reason"]}}}},"responses":{"201":{"description":"The request, pending.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApprovalRequest"}}}},"400":{"description":"Unknown action or invalid input (code: invalid_request).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Missing, malformed, invalid, revoked, or expired credential — API key or personal access token (code: unauthorized).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"A personal access token that cannot act in the named workspace (unknown slug, not a member, or excluded by the token's scopes), is not granted this route's scope, or lacks the workspace role the route requires (code: forbidden).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"429":{"description":"Per-key quota exhausted (code: rate_limited); retry after the Retry-After header.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}},"tags":["Approvals"]}},"/workspace/approval-requests/{requestId}":{"get":{"operationId":"workspace.approvalRequests.get","summary":"Check an approval request","description":"The request you filed: pending, denied, completed (the action ran — see `result`), approved (waiting for the CLI to redeem it), failed or expired.","security":[{"apiKey":[]},{"pat":[]}],"x-scope":"workspace.approvals:read","parameters":[{"schema":{"type":"string","description":"The request's id."},"required":true,"description":"The request's id.","name":"requestId","in":"path"},{"schema":{"type":"string","minLength":1,"description":"Workspace slug. REQUIRED when authenticating with a personal access token (400 without it); ignored for API keys.","example":"acme"},"required":false,"description":"Workspace slug. REQUIRED when authenticating with a personal access token (400 without it); ignored for API keys.","name":"x-workspace","in":"header"},{"schema":{"type":"string","minLength":1,"description":"The environment the request acts in; without it, the product's default. An API key bound to an environment always acts in its own (403 naming another); an unknown environment is 400.","example":"live"},"required":false,"description":"The environment the request acts in; without it, the product's default. An API key bound to an environment always acts in its own (403 naming another); an unknown environment is 400.","name":"x-environment","in":"header"}],"responses":{"200":{"description":"The request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApprovalRequest"}}}},"401":{"description":"Missing, malformed, invalid, revoked, or expired credential — API key or personal access token (code: unauthorized).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"A personal access token that cannot act in the named workspace (unknown slug, not a member, or excluded by the token's scopes), is not granted this route's scope, or lacks the workspace role the route requires (code: forbidden).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Not one of yours (code: not_found).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"429":{"description":"Per-key quota exhausted (code: rate_limited); retry after the Retry-After header.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}},"tags":["Approvals"]}},"/workspace/approval-requests/{requestId}/redeem":{"post":{"operationId":"workspace.approvalRequests.redeem","summary":"Redeem an approved request","description":"Runs an approved, secret-producing action ONCE and returns its secret — to the personal access token that asked, only. The CLI writes it to a file without printing it.","x-mcp":{"expose":false,"reason":"Returns a secret; secrets never enter an agent's conversation — the CLI writes them to a file."},"x-cli":{"command":"workspace approval-requests redeem","args":["requestId"]},"security":[{"apiKey":[]},{"pat":[]}],"x-scope":"workspace.approvals:write","parameters":[{"schema":{"type":"string","description":"The request's id."},"required":true,"description":"The request's id.","name":"requestId","in":"path"},{"schema":{"type":"string","minLength":1,"description":"Workspace slug. REQUIRED when authenticating with a personal access token (400 without it); ignored for API keys.","example":"acme"},"required":false,"description":"Workspace slug. REQUIRED when authenticating with a personal access token (400 without it); ignored for API keys.","name":"x-workspace","in":"header"},{"schema":{"type":"string","minLength":1,"description":"The environment the request acts in; without it, the product's default. An API key bound to an environment always acts in its own (403 naming another); an unknown environment is 400.","example":"live"},"required":false,"description":"The environment the request acts in; without it, the product's default. An API key bound to an environment always acts in its own (403 naming another); an unknown environment is 400.","name":"x-environment","in":"header"}],"responses":{"200":{"description":"Done; the secret, once.","content":{"application/json":{"schema":{"type":"object","properties":{"request":{"$ref":"#/components/schemas/ApprovalRequest"},"secret":{"type":["string","null"]},"envVar":{"type":["string","null"]}},"required":["request","secret","envVar"]}}}},"400":{"description":"Not approved, already redeemed or expired (code: invalid_request).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Missing, malformed, invalid, revoked, or expired credential — API key or personal access token (code: unauthorized).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"A personal access token that cannot act in the named workspace (unknown slug, not a member, or excluded by the token's scopes), is not granted this route's scope, or lacks the workspace role the route requires (code: forbidden).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Not yours (code: not_found).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"429":{"description":"Per-key quota exhausted (code: rate_limited); retry after the Retry-After header.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}},"tags":["Approvals"]}},"/workspace/usage":{"get":{"operationId":"workspace.usage","summary":"Get your plan's usage this period","description":"How much of each meter the workspace used this period, with the plan's limit for it (null = unlimited). A period is a month from the workspace's billing date: its subscription's (an annual plan refills monthly from its start), else the day the workspace was created.","security":[{"apiKey":[]},{"pat":[]}],"x-scope":"workspace:read","parameters":[{"schema":{"type":"string","minLength":1,"description":"Workspace slug. REQUIRED when authenticating with a personal access token (400 without it); ignored for API keys.","example":"acme"},"required":false,"description":"Workspace slug. REQUIRED when authenticating with a personal access token (400 without it); ignored for API keys.","name":"x-workspace","in":"header"},{"schema":{"type":"string","minLength":1,"description":"The environment the request acts in; without it, the product's default. An API key bound to an environment always acts in its own (403 naming another); an unknown environment is 400.","example":"live"},"required":false,"description":"The environment the request acts in; without it, the product's default. An API key bound to an environment always acts in its own (403 naming another); an unknown environment is 400.","name":"x-environment","in":"header"}],"responses":{"200":{"description":"This period's usage.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WorkspaceUsage"}}}},"401":{"description":"Missing, malformed, invalid, revoked, or expired credential — API key or personal access token (code: unauthorized).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"A personal access token that cannot act in the named workspace (unknown slug, not a member, or excluded by the token's scopes), is not granted this route's scope, or lacks the workspace role the route requires (code: forbidden).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"429":{"description":"Per-key quota exhausted (code: rate_limited); retry after the Retry-After header.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}},"tags":["Workspace"]}},"/workspace/teams":{"get":{"operationId":"workspace.teams.list","summary":"List teams","description":"The workspace's teams with their members' user ids, newest first. Paginate with the opaque `nextCursor`; `limit` is clamped to 1–100 (default 25). Teams are created and staffed in the app.","security":[{"apiKey":[]},{"pat":[]}],"x-scope":"workspace.teams:read","parameters":[{"schema":{"type":"integer","minimum":1,"maximum":100,"default":25,"example":25,"description":"Items per page, 1–100 (default 25)."},"required":false,"description":"Items per page, 1–100 (default 25).","name":"limit","in":"query"},{"schema":{"type":"string","description":"Opaque token from a previous page's nextCursor."},"required":false,"description":"Opaque token from a previous page's nextCursor.","name":"cursor","in":"query"},{"schema":{"type":"string","minLength":1,"description":"Workspace slug. REQUIRED when authenticating with a personal access token (400 without it); ignored for API keys.","example":"acme"},"required":false,"description":"Workspace slug. REQUIRED when authenticating with a personal access token (400 without it); ignored for API keys.","name":"x-workspace","in":"header"},{"schema":{"type":"string","minLength":1,"description":"The environment the request acts in; without it, the product's default. An API key bound to an environment always acts in its own (403 naming another); an unknown environment is 400.","example":"live"},"required":false,"description":"The environment the request acts in; without it, the product's default. An API key bound to an environment always acts in its own (403 naming another); an unknown environment is 400.","name":"x-environment","in":"header"}],"responses":{"200":{"description":"One page of teams, newest first.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TeamPage"}}}},"400":{"description":"Malformed cursor or query (code: invalid_request).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Missing, malformed, invalid, revoked, or expired credential — API key or personal access token (code: unauthorized).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"A personal access token that cannot act in the named workspace (unknown slug, not a member, or excluded by the token's scopes), is not granted this route's scope, or lacks the workspace role the route requires (code: forbidden).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"429":{"description":"Per-key quota exhausted (code: rate_limited); retry after the Retry-After header.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}},"tags":["Workspace"]}},"/workspace/webhook-endpoints":{"get":{"operationId":"workspace.webhookEndpoints.list","summary":"List webhook endpoints","description":"The workspace's outgoing webhook endpoints, newest first, without their signing secrets. A workspace has at most 10, so the list is a single page (`nextCursor` is null).","security":[{"apiKey":[]},{"pat":[]}],"x-scope":"workspace.webhooks:read","parameters":[{"schema":{"type":"string","minLength":1,"description":"Workspace slug. REQUIRED when authenticating with a personal access token (400 without it); ignored for API keys.","example":"acme"},"required":false,"description":"Workspace slug. REQUIRED when authenticating with a personal access token (400 without it); ignored for API keys.","name":"x-workspace","in":"header"},{"schema":{"type":"string","minLength":1,"description":"The environment the request acts in; without it, the product's default. An API key bound to an environment always acts in its own (403 naming another); an unknown environment is 400.","example":"live"},"required":false,"description":"The environment the request acts in; without it, the product's default. An API key bound to an environment always acts in its own (403 naming another); an unknown environment is 400.","name":"x-environment","in":"header"}],"responses":{"200":{"description":"The endpoints.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookEndpointPage"}}}},"401":{"description":"Missing, malformed, invalid, revoked, or expired credential — API key or personal access token (code: unauthorized).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"A personal access token that cannot act in the named workspace (unknown slug, not a member, or excluded by the token's scopes), is not granted this route's scope, or lacks the workspace role the route requires (code: forbidden).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"429":{"description":"Per-key quota exhausted (code: rate_limited); retry after the Retry-After header.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}},"tags":["Webhooks"]},"post":{"operationId":"workspace.webhookEndpoints.create","summary":"Add a webhook endpoint","description":"Registers an https URL to receive the workspace's events, signed Svix-compatibly. The response carries the endpoint's signing secret (`whsec_…`) — shown ONCE, store it to verify deliveries. Private and non-https hosts are refused; at most 10 per workspace.","x-mcp":{"expose":false,"reason":"Changes where workspace data is sent. A person configures webhook endpoints (Settings → Webhooks in the app)."},"security":[{"apiKey":[]},{"pat":[]}],"x-scope":"workspace.webhooks:write","parameters":[{"schema":{"type":"string","minLength":1,"description":"Workspace slug. REQUIRED when authenticating with a personal access token (400 without it); ignored for API keys.","example":"acme"},"required":false,"description":"Workspace slug. REQUIRED when authenticating with a personal access token (400 without it); ignored for API keys.","name":"x-workspace","in":"header"},{"schema":{"type":"string","minLength":1,"description":"The environment the request acts in; without it, the product's default. An API key bound to an environment always acts in its own (403 naming another); an unknown environment is 400.","example":"live"},"required":false,"description":"The environment the request acts in; without it, the product's default. An API key bound to an environment always acts in its own (403 naming another); an unknown environment is 400.","name":"x-environment","in":"header"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"url":{"type":"string","minLength":1,"maxLength":2048,"example":"https://example.com/hooks","description":"The https URL that receives the events."},"description":{"type":"string","maxLength":200,"description":"A note for people managing the endpoint."},"eventTypes":{"type":"array","items":{"type":"string"},"maxItems":100,"example":["workspace.member.joined"],"description":"Only these event types (see event-types); omit for every event."}},"required":["url"]}}}},"responses":{"201":{"description":"The endpoint and its signing secret (shown once).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookEndpointCreated"}}}},"400":{"description":"Invalid request (code: invalid_request).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Missing, malformed, invalid, revoked, or expired credential — API key or personal access token (code: unauthorized).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"A personal access token that cannot act in the named workspace (unknown slug, not a member, or excluded by the token's scopes), is not granted this route's scope, or lacks the workspace role the route requires (code: forbidden).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"429":{"description":"Per-key quota exhausted (code: rate_limited); retry after the Retry-After header.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}},"tags":["Webhooks"]}},"/workspace/webhook-endpoints/{endpointId}":{"get":{"operationId":"workspace.webhookEndpoints.get","summary":"Get a webhook endpoint","description":"One endpoint, without its signing secret: whether it is enabled, its consecutive failures and its last delivery status.","security":[{"apiKey":[]},{"pat":[]}],"x-scope":"workspace.webhooks:read","parameters":[{"schema":{"type":"string","example":"we_3f0c…"},"required":true,"name":"endpointId","in":"path"},{"schema":{"type":"string","minLength":1,"description":"Workspace slug. REQUIRED when authenticating with a personal access token (400 without it); ignored for API keys.","example":"acme"},"required":false,"description":"Workspace slug. REQUIRED when authenticating with a personal access token (400 without it); ignored for API keys.","name":"x-workspace","in":"header"},{"schema":{"type":"string","minLength":1,"description":"The environment the request acts in; without it, the product's default. An API key bound to an environment always acts in its own (403 naming another); an unknown environment is 400.","example":"live"},"required":false,"description":"The environment the request acts in; without it, the product's default. An API key bound to an environment always acts in its own (403 naming another); an unknown environment is 400.","name":"x-environment","in":"header"}],"responses":{"200":{"description":"The endpoint.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookEndpoint"}}}},"401":{"description":"Missing, malformed, invalid, revoked, or expired credential — API key or personal access token (code: unauthorized).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"A personal access token that cannot act in the named workspace (unknown slug, not a member, or excluded by the token's scopes), is not granted this route's scope, or lacks the workspace role the route requires (code: forbidden).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"No such endpoint (or delivery) in this workspace (code: not_found).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"429":{"description":"Per-key quota exhausted (code: rate_limited); retry after the Retry-After header.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}},"tags":["Webhooks"]},"delete":{"operationId":"workspace.webhookEndpoints.delete","summary":"Remove a webhook endpoint","description":"Stops all deliveries to the endpoint and deletes it with its secret. Its delivery history goes with it.","x-mcp":{"expose":false,"reason":"Changes where workspace data is sent. A person configures webhook endpoints (Settings → Webhooks in the app)."},"security":[{"apiKey":[]},{"pat":[]}],"x-scope":"workspace.webhooks:write","parameters":[{"schema":{"type":"string","example":"we_3f0c…"},"required":true,"name":"endpointId","in":"path"},{"schema":{"type":"string","minLength":1,"description":"Workspace slug. REQUIRED when authenticating with a personal access token (400 without it); ignored for API keys.","example":"acme"},"required":false,"description":"Workspace slug. REQUIRED when authenticating with a personal access token (400 without it); ignored for API keys.","name":"x-workspace","in":"header"},{"schema":{"type":"string","minLength":1,"description":"The environment the request acts in; without it, the product's default. An API key bound to an environment always acts in its own (403 naming another); an unknown environment is 400.","example":"live"},"required":false,"description":"The environment the request acts in; without it, the product's default. An API key bound to an environment always acts in its own (403 naming another); an unknown environment is 400.","name":"x-environment","in":"header"}],"responses":{"204":{"description":"Removed."},"401":{"description":"Missing, malformed, invalid, revoked, or expired credential — API key or personal access token (code: unauthorized).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"A personal access token that cannot act in the named workspace (unknown slug, not a member, or excluded by the token's scopes), is not granted this route's scope, or lacks the workspace role the route requires (code: forbidden).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"No such endpoint (or delivery) in this workspace (code: not_found).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"429":{"description":"Per-key quota exhausted (code: rate_limited); retry after the Retry-After header.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}},"tags":["Webhooks"]}},"/workspace/webhook-endpoints/{endpointId}/enable":{"post":{"operationId":"workspace.webhookEndpoints.enable","summary":"Re-enable a webhook endpoint","description":"Resumes deliveries to an endpoint that was disabled after repeated failures, keeping its signing secret; the failure count resets.","x-mcp":{"expose":false,"reason":"Changes where workspace data is sent. A person configures webhook endpoints (Settings → Webhooks in the app)."},"security":[{"apiKey":[]},{"pat":[]}],"x-scope":"workspace.webhooks:write","parameters":[{"schema":{"type":"string","example":"we_3f0c…"},"required":true,"name":"endpointId","in":"path"},{"schema":{"type":"string","minLength":1,"description":"Workspace slug. REQUIRED when authenticating with a personal access token (400 without it); ignored for API keys.","example":"acme"},"required":false,"description":"Workspace slug. REQUIRED when authenticating with a personal access token (400 without it); ignored for API keys.","name":"x-workspace","in":"header"},{"schema":{"type":"string","minLength":1,"description":"The environment the request acts in; without it, the product's default. An API key bound to an environment always acts in its own (403 naming another); an unknown environment is 400.","example":"live"},"required":false,"description":"The environment the request acts in; without it, the product's default. An API key bound to an environment always acts in its own (403 naming another); an unknown environment is 400.","name":"x-environment","in":"header"}],"responses":{"200":{"description":"The re-enabled endpoint.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookEndpoint"}}}},"401":{"description":"Missing, malformed, invalid, revoked, or expired credential — API key or personal access token (code: unauthorized).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"A personal access token that cannot act in the named workspace (unknown slug, not a member, or excluded by the token's scopes), is not granted this route's scope, or lacks the workspace role the route requires (code: forbidden).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"No such endpoint (or delivery) in this workspace (code: not_found).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"429":{"description":"Per-key quota exhausted (code: rate_limited); retry after the Retry-After header.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}},"tags":["Webhooks"]}},"/workspace/webhook-endpoints/{endpointId}/test":{"post":{"operationId":"workspace.webhookEndpoints.test","summary":"Send a test event","description":"Sends a `ping` event to the endpoint, signed like every delivery — the way to check an integration verifies and accepts deliveries.","security":[{"apiKey":[]},{"pat":[]}],"x-scope":"workspace.webhooks:write","parameters":[{"schema":{"type":"string","example":"we_3f0c…"},"required":true,"name":"endpointId","in":"path"},{"schema":{"type":"string","minLength":1,"description":"Workspace slug. REQUIRED when authenticating with a personal access token (400 without it); ignored for API keys.","example":"acme"},"required":false,"description":"Workspace slug. REQUIRED when authenticating with a personal access token (400 without it); ignored for API keys.","name":"x-workspace","in":"header"},{"schema":{"type":"string","minLength":1,"description":"The environment the request acts in; without it, the product's default. An API key bound to an environment always acts in its own (403 naming another); an unknown environment is 400.","example":"live"},"required":false,"description":"The environment the request acts in; without it, the product's default. An API key bound to an environment always acts in its own (403 naming another); an unknown environment is 400.","name":"x-environment","in":"header"}],"responses":{"202":{"description":"The test delivery was sent or queued.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookDeliveryOutcome"}}}},"401":{"description":"Missing, malformed, invalid, revoked, or expired credential — API key or personal access token (code: unauthorized).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"A personal access token that cannot act in the named workspace (unknown slug, not a member, or excluded by the token's scopes), is not granted this route's scope, or lacks the workspace role the route requires (code: forbidden).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"No such endpoint (or delivery) in this workspace (code: not_found).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"429":{"description":"Per-key quota exhausted (code: rate_limited); retry after the Retry-After header.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}},"tags":["Webhooks"]}},"/workspace/webhook-endpoints/{endpointId}/deliveries":{"get":{"operationId":"workspace.webhookDeliveries.list","summary":"List an endpoint's deliveries","description":"Delivery history for one endpoint, newest first: each event's status, attempts and last HTTP status (payloads are not returned). Kept for 30 days. Paginate with the opaque `nextCursor`.","security":[{"apiKey":[]},{"pat":[]}],"x-scope":"workspace.webhooks:read","parameters":[{"schema":{"type":"string","example":"we_3f0c…"},"required":true,"name":"endpointId","in":"path"},{"schema":{"type":"integer","minimum":1,"maximum":100,"default":25,"example":25,"description":"Items per page, 1–100 (default 25)."},"required":false,"description":"Items per page, 1–100 (default 25).","name":"limit","in":"query"},{"schema":{"type":"string","description":"Opaque token from a previous page's nextCursor."},"required":false,"description":"Opaque token from a previous page's nextCursor.","name":"cursor","in":"query"},{"schema":{"type":"string","minLength":1,"description":"Workspace slug. REQUIRED when authenticating with a personal access token (400 without it); ignored for API keys.","example":"acme"},"required":false,"description":"Workspace slug. REQUIRED when authenticating with a personal access token (400 without it); ignored for API keys.","name":"x-workspace","in":"header"},{"schema":{"type":"string","minLength":1,"description":"The environment the request acts in; without it, the product's default. An API key bound to an environment always acts in its own (403 naming another); an unknown environment is 400.","example":"live"},"required":false,"description":"The environment the request acts in; without it, the product's default. An API key bound to an environment always acts in its own (403 naming another); an unknown environment is 400.","name":"x-environment","in":"header"}],"responses":{"200":{"description":"One page of deliveries.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookDeliveryPage"}}}},"400":{"description":"Invalid request (code: invalid_request).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Missing, malformed, invalid, revoked, or expired credential — API key or personal access token (code: unauthorized).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"A personal access token that cannot act in the named workspace (unknown slug, not a member, or excluded by the token's scopes), is not granted this route's scope, or lacks the workspace role the route requires (code: forbidden).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"No such endpoint (or delivery) in this workspace (code: not_found).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"429":{"description":"Per-key quota exhausted (code: rate_limited); retry after the Retry-After header.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}},"tags":["Webhooks"]}},"/workspace/webhook-endpoints/{endpointId}/deliveries/{deliveryId}/redeliver":{"post":{"operationId":"workspace.webhookDeliveries.redeliver","summary":"Redeliver an event","description":"Sends a recorded delivery's event again, as a new delivery with its own history entry; the event id is unchanged, so receivers can deduplicate. The endpoint must be enabled.","security":[{"apiKey":[]},{"pat":[]}],"x-scope":"workspace.webhooks:write","parameters":[{"schema":{"type":"string","example":"we_3f0c…"},"required":true,"name":"endpointId","in":"path"},{"schema":{"type":"string","example":"del_8a1b…"},"required":true,"name":"deliveryId","in":"path"},{"schema":{"type":"string","minLength":1,"description":"Workspace slug. REQUIRED when authenticating with a personal access token (400 without it); ignored for API keys.","example":"acme"},"required":false,"description":"Workspace slug. REQUIRED when authenticating with a personal access token (400 without it); ignored for API keys.","name":"x-workspace","in":"header"},{"schema":{"type":"string","minLength":1,"description":"The environment the request acts in; without it, the product's default. An API key bound to an environment always acts in its own (403 naming another); an unknown environment is 400.","example":"live"},"required":false,"description":"The environment the request acts in; without it, the product's default. An API key bound to an environment always acts in its own (403 naming another); an unknown environment is 400.","name":"x-environment","in":"header"}],"responses":{"202":{"description":"The redelivery was sent or queued.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookDeliveryOutcome"}}}},"400":{"description":"Invalid request (code: invalid_request).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Missing, malformed, invalid, revoked, or expired credential — API key or personal access token (code: unauthorized).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"A personal access token that cannot act in the named workspace (unknown slug, not a member, or excluded by the token's scopes), is not granted this route's scope, or lacks the workspace role the route requires (code: forbidden).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"No such endpoint (or delivery) in this workspace (code: not_found).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"429":{"description":"Per-key quota exhausted (code: rate_limited); retry after the Retry-After header.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}},"tags":["Webhooks"]}},"/workspace/event-types":{"get":{"operationId":"workspace.eventTypes.list","summary":"List event types","description":"Every workspace event a webhook endpoint can subscribe to, with what it means. Pass some as `eventTypes` when adding an endpoint; an endpoint without a list receives them all.","security":[{"apiKey":[]},{"pat":[]}],"x-scope":"workspace.webhooks:read","parameters":[{"schema":{"type":"string","minLength":1,"description":"Workspace slug. REQUIRED when authenticating with a personal access token (400 without it); ignored for API keys.","example":"acme"},"required":false,"description":"Workspace slug. REQUIRED when authenticating with a personal access token (400 without it); ignored for API keys.","name":"x-workspace","in":"header"},{"schema":{"type":"string","minLength":1,"description":"The environment the request acts in; without it, the product's default. An API key bound to an environment always acts in its own (403 naming another); an unknown environment is 400.","example":"live"},"required":false,"description":"The environment the request acts in; without it, the product's default. An API key bound to an environment always acts in its own (403 naming another); an unknown environment is 400.","name":"x-environment","in":"header"}],"responses":{"200":{"description":"The event types.","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"type":{"type":"string","example":"workspace.member.joined"},"description":{"type":"string"}},"required":["type","description"]}}},"required":["items"]}}}},"401":{"description":"Missing, malformed, invalid, revoked, or expired credential — API key or personal access token (code: unauthorized).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"A personal access token that cannot act in the named workspace (unknown slug, not a member, or excluded by the token's scopes), is not granted this route's scope, or lacks the workspace role the route requires (code: forbidden).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"429":{"description":"Per-key quota exhausted (code: rate_limited); retry after the Retry-After header.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}},"tags":["Webhooks"]}},"/scripts":{"get":{"operationId":"scripts.list","summary":"List scripts","description":"The workspace's scripts you may see, newest first, with the version each runs, tags and 30-day stats. Search with `q` (best match first) and filter by `tag`, `owner` or `published` — look here before writing a new one. Paginate with the opaque `nextCursor` token.","security":[{"apiKey":[]},{"pat":[]}],"x-scope":"scripts:read","parameters":[{"schema":{"type":"integer","minimum":1,"maximum":100,"default":25,"example":25,"description":"Items per page, 1–100 (default 25)."},"required":false,"description":"Items per page, 1–100 (default 25).","name":"limit","in":"query"},{"schema":{"type":"string","description":"Opaque token from a previous page's nextCursor."},"required":false,"description":"Opaque token from a previous page's nextCursor.","name":"cursor","in":"query"},{"schema":{"type":"string","maxLength":200,"description":"Search the name, slug, description and tags — each word matches the start of a word. Results are best match first, one page (no cursor)."},"required":false,"description":"Search the name, slug, description and tags — each word matches the start of a word. Results are best match first, one page (no cursor).","name":"q","in":"query"},{"schema":{"type":"string","maxLength":30,"description":"Only scripts with this tag."},"required":false,"description":"Only scripts with this tag.","name":"tag","in":"query"},{"schema":{"type":"string","description":"An owner's user id."},"required":false,"description":"An owner's user id.","name":"owner","in":"query"},{"schema":{"type":"string","enum":["true","false"],"description":"`true`: only scripts with a published version."},"required":false,"description":"`true`: only scripts with a published version.","name":"published","in":"query"},{"schema":{"type":"string","enum":["true","false"],"description":"`true`: the archived scripts instead (they are left out otherwise)."},"required":false,"description":"`true`: the archived scripts instead (they are left out otherwise).","name":"archived","in":"query"},{"schema":{"type":"string","minLength":1,"description":"Workspace slug. REQUIRED when authenticating with a personal access token (400 without it); ignored for API keys.","example":"acme"},"required":false,"description":"Workspace slug. REQUIRED when authenticating with a personal access token (400 without it); ignored for API keys.","name":"x-workspace","in":"header"},{"schema":{"type":"string","minLength":1,"description":"The environment the request acts in; without it, the product's default. An API key bound to an environment always acts in its own (403 naming another); an unknown environment is 400.","example":"live"},"required":false,"description":"The environment the request acts in; without it, the product's default. An API key bound to an environment always acts in its own (403 naming another); an unknown environment is 400.","name":"x-environment","in":"header"}],"responses":{"200":{"description":"One page of scripts.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ScriptPage"}}}},"400":{"description":"Malformed cursor or query (code: invalid_request).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Missing, malformed, invalid, revoked, or expired credential — API key or personal access token (code: unauthorized).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"A personal access token that cannot act in the named workspace (unknown slug, not a member, or excluded by the token's scopes), is not granted this route's scope, or lacks the workspace role the route requires (code: forbidden).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"429":{"description":"Per-key quota exhausted (code: rate_limited); retry after the Retry-After header.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}},"tags":["Scripts"]},"post":{"operationId":"scripts.create","summary":"Create a script","description":"Creates an empty script — upload a version, then publish it. The `slug` names it everywhere (the API path, the agent tool, the command line) and is unique in the workspace.","security":[{"apiKey":[]},{"pat":[]}],"x-scope":"scripts:write","parameters":[{"schema":{"type":"string","minLength":1,"description":"Workspace slug. REQUIRED when authenticating with a personal access token (400 without it); ignored for API keys.","example":"acme"},"required":false,"description":"Workspace slug. REQUIRED when authenticating with a personal access token (400 without it); ignored for API keys.","name":"x-workspace","in":"header"},{"schema":{"type":"string","minLength":1,"description":"The environment the request acts in; without it, the product's default. An API key bound to an environment always acts in its own (403 naming another); an unknown environment is 400.","example":"live"},"required":false,"description":"The environment the request acts in; without it, the product's default. An API key bound to an environment always acts in its own (403 naming another); an unknown environment is 400.","name":"x-environment","in":"header"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ScriptInput"}}}},"responses":{"201":{"description":"The new script.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Script"}}}},"400":{"description":"Invalid request (code: invalid_request).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Missing, malformed, invalid, revoked, or expired credential — API key or personal access token (code: unauthorized).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"A personal access token that cannot act in the named workspace (unknown slug, not a member, or excluded by the token's scopes), is not granted this route's scope, or lacks the workspace role the route requires (code: forbidden).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"429":{"description":"Per-key quota exhausted (code: rate_limited); retry after the Retry-After header.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}},"tags":["Scripts"]}},"/scripts/{slug}":{"get":{"operationId":"scripts.get","summary":"Get a script","description":"One script by its slug: its name, owner, status, published version, README, and who uses it — people, schedules, triggers and the scripts that follow it.","security":[{"apiKey":[]},{"pat":[]}],"x-scope":"scripts:read","parameters":[{"schema":{"type":"string","example":"unlock-account"},"required":true,"name":"slug","in":"path"},{"schema":{"type":"string","minLength":1,"description":"Workspace slug. REQUIRED when authenticating with a personal access token (400 without it); ignored for API keys.","example":"acme"},"required":false,"description":"Workspace slug. REQUIRED when authenticating with a personal access token (400 without it); ignored for API keys.","name":"x-workspace","in":"header"},{"schema":{"type":"string","minLength":1,"description":"The environment the request acts in; without it, the product's default. An API key bound to an environment always acts in its own (403 naming another); an unknown environment is 400.","example":"live"},"required":false,"description":"The environment the request acts in; without it, the product's default. An API key bound to an environment always acts in its own (403 naming another); an unknown environment is 400.","name":"x-environment","in":"header"}],"responses":{"200":{"description":"The script.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ScriptDetail"}}}},"401":{"description":"Missing, malformed, invalid, revoked, or expired credential — API key or personal access token (code: unauthorized).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"A personal access token that cannot act in the named workspace (unknown slug, not a member, or excluded by the token's scopes), is not granted this route's scope, or lacks the workspace role the route requires (code: forbidden).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"No such script or version in this workspace (code: not_found).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"429":{"description":"Per-key quota exhausted (code: rate_limited); retry after the Retry-After header.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}},"tags":["Scripts"]},"patch":{"operationId":"scripts.update","summary":"Change a script","description":"Changes its name or description, who may see and run it (access, teams), and which runs need a person's approval. The script's owner, or a workspace owner or admin.","security":[{"apiKey":[]},{"pat":[]}],"x-scope":"scripts:write","parameters":[{"schema":{"type":"string","example":"unlock-account"},"required":true,"name":"slug","in":"path"},{"schema":{"type":"string","minLength":1,"description":"Workspace slug. REQUIRED when authenticating with a personal access token (400 without it); ignored for API keys.","example":"acme"},"required":false,"description":"Workspace slug. REQUIRED when authenticating with a personal access token (400 without it); ignored for API keys.","name":"x-workspace","in":"header"},{"schema":{"type":"string","minLength":1,"description":"The environment the request acts in; without it, the product's default. An API key bound to an environment always acts in its own (403 naming another); an unknown environment is 400.","example":"live"},"required":false,"description":"The environment the request acts in; without it, the product's default. An API key bound to an environment always acts in its own (403 naming another); an unknown environment is 400.","name":"x-environment","in":"header"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ScriptPatch"}}}},"responses":{"200":{"description":"The changed script.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Script"}}}},"400":{"description":"Invalid request (code: invalid_request).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Missing, malformed, invalid, revoked, or expired credential — API key or personal access token (code: unauthorized).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"402":{"description":"The plan's limit is reached — e.g. Free's 3 authors a month (code: plan_limit_reached).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"A personal access token that cannot act in the named workspace (unknown slug, not a member, or excluded by the token's scopes), is not granted this route's scope, or lacks the workspace role the route requires (code: forbidden).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"No such script or version in this workspace (code: not_found).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"429":{"description":"Per-key quota exhausted (code: rate_limited); retry after the Retry-After header.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}},"tags":["Scripts"]}},"/scripts/{slug}/archive":{"post":{"operationId":"scripts.archive","summary":"Archive a script","description":"Stops it: it leaves the scripts list, can't be run, and its schedules and triggers skip it. Its runs, versions and files stay on record — scripts are archived, never deleted. Refused while a run of it is going or waiting for approval. The script's owner, or a workspace owner or admin.","x-mcp":{"expose":false,"reason":"Stopping a script the team relies on is a person's decision; an agent asks one to"},"security":[{"apiKey":[]},{"pat":[]}],"x-scope":"scripts:write","parameters":[{"schema":{"type":"string","example":"unlock-account"},"required":true,"name":"slug","in":"path"},{"schema":{"type":"string","minLength":1,"description":"Workspace slug. REQUIRED when authenticating with a personal access token (400 without it); ignored for API keys.","example":"acme"},"required":false,"description":"Workspace slug. REQUIRED when authenticating with a personal access token (400 without it); ignored for API keys.","name":"x-workspace","in":"header"},{"schema":{"type":"string","minLength":1,"description":"The environment the request acts in; without it, the product's default. An API key bound to an environment always acts in its own (403 naming another); an unknown environment is 400.","example":"live"},"required":false,"description":"The environment the request acts in; without it, the product's default. An API key bound to an environment always acts in its own (403 naming another); an unknown environment is 400.","name":"x-environment","in":"header"}],"responses":{"200":{"description":"The archived script.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Script"}}}},"400":{"description":"Invalid request (code: invalid_request).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Missing, malformed, invalid, revoked, or expired credential — API key or personal access token (code: unauthorized).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"A personal access token that cannot act in the named workspace (unknown slug, not a member, or excluded by the token's scopes), is not granted this route's scope, or lacks the workspace role the route requires (code: forbidden).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"No such script or version in this workspace (code: not_found).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"429":{"description":"Per-key quota exhausted (code: rate_limited); retry after the Retry-After header.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}},"tags":["Scripts"]}},"/scripts/{slug}/restore":{"post":{"operationId":"scripts.restore","summary":"Restore an archived script","description":"Brings an archived script back: listed and runnable again, its schedules and triggers resumed. The script's owner, or a workspace owner or admin.","x-mcp":{"expose":false,"reason":"Stopping a script the team relies on is a person's decision; an agent asks one to"},"security":[{"apiKey":[]},{"pat":[]}],"x-scope":"scripts:write","parameters":[{"schema":{"type":"string","example":"unlock-account"},"required":true,"name":"slug","in":"path"},{"schema":{"type":"string","minLength":1,"description":"Workspace slug. REQUIRED when authenticating with a personal access token (400 without it); ignored for API keys.","example":"acme"},"required":false,"description":"Workspace slug. REQUIRED when authenticating with a personal access token (400 without it); ignored for API keys.","name":"x-workspace","in":"header"},{"schema":{"type":"string","minLength":1,"description":"The environment the request acts in; without it, the product's default. An API key bound to an environment always acts in its own (403 naming another); an unknown environment is 400.","example":"live"},"required":false,"description":"The environment the request acts in; without it, the product's default. An API key bound to an environment always acts in its own (403 naming another); an unknown environment is 400.","name":"x-environment","in":"header"}],"responses":{"200":{"description":"The restored script.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Script"}}}},"400":{"description":"Invalid request (code: invalid_request).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Missing, malformed, invalid, revoked, or expired credential — API key or personal access token (code: unauthorized).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"A personal access token that cannot act in the named workspace (unknown slug, not a member, or excluded by the token's scopes), is not granted this route's scope, or lacks the workspace role the route requires (code: forbidden).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"No such script or version in this workspace (code: not_found).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"429":{"description":"Per-key quota exhausted (code: rate_limited); retry after the Retry-After header.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}},"tags":["Scripts"]}},"/scripts/{slug}/versions":{"post":{"operationId":"scriptVersions.create","summary":"Upload a version","description":"Uploads a new DRAFT version: the script's folder (a .tar.gz, base64 — the CLI makes it), the command that runs it and the JSON Schema of its inputs. Leave the command out and it is worked out from the folder: pyproject.toml's one script, package.json's bin, start or main, or the folder's one .py, .js, .ts or .sh file; leave the schema out and each `{name}` in the command is a text input. Its dependencies (requirements.txt, pyproject.toml, package.json) are installed now, once; a failed install answers 400 with what it printed. Runs keep using the published version until this one is published.","x-cli":{"shortcut":"publish --draft [dir...]"},"security":[{"apiKey":[]},{"pat":[]}],"x-scope":"scripts:write","parameters":[{"schema":{"type":"string","example":"unlock-account"},"required":true,"name":"slug","in":"path"},{"schema":{"type":"string","minLength":1,"description":"Workspace slug. REQUIRED when authenticating with a personal access token (400 without it); ignored for API keys.","example":"acme"},"required":false,"description":"Workspace slug. REQUIRED when authenticating with a personal access token (400 without it); ignored for API keys.","name":"x-workspace","in":"header"},{"schema":{"type":"string","minLength":1,"description":"The environment the request acts in; without it, the product's default. An API key bound to an environment always acts in its own (403 naming another); an unknown environment is 400.","example":"live"},"required":false,"description":"The environment the request acts in; without it, the product's default. An API key bound to an environment always acts in its own (403 naming another); an unknown environment is 400.","name":"x-environment","in":"header"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ScriptVersionInput"}}}},"responses":{"201":{"description":"The new draft version.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ScriptVersion"}}}},"400":{"description":"Invalid request (code: invalid_request).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Missing, malformed, invalid, revoked, or expired credential — API key or personal access token (code: unauthorized).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"402":{"description":"The plan's limit is reached — e.g. Free's 3 authors a month (code: plan_limit_reached).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"A personal access token that cannot act in the named workspace (unknown slug, not a member, or excluded by the token's scopes), is not granted this route's scope, or lacks the workspace role the route requires (code: forbidden).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"No such script or version in this workspace (code: not_found).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"429":{"description":"Per-key quota exhausted (code: rate_limited); retry after the Retry-After header.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"503":{"description":"The runner is unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}},"tags":["Versions"]},"get":{"operationId":"scriptVersions.list","summary":"List a script's versions","description":"Every version, newest first, and which one is published.","security":[{"apiKey":[]},{"pat":[]}],"x-scope":"scripts:read","parameters":[{"schema":{"type":"string","example":"unlock-account"},"required":true,"name":"slug","in":"path"},{"schema":{"type":"string","minLength":1,"description":"Workspace slug. REQUIRED when authenticating with a personal access token (400 without it); ignored for API keys.","example":"acme"},"required":false,"description":"Workspace slug. REQUIRED when authenticating with a personal access token (400 without it); ignored for API keys.","name":"x-workspace","in":"header"},{"schema":{"type":"string","minLength":1,"description":"The environment the request acts in; without it, the product's default. An API key bound to an environment always acts in its own (403 naming another); an unknown environment is 400.","example":"live"},"required":false,"description":"The environment the request acts in; without it, the product's default. An API key bound to an environment always acts in its own (403 naming another); an unknown environment is 400.","name":"x-environment","in":"header"}],"responses":{"200":{"description":"The versions.","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/ScriptVersion"}}},"required":["items"]}}}},"401":{"description":"Missing, malformed, invalid, revoked, or expired credential — API key or personal access token (code: unauthorized).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"A personal access token that cannot act in the named workspace (unknown slug, not a member, or excluded by the token's scopes), is not granted this route's scope, or lacks the workspace role the route requires (code: forbidden).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"No such script or version in this workspace (code: not_found).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"429":{"description":"Per-key quota exhausted (code: rate_limited); retry after the Retry-After header.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}},"tags":["Versions"]}},"/scripts/{slug}/versions/{number}/publish":{"post":{"operationId":"scriptVersions.publish","summary":"Publish a version","description":"Makes this version the one every run uses — from the app, the API, agents and schedules. Publishing an older version again rolls back. The script's owner, or a workspace owner or admin. An agent's publish (and anyone's, when the workspace requires a second person) becomes a request a person approves — answered 202.","security":[{"apiKey":[]},{"pat":[]}],"x-scope":"scripts:write","parameters":[{"schema":{"type":"string","example":"unlock-account"},"required":true,"name":"slug","in":"path"},{"schema":{"type":"integer","minimum":1,"example":3},"required":true,"name":"number","in":"path"},{"schema":{"type":"string","minLength":1,"description":"Workspace slug. REQUIRED when authenticating with a personal access token (400 without it); ignored for API keys.","example":"acme"},"required":false,"description":"Workspace slug. REQUIRED when authenticating with a personal access token (400 without it); ignored for API keys.","name":"x-workspace","in":"header"},{"schema":{"type":"string","minLength":1,"description":"The environment the request acts in; without it, the product's default. An API key bound to an environment always acts in its own (403 naming another); an unknown environment is 400.","example":"live"},"required":false,"description":"The environment the request acts in; without it, the product's default. An API key bound to an environment always acts in its own (403 naming another); an unknown environment is 400.","name":"x-environment","in":"header"}],"responses":{"200":{"description":"The script, now running this version.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Script"}}}},"202":{"description":"Sent for a person's approval — always for an agent, and for everyone when the workspace requires a second person. It is published once approved.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PublishRequested"}}}},"401":{"description":"Missing, malformed, invalid, revoked, or expired credential — API key or personal access token (code: unauthorized).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"402":{"description":"The plan's limit is reached — e.g. Free's 3 authors a month (code: plan_limit_reached).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"A personal access token that cannot act in the named workspace (unknown slug, not a member, or excluded by the token's scopes), is not granted this route's scope, or lacks the workspace role the route requires (code: forbidden).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"No such script or version in this workspace (code: not_found).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"429":{"description":"Per-key quota exhausted (code: rate_limited); retry after the Retry-After header.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}},"tags":["Versions"]}},"/script-settings":{"get":{"operationId":"scriptSettings.get","summary":"Get the workspace's script settings","description":"How the workspace governs scripts — e.g. whether publishing needs a second person.","security":[{"apiKey":[]},{"pat":[]}],"x-scope":"scripts:read","parameters":[{"schema":{"type":"string","minLength":1,"description":"Workspace slug. REQUIRED when authenticating with a personal access token (400 without it); ignored for API keys.","example":"acme"},"required":false,"description":"Workspace slug. REQUIRED when authenticating with a personal access token (400 without it); ignored for API keys.","name":"x-workspace","in":"header"},{"schema":{"type":"string","minLength":1,"description":"The environment the request acts in; without it, the product's default. An API key bound to an environment always acts in its own (403 naming another); an unknown environment is 400.","example":"live"},"required":false,"description":"The environment the request acts in; without it, the product's default. An API key bound to an environment always acts in its own (403 naming another); an unknown environment is 400.","name":"x-environment","in":"header"}],"responses":{"200":{"description":"The settings.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ScriptSettings"}}}},"401":{"description":"Missing, malformed, invalid, revoked, or expired credential — API key or personal access token (code: unauthorized).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"A personal access token that cannot act in the named workspace (unknown slug, not a member, or excluded by the token's scopes), is not granted this route's scope, or lacks the workspace role the route requires (code: forbidden).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"429":{"description":"Per-key quota exhausted (code: rate_limited); retry after the Retry-After header.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}},"tags":["Script settings"]},"patch":{"operationId":"scriptSettings.update","summary":"Change the workspace's script settings","description":"Workspace owners and admins, or a workspace API key.","x-mcp":{"expose":false,"reason":"Governance settings are a person's to change; an agent must not loosen them"},"security":[{"apiKey":[]},{"pat":[]}],"x-scope":"scripts:write","parameters":[{"schema":{"type":"string","minLength":1,"description":"Workspace slug. REQUIRED when authenticating with a personal access token (400 without it); ignored for API keys.","example":"acme"},"required":false,"description":"Workspace slug. REQUIRED when authenticating with a personal access token (400 without it); ignored for API keys.","name":"x-workspace","in":"header"},{"schema":{"type":"string","minLength":1,"description":"The environment the request acts in; without it, the product's default. An API key bound to an environment always acts in its own (403 naming another); an unknown environment is 400.","example":"live"},"required":false,"description":"The environment the request acts in; without it, the product's default. An API key bound to an environment always acts in its own (403 naming another); an unknown environment is 400.","name":"x-environment","in":"header"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ScriptSettingsPatch"}}}},"responses":{"200":{"description":"The settings.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ScriptSettings"}}}},"401":{"description":"Missing, malformed, invalid, revoked, or expired credential — API key or personal access token (code: unauthorized).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"402":{"description":"The plan's limit is reached — e.g. Free's 3 authors a month (code: plan_limit_reached).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"A personal access token that cannot act in the named workspace (unknown slug, not a member, or excluded by the token's scopes), is not granted this route's scope, or lacks the workspace role the route requires (code: forbidden).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"429":{"description":"Per-key quota exhausted (code: rate_limited); retry after the Retry-After header.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}},"tags":["Script settings"]}},"/scripts/{slug}/schedules":{"get":{"operationId":"schedules.list","summary":"List a script's schedules","description":"Its schedules, with when each runs next.","security":[{"apiKey":[]},{"pat":[]}],"x-scope":"scripts:read","parameters":[{"schema":{"type":"string","example":"monthly-report"},"required":true,"name":"slug","in":"path"},{"schema":{"type":"string","minLength":1,"description":"Workspace slug. REQUIRED when authenticating with a personal access token (400 without it); ignored for API keys.","example":"acme"},"required":false,"description":"Workspace slug. REQUIRED when authenticating with a personal access token (400 without it); ignored for API keys.","name":"x-workspace","in":"header"},{"schema":{"type":"string","minLength":1,"description":"The environment the request acts in; without it, the product's default. An API key bound to an environment always acts in its own (403 naming another); an unknown environment is 400.","example":"live"},"required":false,"description":"The environment the request acts in; without it, the product's default. An API key bound to an environment always acts in its own (403 naming another); an unknown environment is 400.","name":"x-environment","in":"header"}],"responses":{"200":{"description":"The schedules.","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/Schedule"}}},"required":["items"]}}}},"400":{"description":"Invalid request (code: invalid_request).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Missing, malformed, invalid, revoked, or expired credential — API key or personal access token (code: unauthorized).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"A personal access token that cannot act in the named workspace (unknown slug, not a member, or excluded by the token's scopes), is not granted this route's scope, or lacks the workspace role the route requires (code: forbidden).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"No such script, schedule or trigger (code: not_found).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"429":{"description":"Per-key quota exhausted (code: rate_limited); retry after the Retry-After header.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}},"tags":["Schedules"]},"post":{"operationId":"schedules.create","summary":"Schedule a script","description":"Runs the published version on a 5-field cron in a timezone, with these inputs, as you — at least 5 minutes apart. Switched off (with why) if you can no longer run it.","x-mcp":{"expose":false,"reason":"Schedules and triggers run as the person who created them — a person creates and changes them"},"security":[{"apiKey":[]},{"pat":[]}],"x-scope":"scripts:write","parameters":[{"schema":{"type":"string","example":"monthly-report"},"required":true,"name":"slug","in":"path"},{"schema":{"type":"string","minLength":1,"description":"Workspace slug. REQUIRED when authenticating with a personal access token (400 without it); ignored for API keys.","example":"acme"},"required":false,"description":"Workspace slug. REQUIRED when authenticating with a personal access token (400 without it); ignored for API keys.","name":"x-workspace","in":"header"},{"schema":{"type":"string","minLength":1,"description":"The environment the request acts in; without it, the product's default. An API key bound to an environment always acts in its own (403 naming another); an unknown environment is 400.","example":"live"},"required":false,"description":"The environment the request acts in; without it, the product's default. An API key bound to an environment always acts in its own (403 naming another); an unknown environment is 400.","name":"x-environment","in":"header"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ScheduleInput"}}}},"responses":{"201":{"description":"The schedule.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Schedule"}}}},"400":{"description":"Invalid request (code: invalid_request).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Missing, malformed, invalid, revoked, or expired credential — API key or personal access token (code: unauthorized).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"A personal access token that cannot act in the named workspace (unknown slug, not a member, or excluded by the token's scopes), is not granted this route's scope, or lacks the workspace role the route requires (code: forbidden).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"No such script, schedule or trigger (code: not_found).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"429":{"description":"Per-key quota exhausted (code: rate_limited); retry after the Retry-After header.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}},"tags":["Schedules"]}},"/scripts/{slug}/schedules/{scheduleId}":{"patch":{"operationId":"schedules.update","summary":"Change a schedule","description":"Its name, cron, timezone, inputs, or switch it on or off. Its creator, or an owner or admin.","x-mcp":{"expose":false,"reason":"Schedules and triggers run as the person who created them — a person creates and changes them"},"security":[{"apiKey":[]},{"pat":[]}],"x-scope":"scripts:write","parameters":[{"schema":{"type":"string","example":"monthly-report"},"required":true,"name":"slug","in":"path"},{"schema":{"type":"string"},"required":true,"name":"scheduleId","in":"path"},{"schema":{"type":"string","minLength":1,"description":"Workspace slug. REQUIRED when authenticating with a personal access token (400 without it); ignored for API keys.","example":"acme"},"required":false,"description":"Workspace slug. REQUIRED when authenticating with a personal access token (400 without it); ignored for API keys.","name":"x-workspace","in":"header"},{"schema":{"type":"string","minLength":1,"description":"The environment the request acts in; without it, the product's default. An API key bound to an environment always acts in its own (403 naming another); an unknown environment is 400.","example":"live"},"required":false,"description":"The environment the request acts in; without it, the product's default. An API key bound to an environment always acts in its own (403 naming another); an unknown environment is 400.","name":"x-environment","in":"header"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SchedulePatch"}}}},"responses":{"200":{"description":"The schedule.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Schedule"}}}},"400":{"description":"Invalid request (code: invalid_request).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Missing, malformed, invalid, revoked, or expired credential — API key or personal access token (code: unauthorized).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"A personal access token that cannot act in the named workspace (unknown slug, not a member, or excluded by the token's scopes), is not granted this route's scope, or lacks the workspace role the route requires (code: forbidden).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"No such script, schedule or trigger (code: not_found).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"429":{"description":"Per-key quota exhausted (code: rate_limited); retry after the Retry-After header.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}},"tags":["Schedules"]},"delete":{"operationId":"schedules.delete","summary":"Delete a schedule","description":"Its creator, or an owner or admin.","x-mcp":{"expose":false,"reason":"Schedules and triggers run as the person who created them — a person creates and changes them"},"security":[{"apiKey":[]},{"pat":[]}],"x-scope":"scripts:write","parameters":[{"schema":{"type":"string","example":"monthly-report"},"required":true,"name":"slug","in":"path"},{"schema":{"type":"string"},"required":true,"name":"scheduleId","in":"path"},{"schema":{"type":"string","minLength":1,"description":"Workspace slug. REQUIRED when authenticating with a personal access token (400 without it); ignored for API keys.","example":"acme"},"required":false,"description":"Workspace slug. REQUIRED when authenticating with a personal access token (400 without it); ignored for API keys.","name":"x-workspace","in":"header"},{"schema":{"type":"string","minLength":1,"description":"The environment the request acts in; without it, the product's default. An API key bound to an environment always acts in its own (403 naming another); an unknown environment is 400.","example":"live"},"required":false,"description":"The environment the request acts in; without it, the product's default. An API key bound to an environment always acts in its own (403 naming another); an unknown environment is 400.","name":"x-environment","in":"header"}],"responses":{"204":{"description":"Deleted."},"400":{"description":"Invalid request (code: invalid_request).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Missing, malformed, invalid, revoked, or expired credential — API key or personal access token (code: unauthorized).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"A personal access token that cannot act in the named workspace (unknown slug, not a member, or excluded by the token's scopes), is not granted this route's scope, or lacks the workspace role the route requires (code: forbidden).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"No such script, schedule or trigger (code: not_found).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"429":{"description":"Per-key quota exhausted (code: rate_limited); retry after the Retry-After header.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}},"tags":["Schedules"]}},"/scripts/{slug}/triggers":{"get":{"operationId":"triggers.list","summary":"List a script's triggers","description":"The events that start it.","security":[{"apiKey":[]},{"pat":[]}],"x-scope":"scripts:read","parameters":[{"schema":{"type":"string","example":"alert-on-failure"},"required":true,"name":"slug","in":"path"},{"schema":{"type":"string","minLength":1,"description":"Workspace slug. REQUIRED when authenticating with a personal access token (400 without it); ignored for API keys.","example":"acme"},"required":false,"description":"Workspace slug. REQUIRED when authenticating with a personal access token (400 without it); ignored for API keys.","name":"x-workspace","in":"header"},{"schema":{"type":"string","minLength":1,"description":"The environment the request acts in; without it, the product's default. An API key bound to an environment always acts in its own (403 naming another); an unknown environment is 400.","example":"live"},"required":false,"description":"The environment the request acts in; without it, the product's default. An API key bound to an environment always acts in its own (403 naming another); an unknown environment is 400.","name":"x-environment","in":"header"}],"responses":{"200":{"description":"The triggers.","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/Trigger"}}},"required":["items"]}}}},"400":{"description":"Invalid request (code: invalid_request).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Missing, malformed, invalid, revoked, or expired credential — API key or personal access token (code: unauthorized).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"A personal access token that cannot act in the named workspace (unknown slug, not a member, or excluded by the token's scopes), is not granted this route's scope, or lacks the workspace role the route requires (code: forbidden).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"No such script, schedule or trigger (code: not_found).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"429":{"description":"Per-key quota exhausted (code: rate_limited); retry after the Retry-After header.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}},"tags":["Triggers"]},"post":{"operationId":"triggers.create","summary":"Run a script on an event","description":"Starts a run, as you, when an event of `eventType` happens in the workspace (GET /v1/workspace/event-types lists them) and its data matches `filter` — within about a minute. A chain of triggered runs stops after 3.","x-mcp":{"expose":false,"reason":"Schedules and triggers run as the person who created them — a person creates and changes them"},"security":[{"apiKey":[]},{"pat":[]}],"x-scope":"scripts:write","parameters":[{"schema":{"type":"string","example":"alert-on-failure"},"required":true,"name":"slug","in":"path"},{"schema":{"type":"string","minLength":1,"description":"Workspace slug. REQUIRED when authenticating with a personal access token (400 without it); ignored for API keys.","example":"acme"},"required":false,"description":"Workspace slug. REQUIRED when authenticating with a personal access token (400 without it); ignored for API keys.","name":"x-workspace","in":"header"},{"schema":{"type":"string","minLength":1,"description":"The environment the request acts in; without it, the product's default. An API key bound to an environment always acts in its own (403 naming another); an unknown environment is 400.","example":"live"},"required":false,"description":"The environment the request acts in; without it, the product's default. An API key bound to an environment always acts in its own (403 naming another); an unknown environment is 400.","name":"x-environment","in":"header"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TriggerInput"}}}},"responses":{"201":{"description":"The trigger.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Trigger"}}}},"400":{"description":"Invalid request (code: invalid_request).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Missing, malformed, invalid, revoked, or expired credential — API key or personal access token (code: unauthorized).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"A personal access token that cannot act in the named workspace (unknown slug, not a member, or excluded by the token's scopes), is not granted this route's scope, or lacks the workspace role the route requires (code: forbidden).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"No such script, schedule or trigger (code: not_found).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"429":{"description":"Per-key quota exhausted (code: rate_limited); retry after the Retry-After header.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}},"tags":["Triggers"]}},"/scripts/{slug}/triggers/{triggerId}":{"patch":{"operationId":"triggers.update","summary":"Change a trigger","description":"Its name, filter, inputs, or switch it on or off. Its creator, or an owner or admin.","x-mcp":{"expose":false,"reason":"Schedules and triggers run as the person who created them — a person creates and changes them"},"security":[{"apiKey":[]},{"pat":[]}],"x-scope":"scripts:write","parameters":[{"schema":{"type":"string","example":"alert-on-failure"},"required":true,"name":"slug","in":"path"},{"schema":{"type":"string"},"required":true,"name":"triggerId","in":"path"},{"schema":{"type":"string","minLength":1,"description":"Workspace slug. REQUIRED when authenticating with a personal access token (400 without it); ignored for API keys.","example":"acme"},"required":false,"description":"Workspace slug. REQUIRED when authenticating with a personal access token (400 without it); ignored for API keys.","name":"x-workspace","in":"header"},{"schema":{"type":"string","minLength":1,"description":"The environment the request acts in; without it, the product's default. An API key bound to an environment always acts in its own (403 naming another); an unknown environment is 400.","example":"live"},"required":false,"description":"The environment the request acts in; without it, the product's default. An API key bound to an environment always acts in its own (403 naming another); an unknown environment is 400.","name":"x-environment","in":"header"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TriggerPatch"}}}},"responses":{"200":{"description":"The trigger.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Trigger"}}}},"400":{"description":"Invalid request (code: invalid_request).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Missing, malformed, invalid, revoked, or expired credential — API key or personal access token (code: unauthorized).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"A personal access token that cannot act in the named workspace (unknown slug, not a member, or excluded by the token's scopes), is not granted this route's scope, or lacks the workspace role the route requires (code: forbidden).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"No such script, schedule or trigger (code: not_found).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"429":{"description":"Per-key quota exhausted (code: rate_limited); retry after the Retry-After header.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}},"tags":["Triggers"]},"delete":{"operationId":"triggers.delete","summary":"Delete a trigger","description":"Its creator, or an owner or admin.","x-mcp":{"expose":false,"reason":"Schedules and triggers run as the person who created them — a person creates and changes them"},"security":[{"apiKey":[]},{"pat":[]}],"x-scope":"scripts:write","parameters":[{"schema":{"type":"string","example":"alert-on-failure"},"required":true,"name":"slug","in":"path"},{"schema":{"type":"string"},"required":true,"name":"triggerId","in":"path"},{"schema":{"type":"string","minLength":1,"description":"Workspace slug. REQUIRED when authenticating with a personal access token (400 without it); ignored for API keys.","example":"acme"},"required":false,"description":"Workspace slug. REQUIRED when authenticating with a personal access token (400 without it); ignored for API keys.","name":"x-workspace","in":"header"},{"schema":{"type":"string","minLength":1,"description":"The environment the request acts in; without it, the product's default. An API key bound to an environment always acts in its own (403 naming another); an unknown environment is 400.","example":"live"},"required":false,"description":"The environment the request acts in; without it, the product's default. An API key bound to an environment always acts in its own (403 naming another); an unknown environment is 400.","name":"x-environment","in":"header"}],"responses":{"204":{"description":"Deleted."},"400":{"description":"Invalid request (code: invalid_request).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Missing, malformed, invalid, revoked, or expired credential — API key or personal access token (code: unauthorized).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"A personal access token that cannot act in the named workspace (unknown slug, not a member, or excluded by the token's scopes), is not granted this route's scope, or lacks the workspace role the route requires (code: forbidden).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"No such script, schedule or trigger (code: not_found).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"429":{"description":"Per-key quota exhausted (code: rate_limited); retry after the Retry-After header.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}},"tags":["Triggers"]}},"/scripts/{slug}/runs":{"post":{"operationId":"runs.create","summary":"Run a script","description":"Runs the script's PUBLISHED version with these inputs and answers when it finishes, with its output (or error). The inputs are checked against the version's input schema first — a mismatch is a 400 with one `details` entry per field. A file input takes a file id (upload it with files.create first, or pass another run's output) or an https link Reminix fetches. The script runs in its own container, reaching only the hosts its version declares, for at most 30 seconds — a script whose `timeout` is longer runs durably and answers 202 at once. Every run counts toward the workspace's `runs` usage.","x-cli":{"shortcut":"run <slug>"},"security":[{"apiKey":[]},{"pat":[]}],"x-scope":"runs:write","parameters":[{"schema":{"type":"string","example":"unlock-account"},"required":true,"name":"slug","in":"path"},{"schema":{"type":"string","minLength":1,"description":"Workspace slug. REQUIRED when authenticating with a personal access token (400 without it); ignored for API keys.","example":"acme"},"required":false,"description":"Workspace slug. REQUIRED when authenticating with a personal access token (400 without it); ignored for API keys.","name":"x-workspace","in":"header"},{"schema":{"type":"string","minLength":1,"description":"The environment the request acts in; without it, the product's default. An API key bound to an environment always acts in its own (403 naming another); an unknown environment is 400.","example":"live"},"required":false,"description":"The environment the request acts in; without it, the product's default. An API key bound to an environment always acts in its own (403 naming another); an unknown environment is 400.","name":"x-environment","in":"header"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RunInput"}}}},"responses":{"200":{"description":"The finished run — succeeded or failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Run"}}}},"202":{"description":"Answered before it finishes: held for a person's approval (`awaiting_approval`, with the request to approve — it runs once approved, or is `cancelled`), or a LONG run started (`running` — a script whose `timeout` is over 30 s). Poll the run (and its log) until it ends.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HeldRun"}}}},"400":{"description":"Invalid inputs (one `details` entry per field) or no published version (code: invalid_request).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Missing, malformed, invalid, revoked, or expired credential — API key or personal access token (code: unauthorized).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"402":{"description":"The plan's limit is reached — the month's runs are used up, or long runs need the Team plan (code: plan_limit_reached).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"A personal access token that cannot act in the named workspace (unknown slug, not a member, or excluded by the token's scopes), is not granted this route's scope, or lacks the workspace role the route requires (code: forbidden).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"No such script or run in this workspace (code: not_found).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"429":{"description":"Per-key quota exhausted (code: rate_limited); retry after the Retry-After header.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"503":{"description":"Runs are unavailable (code: internal_error).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}},"tags":["Runs"]}},"/scripts/{slug}/versions/{number}/runs":{"post":{"operationId":"scriptVersions.run","summary":"Test-run a version","description":"Runs one VERSION — a draft before publishing — with these inputs, as a test run: recorded with `test: true`, not counted as the script's use, and without run events (no webhooks, no triggers). For the version's uploader, the script's owner, or an owner or admin; the script's approval policy still applies. Prove a draft works before asking a person to publish it.","security":[{"apiKey":[]},{"pat":[]}],"x-scope":"runs:write","parameters":[{"schema":{"type":"string","example":"unlock-account"},"required":true,"name":"slug","in":"path"},{"schema":{"type":"integer","minimum":1,"example":2},"required":true,"name":"number","in":"path"},{"schema":{"type":"string","minLength":1,"description":"Workspace slug. REQUIRED when authenticating with a personal access token (400 without it); ignored for API keys.","example":"acme"},"required":false,"description":"Workspace slug. REQUIRED when authenticating with a personal access token (400 without it); ignored for API keys.","name":"x-workspace","in":"header"},{"schema":{"type":"string","minLength":1,"description":"The environment the request acts in; without it, the product's default. An API key bound to an environment always acts in its own (403 naming another); an unknown environment is 400.","example":"live"},"required":false,"description":"The environment the request acts in; without it, the product's default. An API key bound to an environment always acts in its own (403 naming another); an unknown environment is 400.","name":"x-environment","in":"header"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RunInput"}}}},"responses":{"200":{"description":"The finished run — succeeded or failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Run"}}}},"202":{"description":"Answered before it finishes: held for a person's approval (`awaiting_approval`, with the request to approve — it runs once approved, or is `cancelled`), or a LONG run started (`running` — a script whose `timeout` is over 30 s). Poll the run (and its log) until it ends.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HeldRun"}}}},"400":{"description":"Invalid inputs (one `details` entry per field) or no published version (code: invalid_request).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Missing, malformed, invalid, revoked, or expired credential — API key or personal access token (code: unauthorized).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"402":{"description":"The plan's limit is reached — the month's runs are used up, or long runs need the Team plan (code: plan_limit_reached).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Not the version's uploader, the script's owner, or an owner or admin (code: forbidden).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"No such script or run in this workspace (code: not_found).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"429":{"description":"Per-key quota exhausted (code: rate_limited); retry after the Retry-After header.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"503":{"description":"Runs are unavailable (code: internal_error).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}},"tags":["Versions"]}},"/runs":{"get":{"operationId":"runs.list","summary":"List runs","description":"The workspace's runs, newest first — of one script with `?script=<slug>`. Paginate with the opaque `nextCursor` token.","security":[{"apiKey":[]},{"pat":[]}],"x-scope":"runs:read","parameters":[{"schema":{"type":"integer","minimum":1,"maximum":100,"default":25,"example":25,"description":"Items per page, 1–100 (default 25)."},"required":false,"description":"Items per page, 1–100 (default 25).","name":"limit","in":"query"},{"schema":{"type":"string","description":"Opaque token from a previous page's nextCursor."},"required":false,"description":"Opaque token from a previous page's nextCursor.","name":"cursor","in":"query"},{"schema":{"type":"string","example":"unlock-account","description":"Only this script's runs (its slug)."},"required":false,"description":"Only this script's runs (its slug).","name":"script","in":"query"},{"schema":{"type":"string","minLength":1,"description":"Workspace slug. REQUIRED when authenticating with a personal access token (400 without it); ignored for API keys.","example":"acme"},"required":false,"description":"Workspace slug. REQUIRED when authenticating with a personal access token (400 without it); ignored for API keys.","name":"x-workspace","in":"header"},{"schema":{"type":"string","minLength":1,"description":"The environment the request acts in; without it, the product's default. An API key bound to an environment always acts in its own (403 naming another); an unknown environment is 400.","example":"live"},"required":false,"description":"The environment the request acts in; without it, the product's default. An API key bound to an environment always acts in its own (403 naming another); an unknown environment is 400.","name":"x-environment","in":"header"}],"responses":{"200":{"description":"One page of runs.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RunPage"}}}},"400":{"description":"Malformed cursor or query (code: invalid_request).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Missing, malformed, invalid, revoked, or expired credential — API key or personal access token (code: unauthorized).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"A personal access token that cannot act in the named workspace (unknown slug, not a member, or excluded by the token's scopes), is not granted this route's scope, or lacks the workspace role the route requires (code: forbidden).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"No such script or run in this workspace (code: not_found).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"429":{"description":"Per-key quota exhausted (code: rate_limited); retry after the Retry-After header.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}},"tags":["Runs"]}},"/runs/{runId}":{"get":{"operationId":"runs.get","summary":"Get a run","description":"One run: its inputs, status, output or error, who started it and how, and its files — given to it and written by it — with download links.","security":[{"apiKey":[]},{"pat":[]}],"x-scope":"runs:read","parameters":[{"schema":{"type":"string"},"required":true,"name":"runId","in":"path"},{"schema":{"type":"string","minLength":1,"description":"Workspace slug. REQUIRED when authenticating with a personal access token (400 without it); ignored for API keys.","example":"acme"},"required":false,"description":"Workspace slug. REQUIRED when authenticating with a personal access token (400 without it); ignored for API keys.","name":"x-workspace","in":"header"},{"schema":{"type":"string","minLength":1,"description":"The environment the request acts in; without it, the product's default. An API key bound to an environment always acts in its own (403 naming another); an unknown environment is 400.","example":"live"},"required":false,"description":"The environment the request acts in; without it, the product's default. An API key bound to an environment always acts in its own (403 naming another); an unknown environment is 400.","name":"x-environment","in":"header"}],"responses":{"200":{"description":"The run.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Run"}}}},"401":{"description":"Missing, malformed, invalid, revoked, or expired credential — API key or personal access token (code: unauthorized).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"A personal access token that cannot act in the named workspace (unknown slug, not a member, or excluded by the token's scopes), is not granted this route's scope, or lacks the workspace role the route requires (code: forbidden).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"No such script or run in this workspace (code: not_found).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"429":{"description":"Per-key quota exhausted (code: rate_limited); retry after the Retry-After header.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}},"tags":["Runs"]}},"/runs/{runId}/cancel":{"post":{"operationId":"runs.cancel","summary":"Cancel a run","description":"Stops a LONG run that is still running: its code stops and the run ends `cancelled`. For the person who started it, the script's owner, or an owner or admin.","security":[{"apiKey":[]},{"pat":[]}],"x-scope":"runs:write","parameters":[{"schema":{"type":"string"},"required":true,"name":"runId","in":"path"},{"schema":{"type":"string","minLength":1,"description":"Workspace slug. REQUIRED when authenticating with a personal access token (400 without it); ignored for API keys.","example":"acme"},"required":false,"description":"Workspace slug. REQUIRED when authenticating with a personal access token (400 without it); ignored for API keys.","name":"x-workspace","in":"header"},{"schema":{"type":"string","minLength":1,"description":"The environment the request acts in; without it, the product's default. An API key bound to an environment always acts in its own (403 naming another); an unknown environment is 400.","example":"live"},"required":false,"description":"The environment the request acts in; without it, the product's default. An API key bound to an environment always acts in its own (403 naming another); an unknown environment is 400.","name":"x-environment","in":"header"}],"responses":{"200":{"description":"The cancelled run.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Run"}}}},"400":{"description":"Not a long run, or already finished (code: invalid_request).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Missing, malformed, invalid, revoked, or expired credential — API key or personal access token (code: unauthorized).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"A personal access token that cannot act in the named workspace (unknown slug, not a member, or excluded by the token's scopes), is not granted this route's scope, or lacks the workspace role the route requires (code: forbidden).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"No such script or run in this workspace (code: not_found).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"429":{"description":"Per-key quota exhausted (code: rate_limited); retry after the Retry-After header.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}},"tags":["Runs"]}},"/runs/{runId}/logs":{"get":{"operationId":"runs.logs","summary":"Get a run's log","description":"What the script wrote to standard error, line by line, with a line per request it made.","security":[{"apiKey":[]},{"pat":[]}],"x-scope":"runs:read","parameters":[{"schema":{"type":"string"},"required":true,"name":"runId","in":"path"},{"schema":{"type":"string","minLength":1,"description":"Workspace slug. REQUIRED when authenticating with a personal access token (400 without it); ignored for API keys.","example":"acme"},"required":false,"description":"Workspace slug. REQUIRED when authenticating with a personal access token (400 without it); ignored for API keys.","name":"x-workspace","in":"header"},{"schema":{"type":"string","minLength":1,"description":"The environment the request acts in; without it, the product's default. An API key bound to an environment always acts in its own (403 naming another); an unknown environment is 400.","example":"live"},"required":false,"description":"The environment the request acts in; without it, the product's default. An API key bound to an environment always acts in its own (403 naming another); an unknown environment is 400.","name":"x-environment","in":"header"}],"responses":{"200":{"description":"The log.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RunLog"}}}},"401":{"description":"Missing, malformed, invalid, revoked, or expired credential — API key or personal access token (code: unauthorized).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"A personal access token that cannot act in the named workspace (unknown slug, not a member, or excluded by the token's scopes), is not granted this route's scope, or lacks the workspace role the route requires (code: forbidden).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"No such script or run in this workspace (code: not_found).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"429":{"description":"Per-key quota exhausted (code: rate_limited); retry after the Retry-After header.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}},"tags":["Runs"]}},"/secrets":{"get":{"operationId":"secrets.list","summary":"List secrets","description":"The workspace's secrets by name, with the environments that have a value and the hosts each value may be sent to — never the values.","security":[{"apiKey":[]},{"pat":[]}],"x-scope":"secrets:read","parameters":[{"schema":{"type":"string","minLength":1,"description":"Workspace slug. REQUIRED when authenticating with a personal access token (400 without it); ignored for API keys.","example":"acme"},"required":false,"description":"Workspace slug. REQUIRED when authenticating with a personal access token (400 without it); ignored for API keys.","name":"x-workspace","in":"header"},{"schema":{"type":"string","minLength":1,"description":"The environment the request acts in; without it, the product's default. An API key bound to an environment always acts in its own (403 naming another); an unknown environment is 400.","example":"live"},"required":false,"description":"The environment the request acts in; without it, the product's default. An API key bound to an environment always acts in its own (403 naming another); an unknown environment is 400.","name":"x-environment","in":"header"}],"responses":{"200":{"description":"The secrets.","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/Secret"}}},"required":["items"]}}}},"401":{"description":"Missing, malformed, invalid, revoked, or expired credential — API key or personal access token (code: unauthorized).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"A personal access token that cannot act in the named workspace (unknown slug, not a member, or excluded by the token's scopes), is not granted this route's scope, or lacks the workspace role the route requires (code: forbidden).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"429":{"description":"Per-key quota exhausted (code: rate_limited); retry after the Retry-After header.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}},"tags":["Secrets"]}},"/secrets/{name}":{"put":{"operationId":"secrets.set","summary":"Save a secret","description":"Saves the secret's value in the request's environment: creates it, or replaces the value and its hosts (rotation). The value is encrypted and never returned by any call. `hosts` are the ONLY hosts that value is ever sent to — a script cannot send it anywhere else. Workspace owners and admins, or a workspace API key.","x-mcp":{"expose":false,"reason":"Secret values are a person's to handle; an agent asks the person to add the secret"},"security":[{"apiKey":[]},{"pat":[]}],"x-scope":"secrets:write","parameters":[{"schema":{"type":"string","example":"ADMIN_KEY"},"required":true,"name":"name","in":"path"},{"schema":{"type":"string","minLength":1,"description":"Workspace slug. REQUIRED when authenticating with a personal access token (400 without it); ignored for API keys.","example":"acme"},"required":false,"description":"Workspace slug. REQUIRED when authenticating with a personal access token (400 without it); ignored for API keys.","name":"x-workspace","in":"header"},{"schema":{"type":"string","minLength":1,"description":"The environment the request acts in; without it, the product's default. An API key bound to an environment always acts in its own (403 naming another); an unknown environment is 400.","example":"live"},"required":false,"description":"The environment the request acts in; without it, the product's default. An API key bound to an environment always acts in its own (403 naming another); an unknown environment is 400.","name":"x-environment","in":"header"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SecretInput"}}}},"responses":{"200":{"description":"The secret (without its value).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Secret"}}}},"400":{"description":"Invalid name, value or hosts (code: invalid_request).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Missing, malformed, invalid, revoked, or expired credential — API key or personal access token (code: unauthorized).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"A personal access token that cannot act in the named workspace (unknown slug, not a member, or excluded by the token's scopes), is not granted this route's scope, or lacks the workspace role the route requires (code: forbidden).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"429":{"description":"Per-key quota exhausted (code: rate_limited); retry after the Retry-After header.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"503":{"description":"Secrets are unavailable (code: internal_error).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}},"tags":["Secrets"]},"delete":{"operationId":"secrets.delete","summary":"Delete a secret","description":"Deletes it and its value in every environment; runs of scripts that use it fail until it is saved again. Workspace owners and admins, or a workspace API key.","x-mcp":{"expose":false,"reason":"Secret values are a person's to handle; an agent asks the person to add the secret"},"security":[{"apiKey":[]},{"pat":[]}],"x-scope":"secrets:write","parameters":[{"schema":{"type":"string","example":"ADMIN_KEY"},"required":true,"name":"name","in":"path"},{"schema":{"type":"string","minLength":1,"description":"Workspace slug. REQUIRED when authenticating with a personal access token (400 without it); ignored for API keys.","example":"acme"},"required":false,"description":"Workspace slug. REQUIRED when authenticating with a personal access token (400 without it); ignored for API keys.","name":"x-workspace","in":"header"},{"schema":{"type":"string","minLength":1,"description":"The environment the request acts in; without it, the product's default. An API key bound to an environment always acts in its own (403 naming another); an unknown environment is 400.","example":"live"},"required":false,"description":"The environment the request acts in; without it, the product's default. An API key bound to an environment always acts in its own (403 naming another); an unknown environment is 400.","name":"x-environment","in":"header"}],"responses":{"204":{"description":"Deleted."},"401":{"description":"Missing, malformed, invalid, revoked, or expired credential — API key or personal access token (code: unauthorized).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"A personal access token that cannot act in the named workspace (unknown slug, not a member, or excluded by the token's scopes), is not granted this route's scope, or lacks the workspace role the route requires (code: forbidden).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"No such secret (code: not_found).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"429":{"description":"Per-key quota exhausted (code: rate_limited); retry after the Retry-After header.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}},"tags":["Secrets"]}},"/secrets/{name}/values/{environment}":{"delete":{"operationId":"secrets.unset","summary":"Remove a secret's value from an environment","description":"Removes the value in that environment only; the secret and its other values stay. Runs there that use it fail until a value is saved again. Workspace owners and admins, or a workspace API key.","x-mcp":{"expose":false,"reason":"Secret values are a person's to handle; an agent asks the person to add the secret"},"security":[{"apiKey":[]},{"pat":[]}],"x-scope":"secrets:write","parameters":[{"schema":{"type":"string","example":"ADMIN_KEY"},"required":true,"name":"name","in":"path"},{"schema":{"type":"string","example":"staging"},"required":true,"name":"environment","in":"path"},{"schema":{"type":"string","minLength":1,"description":"Workspace slug. REQUIRED when authenticating with a personal access token (400 without it); ignored for API keys.","example":"acme"},"required":false,"description":"Workspace slug. REQUIRED when authenticating with a personal access token (400 without it); ignored for API keys.","name":"x-workspace","in":"header"},{"schema":{"type":"string","minLength":1,"description":"The environment the request acts in; without it, the product's default. An API key bound to an environment always acts in its own (403 naming another); an unknown environment is 400.","example":"live"},"required":false,"description":"The environment the request acts in; without it, the product's default. An API key bound to an environment always acts in its own (403 naming another); an unknown environment is 400.","name":"x-environment","in":"header"}],"responses":{"204":{"description":"Removed."},"400":{"description":"No such environment (code: invalid_request).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Missing, malformed, invalid, revoked, or expired credential — API key or personal access token (code: unauthorized).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"A personal access token that cannot act in the named workspace (unknown slug, not a member, or excluded by the token's scopes), is not granted this route's scope, or lacks the workspace role the route requires (code: forbidden).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"No such secret, or no value in that environment (code: not_found).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"429":{"description":"Per-key quota exhausted (code: rate_limited); retry after the Retry-After header.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}},"tags":["Secrets"]}},"/environments":{"get":{"operationId":"environments.list","summary":"List environments","description":"The workspace's environments, oldest first, with which is the default. Name one with the X-Environment header to act in it.","security":[{"apiKey":[]},{"pat":[]}],"x-scope":"environments:read","parameters":[{"schema":{"type":"string","minLength":1,"description":"Workspace slug. REQUIRED when authenticating with a personal access token (400 without it); ignored for API keys.","example":"acme"},"required":false,"description":"Workspace slug. REQUIRED when authenticating with a personal access token (400 without it); ignored for API keys.","name":"x-workspace","in":"header"},{"schema":{"type":"string","minLength":1,"description":"The environment the request acts in; without it, the product's default. An API key bound to an environment always acts in its own (403 naming another); an unknown environment is 400.","example":"live"},"required":false,"description":"The environment the request acts in; without it, the product's default. An API key bound to an environment always acts in its own (403 naming another); an unknown environment is 400.","name":"x-environment","in":"header"}],"responses":{"200":{"description":"The environments.","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/Environment"}}},"required":["items"]}}}},"401":{"description":"Missing, malformed, invalid, revoked, or expired credential — API key or personal access token (code: unauthorized).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"A personal access token that cannot act in the named workspace (unknown slug, not a member, or excluded by the token's scopes), is not granted this route's scope, or lacks the workspace role the route requires (code: forbidden).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"429":{"description":"Per-key quota exhausted (code: rate_limited); retry after the Retry-After header.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}},"tags":["Environments"]},"post":{"operationId":"environments.create","summary":"Add an environment","description":"Adds an environment with no secret values yet — save them with X-Environment set to it. Lowercase letters, digits and dashes. Owners and admins, or a workspace API key.","x-mcp":{"expose":false,"reason":"Environments hold secret values and rules — a person sets them up; an agent asks"},"security":[{"apiKey":[]},{"pat":[]}],"x-scope":"environments:write","parameters":[{"schema":{"type":"string","minLength":1,"description":"Workspace slug. REQUIRED when authenticating with a personal access token (400 without it); ignored for API keys.","example":"acme"},"required":false,"description":"Workspace slug. REQUIRED when authenticating with a personal access token (400 without it); ignored for API keys.","name":"x-workspace","in":"header"},{"schema":{"type":"string","minLength":1,"description":"The environment the request acts in; without it, the product's default. An API key bound to an environment always acts in its own (403 naming another); an unknown environment is 400.","example":"live"},"required":false,"description":"The environment the request acts in; without it, the product's default. An API key bound to an environment always acts in its own (403 naming another); an unknown environment is 400.","name":"x-environment","in":"header"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/EnvironmentInput"}}}},"responses":{"201":{"description":"The environment.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Environment"}}}},"400":{"description":"Invalid request (code: invalid_request).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Missing, malformed, invalid, revoked, or expired credential — API key or personal access token (code: unauthorized).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"402":{"description":"The plan's limit is reached — Free includes production only, Team 3 environments, Business 10; requiring approval of every run needs Business (code: plan_limit_reached).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"A personal access token that cannot act in the named workspace (unknown slug, not a member, or excluded by the token's scopes), is not granted this route's scope, or lacks the workspace role the route requires (code: forbidden).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"No such environment (code: not_found).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"429":{"description":"Per-key quota exhausted (code: rate_limited); retry after the Retry-After header.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}},"tags":["Environments"]}},"/environments/{environment}":{"get":{"operationId":"environments.get","summary":"Get an environment","description":"One environment, with what uses it: the secret values deleting it would delete, and the schedules and triggers that keep it from being deleted.","security":[{"apiKey":[]},{"pat":[]}],"x-scope":"environments:read","parameters":[{"schema":{"type":"string","example":"staging"},"required":true,"name":"environment","in":"path"},{"schema":{"type":"string","minLength":1,"description":"Workspace slug. REQUIRED when authenticating with a personal access token (400 without it); ignored for API keys.","example":"acme"},"required":false,"description":"Workspace slug. REQUIRED when authenticating with a personal access token (400 without it); ignored for API keys.","name":"x-workspace","in":"header"},{"schema":{"type":"string","minLength":1,"description":"The environment the request acts in; without it, the product's default. An API key bound to an environment always acts in its own (403 naming another); an unknown environment is 400.","example":"live"},"required":false,"description":"The environment the request acts in; without it, the product's default. An API key bound to an environment always acts in its own (403 naming another); an unknown environment is 400.","name":"x-environment","in":"header"}],"responses":{"200":{"description":"The environment.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EnvironmentDetail"}}}},"400":{"description":"Invalid request (code: invalid_request).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Missing, malformed, invalid, revoked, or expired credential — API key or personal access token (code: unauthorized).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"A personal access token that cannot act in the named workspace (unknown slug, not a member, or excluded by the token's scopes), is not granted this route's scope, or lacks the workspace role the route requires (code: forbidden).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"No such environment (code: not_found).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"429":{"description":"Per-key quota exhausted (code: rate_limited); retry after the Retry-After header.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}},"tags":["Environments"]},"patch":{"operationId":"environments.update","summary":"Change an environment","description":"Renames it, changes its rules, or makes it the workspace's default (`isDefault: true`). Runs keep the name they ran under. Owners and admins, or a workspace API key.","x-mcp":{"expose":false,"reason":"Environments hold secret values and rules — a person sets them up; an agent asks"},"security":[{"apiKey":[]},{"pat":[]}],"x-scope":"environments:write","parameters":[{"schema":{"type":"string","example":"staging"},"required":true,"name":"environment","in":"path"},{"schema":{"type":"string","minLength":1,"description":"Workspace slug. REQUIRED when authenticating with a personal access token (400 without it); ignored for API keys.","example":"acme"},"required":false,"description":"Workspace slug. REQUIRED when authenticating with a personal access token (400 without it); ignored for API keys.","name":"x-workspace","in":"header"},{"schema":{"type":"string","minLength":1,"description":"The environment the request acts in; without it, the product's default. An API key bound to an environment always acts in its own (403 naming another); an unknown environment is 400.","example":"live"},"required":false,"description":"The environment the request acts in; without it, the product's default. An API key bound to an environment always acts in its own (403 naming another); an unknown environment is 400.","name":"x-environment","in":"header"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/EnvironmentPatch"}}}},"responses":{"200":{"description":"The environment.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Environment"}}}},"400":{"description":"Invalid request (code: invalid_request).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Missing, malformed, invalid, revoked, or expired credential — API key or personal access token (code: unauthorized).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"402":{"description":"The plan's limit is reached — Free includes production only, Team 3 environments, Business 10; requiring approval of every run needs Business (code: plan_limit_reached).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"A personal access token that cannot act in the named workspace (unknown slug, not a member, or excluded by the token's scopes), is not granted this route's scope, or lacks the workspace role the route requires (code: forbidden).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"No such environment (code: not_found).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"429":{"description":"Per-key quota exhausted (code: rate_limited); retry after the Retry-After header.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}},"tags":["Environments"]},"delete":{"operationId":"environments.delete","summary":"Delete an environment","description":"Deletes it and every secret value it holds (GET it first to see how many). Refused for the only environment, the default, and one a schedule or trigger runs in. Owners and admins, or a workspace API key.","x-mcp":{"expose":false,"reason":"Environments hold secret values and rules — a person sets them up; an agent asks"},"security":[{"apiKey":[]},{"pat":[]}],"x-scope":"environments:write","parameters":[{"schema":{"type":"string","example":"staging"},"required":true,"name":"environment","in":"path"},{"schema":{"type":"string","minLength":1,"description":"Workspace slug. REQUIRED when authenticating with a personal access token (400 without it); ignored for API keys.","example":"acme"},"required":false,"description":"Workspace slug. REQUIRED when authenticating with a personal access token (400 without it); ignored for API keys.","name":"x-workspace","in":"header"},{"schema":{"type":"string","minLength":1,"description":"The environment the request acts in; without it, the product's default. An API key bound to an environment always acts in its own (403 naming another); an unknown environment is 400.","example":"live"},"required":false,"description":"The environment the request acts in; without it, the product's default. An API key bound to an environment always acts in its own (403 naming another); an unknown environment is 400.","name":"x-environment","in":"header"}],"responses":{"204":{"description":"Deleted."},"400":{"description":"Invalid request (code: invalid_request).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Missing, malformed, invalid, revoked, or expired credential — API key or personal access token (code: unauthorized).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"A personal access token that cannot act in the named workspace (unknown slug, not a member, or excluded by the token's scopes), is not granted this route's scope, or lacks the workspace role the route requires (code: forbidden).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"No such environment (code: not_found).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"429":{"description":"Per-key quota exhausted (code: rate_limited); retry after the Retry-After header.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}},"tags":["Environments"]}},"/files":{"post":{"operationId":"files.create","summary":"Upload a file","description":"Uploads a file to give a run: send its bytes as the body with its `Content-Type` and `Content-Length`, and its name as `?name=`. Then pass the returned id as a file input (`{ \"<input>\": \"file_…\" }`). An upload no run uses within a day is deleted; one run uses it.","security":[{"apiKey":[]},{"pat":[]}],"x-mcp":{"expose":false,"reason":"Takes raw bytes, which an agent's tool call can't carry; agents pass an https link as the file input instead."},"x-cli":{"command":"files upload","args":[]},"x-scope":"runs:write","parameters":[{"schema":{"type":"string","minLength":1,"maxLength":500,"example":"adjustments.csv","description":"The file's name."},"required":true,"description":"The file's name.","name":"name","in":"query"},{"schema":{"type":"string","minLength":1,"description":"Workspace slug. REQUIRED when authenticating with a personal access token (400 without it); ignored for API keys.","example":"acme"},"required":false,"description":"Workspace slug. REQUIRED when authenticating with a personal access token (400 without it); ignored for API keys.","name":"x-workspace","in":"header"},{"schema":{"type":"string","minLength":1,"description":"The environment the request acts in; without it, the product's default. An API key bound to an environment always acts in its own (403 naming another); an unknown environment is 400.","example":"live"},"required":false,"description":"The environment the request acts in; without it, the product's default. An API key bound to an environment always acts in its own (403 naming another); an unknown environment is 400.","name":"x-environment","in":"header"}],"requestBody":{"required":true,"content":{"application/octet-stream":{"schema":{"type":"string","format":"binary"}}}},"responses":{"201":{"description":"The uploaded file.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/File"}}}},"400":{"description":"Empty, or missing its Content-Length (code: invalid_request).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Missing, malformed, invalid, revoked, or expired credential — API key or personal access token (code: unauthorized).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"402":{"description":"Larger than the plan takes (code: plan_limit_reached).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"A personal access token that cannot act in the named workspace (unknown slug, not a member, or excluded by the token's scopes), is not granted this route's scope, or lacks the workspace role the route requires (code: forbidden).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"429":{"description":"Per-key quota exhausted (code: rate_limited); retry after the Retry-After header.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}},"tags":["Files"]},"get":{"operationId":"files.list","summary":"List files","description":"Files runs wrote, newest first, across the scripts you can see — until they expire. `?script=<slug>` narrows to one script, `?direction=in` lists the files runs were given (`all` for both), and `?q=` matches names. Each comes with a download link valid for an hour. Paginate with the opaque `nextCursor` token.","security":[{"apiKey":[]},{"pat":[]}],"x-cli":{"command":"files list","args":[]},"x-scope":"runs:read","parameters":[{"schema":{"type":"integer","minimum":1,"maximum":100,"default":25,"example":25,"description":"Items per page, 1–100 (default 25)."},"required":false,"description":"Items per page, 1–100 (default 25).","name":"limit","in":"query"},{"schema":{"type":"string","description":"Opaque token from a previous page's nextCursor."},"required":false,"description":"Opaque token from a previous page's nextCursor.","name":"cursor","in":"query"},{"schema":{"type":"string","example":"monthly-report","description":"Only files from this script's runs (its slug)."},"required":false,"description":"Only files from this script's runs (its slug).","name":"script","in":"query"},{"schema":{"type":"string","enum":["in","out","all"],"description":"`out` (default): written by runs; `in`: given to them."},"required":false,"description":"`out` (default): written by runs; `in`: given to them.","name":"direction","in":"query"},{"schema":{"type":"string","maxLength":200,"example":"revenue","description":"Only files whose name contains this."},"required":false,"description":"Only files whose name contains this.","name":"q","in":"query"},{"schema":{"type":"string","minLength":1,"description":"Workspace slug. REQUIRED when authenticating with a personal access token (400 without it); ignored for API keys.","example":"acme"},"required":false,"description":"Workspace slug. REQUIRED when authenticating with a personal access token (400 without it); ignored for API keys.","name":"x-workspace","in":"header"},{"schema":{"type":"string","minLength":1,"description":"The environment the request acts in; without it, the product's default. An API key bound to an environment always acts in its own (403 naming another); an unknown environment is 400.","example":"live"},"required":false,"description":"The environment the request acts in; without it, the product's default. An API key bound to an environment always acts in its own (403 naming another); an unknown environment is 400.","name":"x-environment","in":"header"}],"responses":{"200":{"description":"One page of files.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FilePage"}}}},"400":{"description":"Malformed cursor or query (code: invalid_request).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Missing, malformed, invalid, revoked, or expired credential — API key or personal access token (code: unauthorized).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"A personal access token that cannot act in the named workspace (unknown slug, not a member, or excluded by the token's scopes), is not granted this route's scope, or lacks the workspace role the route requires (code: forbidden).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"No such file in this workspace, or it has expired (code: not_found).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"429":{"description":"Per-key quota exhausted (code: rate_limited); retry after the Retry-After header.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}},"tags":["Files"]}},"/files/{fileId}":{"get":{"operationId":"files.get","summary":"Get a file","description":"A file's name, type, size and the run that took or wrote it, with a download link valid for an hour. A run's files are readable by whoever can see the run; an upload not yet used, by whoever uploaded it.","security":[{"apiKey":[]},{"pat":[]}],"x-scope":"runs:read","parameters":[{"schema":{"type":"string"},"required":true,"name":"fileId","in":"path"},{"schema":{"type":"string","minLength":1,"description":"Workspace slug. REQUIRED when authenticating with a personal access token (400 without it); ignored for API keys.","example":"acme"},"required":false,"description":"Workspace slug. REQUIRED when authenticating with a personal access token (400 without it); ignored for API keys.","name":"x-workspace","in":"header"},{"schema":{"type":"string","minLength":1,"description":"The environment the request acts in; without it, the product's default. An API key bound to an environment always acts in its own (403 naming another); an unknown environment is 400.","example":"live"},"required":false,"description":"The environment the request acts in; without it, the product's default. An API key bound to an environment always acts in its own (403 naming another); an unknown environment is 400.","name":"x-environment","in":"header"}],"responses":{"200":{"description":"The file.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/File"}}}},"401":{"description":"Missing, malformed, invalid, revoked, or expired credential — API key or personal access token (code: unauthorized).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"A personal access token that cannot act in the named workspace (unknown slug, not a member, or excluded by the token's scopes), is not granted this route's scope, or lacks the workspace role the route requires (code: forbidden).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"No such file in this workspace, or it has expired (code: not_found).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"429":{"description":"Per-key quota exhausted (code: rate_limited); retry after the Retry-After header.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}},"tags":["Files"]}},"/files/{fileId}/content":{"get":{"operationId":"files.content","summary":"Download a file","description":"The file's bytes, always as an attachment (`Content-Disposition: attachment`) — never shown as a page.","security":[{"apiKey":[]},{"pat":[]}],"x-mcp":{"expose":false,"reason":"Returns raw bytes; agents use the file's downloadUrl (files.get) instead."},"x-cli":{"command":"files download","args":["fileId"]},"x-scope":"runs:read","parameters":[{"schema":{"type":"string"},"required":true,"name":"fileId","in":"path"},{"schema":{"type":"string","minLength":1,"description":"Workspace slug. REQUIRED when authenticating with a personal access token (400 without it); ignored for API keys.","example":"acme"},"required":false,"description":"Workspace slug. REQUIRED when authenticating with a personal access token (400 without it); ignored for API keys.","name":"x-workspace","in":"header"},{"schema":{"type":"string","minLength":1,"description":"The environment the request acts in; without it, the product's default. An API key bound to an environment always acts in its own (403 naming another); an unknown environment is 400.","example":"live"},"required":false,"description":"The environment the request acts in; without it, the product's default. An API key bound to an environment always acts in its own (403 naming another); an unknown environment is 400.","name":"x-environment","in":"header"}],"responses":{"200":{"description":"The file's bytes.","content":{"application/octet-stream":{"schema":{"type":"string","format":"binary"}}}},"401":{"description":"Missing, malformed, invalid, revoked, or expired credential — API key or personal access token (code: unauthorized).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"A personal access token that cannot act in the named workspace (unknown slug, not a member, or excluded by the token's scopes), is not granted this route's scope, or lacks the workspace role the route requires (code: forbidden).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"No such file in this workspace, or it has expired (code: not_found).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"429":{"description":"Per-key quota exhausted (code: rate_limited); retry after the Retry-After header.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}},"tags":["Files"]}}},"webhooks":{},"tags":[{"name":"Scripts"},{"name":"Runs"},{"name":"Versions"},{"name":"Schedules"},{"name":"Triggers"},{"name":"Files"},{"name":"Environments"},{"name":"Secrets"},{"name":"Script settings"},{"name":"Workspace"},{"name":"Webhooks"},{"name":"Approvals"},{"name":"Audit events"},{"name":"Personal access tokens"}]}