Skip to main content

Approvals API

Approvals are a first-class primitive in Ariftly. Any agent action that affects the outside world — sending an email, posting to Slack, modifying a record — pauses and waits for human approval before executing.

List pending approvals​

GET /approvals

Query parameters:

ParameterDescription
statuspending, approved, denied. Default: pending
agentFilter by agent slug
task_idFilter by task

Response 200 OK:

{
"approvals": [
{
"approval_id": "appr_01j9x...",
"task_id": "task_01j9x8k...",
"agent": "sales",
"title": "Send outreach email to Jane Smith at Acme Corp",
"description": "AI-drafted email based on LinkedIn profile and recent Series B announcement",
"action": {
"type": "gmail.send",
"to": "jane@acme.com",
"subject": "Quick question about Acme's AI roadmap",
"body": "..."
},
"status": "pending",
"created_at": "2026-04-21T10:05:00Z",
"expires_at": "2026-04-22T10:05:00Z"
}
]
}

Get an approval​

GET /approvals/{approval_id}

Resolve an approval​

POST /approvals/{approval_id}/resolve

Request body:

{
"decision": "approved",
"comment": "Looks good, send it"
}
FieldTypeRequiredDescription
decisionstring✅approved or denied
commentstring—Optional note recorded in the audit log
modified_actionobject—Override the action before approving (e.g., edit the email body)

Response 200 OK:

{
"approval_id": "appr_01j9x...",
"decision": "approved",
"resolved_at": "2026-04-21T10:07:00Z"
}

When approved, Ariftly executes the action and resumes the task. When denied, the task is updated and the agent is notified.

Approval expiry​

Approvals expire after 24 hours by default. Expired approvals are treated as denied. Configure expiry per agent:

curl -X PATCH https://api.ariftly.io/v1/agents/sales/config \
-H "Authorization: Bearer $ARIFTLY_API_KEY" \
-d '{"approval_ttl_hours": 48}'

Slack approvals​

With the Slack integration, pending approvals are posted directly to a configured channel. Team members can approve or deny with a button click — no need to open the dashboard.

→ Configure Slack integration