shiftlabs Start free
Menu Approvals

Approvals

A workflow tool marked "approval": "always" never runs on the model's word alone, and a workflow can stop for an approver with step.waitForApproval. Each request waits until an admin or approver, or the approvers it names, approves or denies it, in the dashboard, with the API or in Slack. A change the helper makes waits for the person who asked for it.

How a call is held

When the model calls a tool marked "approval": "always", nothing runs. The call becomes a request in the workspace's approvals, and the conversation reads waiting for approval. The agent tells the person it is waiting.

jsontool
{
  "workflow": "stripe-refund",
  "description": "Refund all or part of a paid invoice. Waits for an approver.",
  "parameters": {
    "type": "object",
    "properties": {
      "invoice": {"type": "string"},
      "amount": {"type": "integer", "minimum": 1}
    },
    "required": ["invoice"]
  },
  "approval": "always"
}
  • A request holds the exact arguments the model asked for. An approval runs those arguments.
  • Only workflow tools can wait for approval. Code tools have no network and never do.
  • Every workflow tool sets approval, so whether a call waits is always written down: "never" runs each call without asking. A deploy without it is refused with 400.
  • Each template holds its tools that write to another service for approval, the Slack post to your own channel too.

Who approves

"approval": "always" goes to every admin and every member with the approver role. To send a tool's calls to certain people, name them with "approval": {"approvers": [...]}; a workflow names them with step.waitForApproval's approvers.

jsontool
{
  "workflow": "stripe-refund",
  "description": "Refund a paid invoice. Waits for Ana or Ben.",
  "approval": {"approvers": ["ana@acme.com", "ben@acme.com"]}
}
  • role:admin

    Every admin.

  • role:approver

    Every approver, and no admin.

  • role:manager

    Every admin and approver.

  • A member's email

    The email they sign in with. An agent's tools can name only members who are admins or approvers when you deploy; a deploy that names anyone else is refused.

  • List up to 20 roles and emails. A developer never approves, so role:developer and role:viewer are refused.
  • A workspace has up to 50 approval rules, each with up to 10 conditions and at most 8 KB (8,192 bytes) as JSON, on every plan. Saving a rule past any of them is refused, naming the limit: 409 {"error": "a workspace has at most 50 approval rules; delete one to add another"}, 400 {"error": "a rule has at most 10 conditions; match.when lists 11"}, or 400 {"error": "a rule takes at most 8192 bytes as JSON; this one takes 8193"}. They are checked only when a rule is saved, so they never hold up a run.
  • Only the approvers a request names see it in the Approvals screen and in GET /v1/approvals, and only they get its notice. Anyone else, admins included, gets 403 when they try to answer it.
  • API keys have no email: a key answers a request only if it names a role the key holds, or names nobody.
  • A request naming only role:approver in a workspace with no approver waits until a member holds the role, who can answer it at once, or until it runs out (72 hours by default) and counts as denied. Meanwhile nobody can answer it, but its notice still goes to the alert destinations, and to the Slack channel if one is chosen.
  • A named member who leaves the workspace, or stops being an admin or approver, drops out of the request. When nobody it named is left, it goes to every admin and approver. If they come back as an admin or approver, later requests name them again.
  • A workflow's request can name anyone. Within 15 minutes of the request, shiftlabs checks the members it names, whether or not approval notices are on. Anyone who isn't an admin or approver of the workspace drops out, and if nobody is left the request goes to every admin and approver. A member already found to be neither drops out at once.
  • In a workspace with no members, such as one used only through API keys, a request that names only members goes to every admin at once.

Two approvers

A workspace can make every request need two approvers: in Settings → Approvals, set Approvals a request needs to 2. Two different members must then approve each request before its tool runs or its run goes on, and whoever raised the request can't be one of them. Code can ask for more approvals than the workspace's setting, never fewer.

