Skip to content

Channlize for Agents

Approvals

Ask people to approve or deny an agent's action, with an amount, a currency and a resource, roles that must sign off, policy approval rules, and first-answer-wins.

On this page

An approval is a question with kind: "approval". It always has two options, Approve and Deny (ids approve and deny), takes an optional comment instead of free text, and can require a role to sign off. Everything else (urgency, deadline, default, escalation, how the answer comes back) works as for questions.

Ask for an approval

Shell
curl -X POST https://api.channlize.com/v1/agents/questions \
  -H "Authorization: Bearer $REFUNDS_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "kind": "approval",
    "question": "Refund order #1234 in full?",
    "amount": 1250,
    "currency": "USD",
    "resource": { "type": "order", "id": "1234", "customer": "acme@example.com" },
    "required_roles": ["admin"],
    "urgency": "high",
    "deadline": "2026-11-06T17:00:00Z",
    "default_option": "deny",
    "channel_id": "'"$CHANNEL_ID"'"
  }'
FieldWhat it does
amountA number from 0, shown with the request and matched against the policy's approval rules.
currencyA 3-letter ISO 4217 code, stored uppercase.
resourceAny JSON describing what's being approved, up to 4 KB. Shown in Slack.
required_rolesRoles that must sign off, up to 10. Any listed role, or a higher one, can answer.
default_optionapprove or deny, applied at the deadline.

Any options you send are ignored: an approval is always Approve / Deny.

In Slack the post shows the amount, the currency, the resource and who can approve, with Approve and Deny buttons. Deny opens a form that asks why; the reason comes back as the answer's comment. Approvals are answered with the buttons only: a reply in the Slack thread doesn't approve.

Who can approve

Roles rank owner > admin > agent > viewer. A requirement is met by a listed role or any role above one: ["admin"] lets owners approve too.

AnswererCan approve
A teammate with a Channlize accountYes, if they're active, not a viewer, and meet every role requirement.
A Slack user who doesn't match a Channlize accountNever. Link their Slack account, or use the same email in Slack and Channlize.
The asking agent's manager agentOnly approvals with no role requirement. An agent never answers its own question.

A refused click is answered with the reason, only to that person ("Only admins can answer this… you're an agent."). Over HTTP it's 403 APPROVAL_ROLE_REQUIRED or ANSWERER_NOT_MATCHED. Either way it's recorded in the audit log as question.answer_refused.

Policy approval rules

An organization can require roles by amount, whatever the agent asks, with the approval_rules key of a policy:

JSON
{
  "approval_rules": [
    { "min_amount": 500, "currency": "USD", "required_roles": ["admin"] },
    { "min_amount": 10000, "currency": "USD", "required_roles": ["owner"] }
  ]
}

Every rule the approval's amount reaches applies, on top of its required_roles: with these rules, a 12,000 USD refund needs an owner. A rule with a currency only matches approvals in that currency; one without matches any. An approval without an amount matches no rule. The rules come from the asking agent's effective policy in the question's channel.

First answer wins

The first valid answer closes the approval. Anyone after that sees "already answered by …" in Slack, and 409 QUESTION_CLOSED over HTTP. The Slack posts are rebuilt with ✅ Approved by @ada or ⛔ Denied by @ada: <reason>.

The agent gets the outcome like any answer, with answer.option_id approve or deny and answer.approved true or false. At the deadline the default applies (answered_by: "default"); without one the approval expires and the agent gets question.expired. Treat anything but approved: true as a no.

The audit log records approval.requested, then approval.approved or approval.denied with the answerer, the amount and the comment.

Answer as the manager agent

The asking agent's manager agent can answer its questions and approvals with its own key (agents:send or agents:ask_human). It's told about one when the question escalates to it, and can list them with GET /v1/agents/questions?status=open:

Shell
curl -X POST "https://api.channlize.com/v1/agents/questions/$QUESTION_ID/answer" \
  -H "Authorization: Bearer $MANAGER_KEY" \
  -H "Content-Type: application/json" \
  -d '{"option_id": "approve", "comment": "Within the monthly refund budget."}'

The body takes option_id, text (questions with free text) and comment. Errors: 400 INVALID_ANSWER, 403 APPROVAL_ROLE_REQUIRED (the approval needs a person), 404 for a question the agent doesn't manage, and 409 QUESTION_CLOSED.