Platform
Approvals
An approval stops an agent before a sensitive action, such as a refund, a reschedule or sending a document, until a person in your organisation approves or rejects exactly what will be done.
Ask for approval on a tool
In the portal, open an agent, go to Tools & webhooks, edit the tool and set Needs approval: never, always, or when one of the details the agent fills in passes a test. Through the API, add an approval block to the tool:
{
"name": "issue_refund",
"kind": "webhook",
"description": "Refunds an order.",
"parameters": {
"type": "object",
"properties": {
"order_id": {"type": "string"},
"amount": {"type": "number", "description": "Rupees"}
},
"required": ["order_id", "amount"]
},
"approval": {
"required": "when",
"when": {"field": "amount", "over": 2000},
"approvers": {"roles": ["owner", "admin"]},
"expires_minutes": 60,
"summary": "Refund ₹{amount} on order {order_id}"
}
}
requiredalways, or when with a test in when.
whenOne detail and one test: over or under a number, equals a value, or in a list of values.
approvers{"roles": [...]} (owner, admin, developer, member) or {"members": [user ids]}. Owners and admins unless you say otherwise. Viewers never approve.
expires_minutesHow long the request waits before it expires. 60 unless you say otherwise.
summaryThe line approvers read first. {detail} is filled in with the value the agent gave.
What happens at the moment of the action
RoutineThe run waits. If approved, the tool runs with the stored values and the run carries on. If rejected or expired, the agent is told and carries on without it or ends.
Written chatThe agent is told the action was sent for approval, with a reference like AP-1A2B3C4D, and says so to the person. Once approved the tool runs once; the agent learns the outcome with the next message in the conversation.
Live callA call cannot wait. The agent tells the caller it will be confirmed after a check, and the call ends normally. After the decision the tool runs and approval.decided is sent; a routine started by that event can place a confirmation call.
The agent can never approve its own request. A decision comes only from a signed-in person, or an API key with the approvals scope that belongs to a person the request allows. Someone signed in as another person cannot decide.
Deciding
In the portal, Automate → Approvals lists what is waiting, with a count on the bell in the top bar. Each request shows the agent, where it came from (a call, a chat or a routine), the part of the conversation that led to it, the exact tool and values that will run, and how long is left. Approve or reject, with an optional note.
Approvers are emailed when a request waits. The email links to the portal; it never carries an approve button, because link previews and forwarded mail could approve things by accident.
To build your own buttons, for example in your team chat, listen for approval.requested and call the API:
{
"id": "evt_9c8b7a6f5e4d3c2b1a0f9e8d",
"type": "approval.requested",
"created": 1794900000,
"api_version": 2,
"data": {
"approval_id": "ap_7d1e2f3a4b5c",
"agent_id": "va_3f2a9c1b7d5e4f608a12",
"source_kind": "call",
"tool_name": "issue_refund",
"summary": "Refund ₹2,400 on order A-1931",
"expires_at": "2026-11-17T11:00:00+00:00"
}
}
curl "https://api.inferexai.in/v1/approvals?status=pending" \
-H "Authorization: Bearer sk-live-your-key-here"
curl -X POST https://api.inferexai.in/v1/approvals/ap_7d1e2f3a4b5c/approve \
-H "Authorization: Bearer sk-live-your-key-here" \
-H "Content-Type: application/json" \
-d '{"note": "Checked with the customer"}'
Rules
- What is approved is exactly what runs. The values are stored when the request is made, checked again when the tool runs, and cannot be changed.
- Each request is decided once. A second click does nothing and shows who decided.
- If the stored values no longer match their fingerprint when the tool is about to run, nothing runs and the request becomes failed.
- Values are shown in full to approvers; in logs and events they follow your organisation's personal-details setting.
- If your organisation requires two-step sign-in, approvers need it too.
- Every request, decision and result is in the Activity log.
Events
approval.requestedA request is waiting.
approval.decidedIt was approved or rejected.
approval.executedThe approved action ran. Carries a short excerpt of what came back.
approval.expiredNobody decided in time.
Endpoints
GET /v1/approvals?status=pendingRequests in your organisation, newest first. status is pending, approved, rejected, expired, executed or failed; leave it out for all
GET /v1/approvals/countHow many waiting requests you may decide
GET /v1/approvals/{id}One request. Approvers also see the exact values
POST /v1/approvals/{id}/approveApprove, with an optional note. Deciding again changes nothing and answers already_decided: true
POST /v1/approvals/{id}/rejectReject, with an optional note
Keys need the approvals scope. Any role can list requests; any role except viewer can decide the ones it is allowed to. Call lists can also wait for approval of the whole list; see Call lists.