payout-approval
const decision = await step.waitForApproval("payout", {
  message: `Pay $${payload.amount} to ${payload.vendor}?`,
  approvals: 2,
});
  • Settings → Approvals

    1, the default, or 2. An admin changes it, and it holds for requests made after the change. PUT /v1/workspace/approvals {"required": 2} sets it too.

  • approvals

    1 to 5, on step.waitForApproval (in Python, approvals=) or on a workflow tool, as "approval": {"approvals": 2}. A request needs the larger of this and the workspace's setting.

  • Each approval must come from a different member. A member counts once, whether they answer in the dashboard or in Slack. Approving a request twice returns 409 {"error": "you already approved this request"}.
  • One denial ends the request, even after other approvals.
  • When a request needs two or more approvals, only members approve it. An API key can still deny it. Its approval returns 403.
  • When a request needs two or more approvals, whoever raised it can't give one of them. They can still deny it, or stop the run. Their approval returns 403 {"error":"forbidden","reason":"you raised this request; it needs 2 approvals from other approvers"}, with the number of approvals the request needs; a request made under an approval rule names the rule too. In Slack they get a reply only they see: You raised this request, so another approver must approve it. You can still deny it. On the Approvals screen and a run's page, their Approve is turned off, with You raised this request; another approver is needed. The table below says who raised a request.
  • Approvals a requester gave on their own request before this rule don't count toward the two, so such a request waits for another approver again.
  • The request's approvers still decide who may answer. A request that names only members must name at least as many as the approvals it asks for, or step.waitForApproval throws and the agent isn't deployed. If the workspace's setting asks for more approvals than the members a request names, or named members leave, any admin may give the other approvals, but one must still come from a member the request names. When nobody it named is left, any admin or approver answers it.
  • Whoever raised a request doesn't count among the members it names. When the others are fewer than the approvals it needs, any admin may give the approvals they can't, but one must still come from another member it names. When the requester is the only member it names, any admin or approver answers it.
  • The run or the agent gets the answer once the last approval it needs is in. by and note come from that approval, or from the denial.
  • When fewer members can still approve a request than the approvals it still needs, the Approvals screen and a run's page say so on the request, for example Needs 2 approvals, but only 1 member besides the requester can approve, so this can't be approved yet. Add another approver, or deny it. Its Approve stays on: an approval given meanwhile still counts once another approver joins. GET /v1/approvals and a run's page give such a request eligible, below.
  • The Approvals screen shows how many approvals that count each request has, and GET /v1/approvals lists them as approvals.
  • Setting 2 needs at least two members who can approve (admins and approvers), as one person approves a request once. With fewer, PUT returns 409 {"error":"fewer than two members can approve; two approvals needs at least two members who can approve"}. With exactly two, a request either of them raises can't reach two approvals: PUT saves it and answers "warning": "Only 2 of your members can approve, so a request either of them raises can't reach 2 approvals, because the requester's own approval is refused. Add another approver or switch to 1 approval.", which GET repeats and Settings → Approvals shows under 2. When a removal or a role change later leaves fewer than two who can approve, the setting stays 2 and GET answers "warning": "Only 1 of your members can approve, so requests that need 2 approvals can't be approved. Add an approver or switch to 1 approval.", or "No one in this workspace can approve, …" with none, which Settings → Approvals shows under 2 too. A workspace used only through API keys has no members, so it can't set 2 either: PUT returns 409. In a workspace with no members, code that asks for 2 or more approvals makes a request nobody can approve, so it expires as denied.
Who raised a request
SourceRequester
A run or agent conversation a member started: the dashboard, the API, MCP, a re-run or a resumethat member
A run or conversation started with an API keythe key, and the member who created it
A run started by another run, a continued run, an agent's tool call, or step.askthe requester of the run or conversation that started it
A promotionthe member who promoted, or the key and the member who created it
A trigger, webhook, schedule, queue or end user's chatnobody: every approver counts

Workflow runs

A workflow asks with step.waitForApproval(name, { message, timeout, approvers, approvals, policy }), and its run waits for the answer. See Approvals in workflows.

  • workflow · runId

    The workflow, and the run that waits.

  • name · message

    What the workflow called the request, and its message for the approvers.

  • policy

    What the workflow said of the request, { name?, risk? }: which of its rules asks, and low, medium or high. null without one.

  • rule

    The approval rule the request was made under, as it was then: {id, version, name, matched, noSelfApproval?}, where matched lists the conditions that held. Absent when no rule applied.

  • The run gets { approved, by, note } once you answer. Unanswered by its timeout, 72 hours by default, it gets approved: false and by: null.
  • A key scoped to some workflows lists and answers only their runs' requests. A key whose scope names agents alone isn't limited here: it reaches every run's requests.
  • A run's requests are listed and answered in every workspace, with or without agents.
  • GET /v1/approvals lists a run's requests only with kinds=workflow or kinds=agent,workflow. Without kinds, it lists agents' requests only.
  • GET /v1/runs/:id lists the run's newest 20 requests as approvals, to anyone who can see the run. A request you may answer comes with every field above and "canAnswer": true. Any other comes with id, workflow, runId, name, message, status, requestedAt, expiresAt, decidedAt, required, approvalCount (the approvals it has so far), policy, rule when one applied, and "canAnswer": false, without who may answer, who answered or their note.
  • A run that ends while its request waits, for example when it is stopped, takes the request out of the inbox: it expires.
  • A request a run races with step.waitForAny leaves the inbox as withdrawn once something else in the race comes first, such as an event or a timer. Answering it then returns 409 {"error": "already decided"}, and a Slack message already sent for it is edited to say it was withdrawn. See Wait for whichever comes first.

Approval rules

Admins set rules for what a workflow run's request needs, whatever its code asks: more approvals, who may give them, and whether whoever raised it may approve it. A rule can match on the run's payload, for example two approvals whenever environment is prod. Rules apply to a run's requests from step.waitForApproval, and to those step.activity makes for an activity that needs an approval. They don't apply to agents' tool calls or promotions.

shellcurl
curl -X POST https://api.shiftlabs.org/v1/approval-rules \
  -H "authorization: Bearer $SHIFTLABS_API_KEY" \
  -H "content-type: application/json" \
  -d '{"name": "production changes",
       "match": {"when": [{"path": "environment", "op": "eq", "value": "prod"}]},
       "set": {"approvals": 2, "noSelfApproval": true}}'
  • name · enabled

    Up to 100 characters, which each request the rule applies to shows. enabled is true unless you set false, which keeps the rule without applying it.

  • match

    Which requests it applies to: workflow, a workflow's name; approval, the name the code gives step.waitForApproval, or activity and the step's name for an activity's request, as in activity restart, which every call of that step in a run matches, though from the second the request shows activity restart #2; and when, up to 10 conditions on the run's payload, all of which must hold. A field left out matches any request, so a rule without match applies to every one.

  • when

    Each condition is {path, op, value}. path is a payload field, dotted for one inside another, such as environment or target.region; a number picks a list's item. op is eq or ne with text of up to 200 characters, without control characters such as line breaks, a number, true, false or null; in with a list of 1 to 20 of those; lt or gt with a number; or exists, without value. Text matches exactly, case included.

  • set

    What the request needs, one or more of: approvals, 1 to 5; approvers, up to 20 roles or member emails, as for approvers, or [] for every admin and approver; and noSelfApproval: true.

  • id · version · updatedAt · updatedBy

    What the API answers besides: the rule's id, its version, which every change puts up by one, and when and by whom it last changed.

  • Rules are tried in order, and the first that is on and matches applies: a request has one rule at most. A new rule goes last. PUT /v1/approval-rules/order with {"ids": [...]}, every rule's id once, sets the order.
  • A request needs the most of its code's approvals, the workspace's setting and the rule's approvals: a rule never lowers what the code asks for. A rule's approvers replace the ones the code names, and members who left drop out of them as from the code's; without them, the code's stand. When they name fewer members than the approvals the request needs, any admin may give the others, but one must still come from a member they name.
  • Erasing a person takes them out of every rule's approvers, a version up. A rule left naming nobody keeps approvers: [], so any admin or approver answers its requests, as when its members leave, never the approvers the code names. A rule may also keep a members list that erasure left shorter than its approvals, and a PUT that leaves its approvers and approvals as they are saves it; a new or changed list must name at least as many members as the approvals, or a role, or returns 400 {"error": "set.approvers names 1 member, too few for 2 approvals; name more members or a role"}.
  • With noSelfApproval, whoever raised the request can't approve it, even when it needs one approval. They can still deny it, or stop the run. API keys can't approve under the rule either: only members approve the request, and a key can still deny it. The API's refusal of an approval of a request made under a rule names the rule, whatever the approvals it needs; Slack's reply is the one under Two approvers. Under the rule above, the requester's approval returns 403 {"error":"forbidden","reason":"you raised this request; under rule \"production changes\" it needs 2 approvals from other approvers"}, and a key's 403 {"error":"forbidden","reason":"API keys can't approve under rule \"production changes\"; it needs 2 approvals from members"}. For a request that needs one approval, they end it needs another approver to approve it and members approve this request. When the requester is the only member it names, any admin or approver answers it, and the Approvals screen says when nobody else can approve it, as for two approvers.
  • A request keeps the rule it was made under, and that rule's version: changing or deleting the rule later changes neither the approvals it needs, its approvers nor the rule it shows. A step a run replays gets its first request back, never a newer rule.
  • Conditions read the payload the run's code got, never a value the code passes, also once the 14 days a payload is kept for a re-run are over. A field the payload lacks makes its condition false, ne included, and the rule doesn't apply.
  • A request made without the run's payload, where a rule with conditions could apply, fails its step with approval rule "production changes" reads the run's payload, which this request came without. No later rule stands in for that rule.
  • With no rules, every request is made as before.
  • Only admins list and change rules, with the API. Each change is written to the audit log.

Promotions

A linked workspace's release waits here when this workspace approves promotions from it. Approving it checks the release again and applies it. See Promotion approvals.

  • source · release

    The workspace that promotes, and its release.

  • requestedBy

    Who promoted it there: an email or an API key id.

  • changes

    {workflows, agents, schedules, connections}. Each {name, from, to} is what the release adds, changes or removes here: - Workflows: version hashes. - Agents: version numbers here (to is null for a new version), plus version, the agent's version in the promoting workspace, and the definition and code hashes. - Schedules: the definitions, with cron and payload or message. - connections: each promoted workflow's {workflow, from, to}, its connections here now and after the promotion.

  • outcome

    Once approved: {"applied": true, "release"}, or {"applied": false, "error", "detail"} when a check failed. null until then.

  • Only a member or key that may deploy all of this workspace answers a promotion: approval.decide and workflow.deploy, with no scope. Others don't see it.
  • GET /v1/approvals lists promotions only with kinds=promotion, alone or with other kinds.
  • A promotion names no approvers. Every admin can answer it. It needs the approvals Settings → Approvals asks for when it is made, and arrives in Slack like other requests.
  • When a promotion needs two or more approvals, whoever promoted it can't give one of them in this workspace: the member who promoted, or the key and the member who created it. They can still deny it. See Two approvers.

Helper changes

A change the helper makes waits here for the person who asked for it: a workflow to deploy or run, a trigger to create, or a secret's hosts.

  • agent · tool

    shiftlabs, and the change: deploy_workflow, run_workflow, create_trigger or set_secret_hosts.

  • arguments

    Exactly what approving changes: the code, the payload, the trigger's signing or the hosts.

  • person · personLabel

    Who asked: the only one who answers it.

  • Only the person who asked answers it, in the conversation or on the Approvals screen, or with POST /v1/approvals/:id. For an API key, only that key. Anyone else, admins included, can't answer it and doesn't see it in GET /v1/approvals.
  • Developers see the Approvals screen for these. Without approval.decide, GET /v1/approvals lists only your own, and answers 403 if the helper can make no change for you, as for a viewer.
  • approvers is [] and required is 1: two approvers, notices and Slack don't apply, and it isn't counted in approvalsPending. As it needs one approval, the person who asked approves it: the rule that whoever raised a request can't give one of two approvals doesn't apply.
  • Approving makes the change with the person's access at that moment. If their role or key no longer allows it, approving returns 403 and nothing changes.

Approve or deny

Answer requests on the Approvals screen, on a workflow run's page, in an agent's conversation, or with the API. A request that names approvers is answered only by them; one that names none, by any admin or approver.

shellcurl
# Requests waiting for an answer, agents' and workflow runs', newest first
# (admin key).
curl "https://api.shiftlabs.org/v1/approvals?kinds=agent,workflow" \
  -H "authorization: Bearer $SHIFTLABS_API_KEY"

# Approve: the workflow runs with the arguments in the request.
curl -X POST https://api.shiftlabs.org/v1/approvals/<id> \
  -H "authorization: Bearer $SHIFTLABS_API_KEY" \
  -H "content-type: application/json" \
  -d '{"decision": "approve"}'

# Deny, with the reason a deny needs. The agent reads it.
curl -X POST https://api.shiftlabs.org/v1/approvals/<id> \
  -H "authorization: Bearer $SHIFTLABS_API_KEY" \
  -H "content-type: application/json" \
  -d '{"decision": "deny", "note": "Not this month."}'
  • kind

    agent for a held tool call, workflow for a workflow run, promotion for a promotion.

  • tool · arguments

    The workflow, and the JSON the model asked to run it with.

  • agent · conversation

    The agent that asked, and the conversation it asked in.

  • person · personLabel

    Who was talking to the agent: their id, and their email or API key id.

  • status

    pending, approved, denied, expired or withdrawn. A request is withdrawn when its agent was deleted while it waited, or when its run waited for whichever came first and something else did.

  • requestedAt · expiresAt · decidedAt

    Milliseconds since the epoch.

  • decidedBy · note

    The approver's email or API key id, expiry for an expired request, and the approver's note. A request withdrawn by a deleted agent has the email or API key id that deleted it and the note the agent was deleted; one withdrawn by its run has run and a note naming what came first, such as "ack" came first.

  • approvers

    The roles and member emails that may answer it, or null for every admin and approver. See Who approves.

  • required · approvals · namedRequired

    How many approvals it needs, those that count toward it, each {by, at, note}, and how many of them must come from the members it names. From two approvals up, or under a rule with noSelfApproval, the requester's own don't count. See Two approvers.

  • raisedByYou

    true when you raised the request: you, your API key, or a key you created. See Who raised a request.

  • eligible · hasRequester

    On a pending request that needs two or more approvals, or whose rule refuses the requester's own approval: how many members could still give one that counts, and whether a member or an API key raised it. eligible leaves out the requester, members who already approved, and anyone the request's approvers don't name. Fewer than required minus the approvals given means nobody can approve it as things stand. Absent when the members couldn't be read. See Two approvers.

  • Answering needs the approval.decide capability, which admins and approvers hold and developers don't, and to be one of the request's approvers, except for your own helper changes. A key scoped to some agents or workflows lists and answers only their requests: an agent's request needs both its agent and the workflow its tool starts within the scope, since approving it starts that workflow. A key scoped to some workflows also lists and answers no agent's request from another person's conversation, which it can't read, except those its workflows started with ask. A kind the scope leaves out is not limited: a key scoped to some agents also lists and answers every workflow run's request. Answering a request out of reach returns 404, as if it didn't exist. Your own helper changes stay yours to answer.
  • GET /v1/approvals?status= takes pending (the default), approved, denied, expired, withdrawn or all, and lists 100 a page, the next from Next-Before. kinds takes agent (the default), workflow and promotion, comma-separated. q keeps the requests holding its text, ignoring case: in what they ask, who asked or answered, or a workflow run's tags, which each run's request lists as tags. It searches each page as listed, so a page can come back short with Next-Before set; the Approvals screen's search box sends it.
  • A request is answered once. Answering it again, or after it expired, returns 409 {"error": "already decided"}. A request that needs two approvers stays pending after the first approval.
  • An agent's request is erased with its conversation, 7 days after the conversation's last message on Free and 30 days on Pro, and leaves GET /v1/approvals then. See How long conversations are kept.
  • A note is up to 500 characters. A deny needs a note giving the reason. Without one, or with only spaces, POST returns 400 {"error": "note is required to deny"} and the request stays open. The agent reads it when you deny; a workflow run gets it with either answer.

In the audit log

  • Each answer to an agent's or a workflow run's request is written to the audit log, from the dashboard, the API or Slack: approval_approve or approval_deny, with the request's id as its subject.
  • Its detail holds by (the email or API key id), via (dashboard, api or slack), kind, reason (the note, always set on a deny), final (whether this answer decided the request), and the request's run and workflow, or agent and tool, with rule, {id, version}, when an approval rule applied to it. A request that needs two approvers has one entry for each approval.
  • On a run's page, an answered request links its entries for anyone who can read the audit log. GET /v1/audit?subject=<request id> lists them.
  • A promotion's answer is the promotion_denied entry, whose reason is the note, or the release it applied. See Promotions.
  • Erasing a person replaces their reasons in these entries too.
  • Each change to the approval rules is written too, with by: approval_rule_set for a new or changed rule and approval_rule_delete, with the rule's id as subject and the rule before and after (null for none), and approval_rule_order, subject approval-rules, with the ids in order before and after.

Approve in Slack

Connect Slack in Settings → Approvals, and requests arrive in Slack with Approve and Deny buttons. An admin connects it, and each approver links their own Slack account once.

  • 1. Connect

    Select Connect Slack and allow the shiftlabs app in your Slack workspace.

  • 2. Choose a channel

    Pick the channel for approval requests. For a private channel, invite the app first with /invite @shiftlabs, then refresh the list.

  • 3. Link your Slack account

    Each approver selects Link my Slack account in Settings → Approvals and signs in with Slack, in the Slack workspace you connected. Selecting Approve before linking replies with a link to do it.

  • 4. Answer

    Each new request arrives with what it asks: the workflow's message, the tool's arguments, or a promotion's changes. Write a note, then approve or deny. To deny, the note must give your reason.

  • Requests that admins answer, or that name nobody, go to the channel. A request that names only members goes to each of them as a direct message from the app, once they linked their Slack account. If any member it names hasn't linked, it goes to the channel too. Requests made before you connect Slack stay in the dashboard.
  • Only the member a Slack account is linked to can answer from it, and only while they may answer the request. Anyone else gets a message only they see, and nothing changes. Your Slack account's email plays no part.
  • One Slack account links to one member. Linking it again, from another member's session, moves it. Unlink in Settings → Approvals removes yours.
  • A message updates when its request is answered anywhere: in Slack, in the dashboard or with the API, or when it runs out. A request that needs two approvers shows each approval as it comes in.
  • Messages show what the request asks, as the Approvals screen does. A workflow's message never shows the value of a secret your workspace stores. Choose a channel only approvers read.
  • Slack shows a request's text as written: an @here, @channel, #channel or link in a workflow's message, a tool's arguments or a note notifies nobody and isn't a link.
  • When a tool's arguments or a promotion's changes are too long for a Slack message, it offers only Deny and Too long for Slack: approve in shiftlabs, which opens the Approvals screen. Approving such a request from Slack, even from an older message that still shows Approve, replies with a message only you see, and nothing changes.
  • Deny with an empty note box replies Add a reason in the note box to deny., visible only to you, and the request stays open.
  • Several shiftlabs workspaces can connect to one Slack workspace. Each needs its own channel: a channel another workspace uses isn't listed and can't be chosen.
  • Connecting another Slack workspace removes the links made in the old one. Disconnect Slack in Settings → Approvals. Removing the app from your Slack workspace disconnects it too, for every shiftlabs workspace connected there.
  • Connecting, disconnecting and choosing the channel are written to the audit log.

What the agent hears

Each answer is posted into the conversation as a message that starts with Approval update:, and the agent replies to the person. People can't send a message that starts that way.

  • Approved

    The workflow runs with the approved arguments. The agent reads the run's output or error, as for any tool call.

  • Denied

    The workflow doesn't run. The agent reads your reason.

  • Expired

    Nobody answered within 72 hours. The workflow doesn't run.

  • Withdrawn

    The agent was deleted while the request waited. The workflow doesn't run, and nothing goes into the conversation. Nobody is told: no notice goes out, and a Slack message already sent for it is edited to say it was withdrawn.

  • An approved run counts like any run, and is listed with origin agent.
  • An approved helper change is made once, as its person, and the helper reads what it answered, such as the new version or the trigger's URL. A run it starts is listed with origin dashboard for a member and api for a key. If the answer is lost, for example in a restart, the change isn't tried again, and the helper says it may not have been made.
  • If the answer doesn't reach the conversation, it's tried again 30 seconds later, twice, then every 10 minutes, for about 90 minutes.
  • An answer that comes in during a turn goes in after the turn. If that turn fails or is stopped, the answer goes in within about a minute of its end.
  • A conversation stopped at maxTurns, at its monthly budget or at the model allowance doesn't reply to an answer. The answer is added to its transcript, and the agent reads it with the next message.
  • At budget reached, the answer is added to the transcript, and the conversation is done. Start a new one to go on. End users with a chat token don't see the answer.
  • An answer that goes in more than 24 hours after its decision is added to the transcript without a reply.

Expiry

A request waits 72 hours, or the timeout its workflow set. Unanswered, it expires and counts as denied.

  • The Approvals screen shows how long each request has left, and how many run out within 24 hours.
  • GET /v1/approvals?status=expired&kinds=agent,workflow lists expired requests. Their decidedBy is expiry.

Approval notices

Waiting requests are sent to the workspace's alert emails and alert webhook, as approvals.waiting. A request that names members goes to them instead.

  • A notice goes out a minute after the first request, then at most once every 15 minutes. It counts the requests still waiting, lists up to 3, and links the Approvals screen. Tool arguments and workflow messages are never included. A request that needs two approvers shows how many approvals it has, as required and approved in the webhook body.
  • A request that names only members is emailed to those members, whether or not they get alert emails, and never to the webhook or other alert emails. One that also names a role goes to the alert destinations as well.
  • Notices are on by default. "approvals": false on PUT /v1/alerts turns them off. See Alert webhooks for the body and its signature.
  • Notice emails count toward the plan's alert emails per day: 50 on Free, 500 on Pro.

API

Admins list and answer requests with the /v1 API, and set two approvers, approval rules and Slack. Anyone who may talk to agents lists and answers their own helper changes.

Routes
RouteMethodMinimum role
/v1/approvals ?status=pending (default), approved, denied, expired, withdrawn or all; ?kinds=agent (default), workflow, promotion, comma-separated; ?q= text to search for; newest first, 100 a page; ?limit= and ?before= from Next-BeforeGETapprover or admin, or developer for their own helper changes
/v1/approvals/:id {"decision": "approve" | "deny", "note"?}; a deny needs "note", or 400; the request, answeredPOSTapprover or admin, or developer for their own helper changes
/v1/workspace/approvals {required, choices, slackAvailable, slack, link, warning?}: the approvals every request needs, the values PUT takes, the Slack connection, your own linked Slack account, and a warning while 2 is set and fewer than three members can approveGETviewer
/v1/workspace/approvals {"required": 1 | 2}; admins only; 2 needs two members who can approve, or it returns 409, and with exactly two it answers a warningPUTadmin
/v1/approval-rules the approval rules in the order they are tried; admins onlyGETadmin
/v1/approval-rules {"name", "enabled"?, "match"?, "set"}; admins only; the new rule, last in the order, with 201; 409 past 50 rulesPOSTadmin
/v1/approval-rules/:id the same body, all of it; admins only; the rule, a version upPUTadmin
/v1/approval-rules/:id admins only; {"deleted": id}DELETEadmin
/v1/approval-rules/order {"ids": [...]}, every rule's id once, in the order to try them; admins only; the rules in that orderPUTadmin