AISARAISAR
All webhooks

AI agents

AI action approved

ai.action.approved

Fires when an operator approves an AI-agent-proposed action and it is executed (the contact actually gets blocked, the conversation actually gets closed). The outcome of the operation is delivered in the `execution_result` field.

HTTP request

AISAR sends a signed POST request to your webhook_url:

http
POST {webhook_url}
Content-Type: application/json
X-AISAR-Signature: sha256=...

{
  "event": "ai.action.approved",
  "event_id": "evt_01JXXXXXXXXXXXXXXXXXXXXX",
  "timestamp": "2026-05-11T12:05:00.000000Z",
  "company_id": 1,
  "data": {
    "ai_action": {
      "id": 999,
      "company_id": 1,
      "conversation_id": 45,
      "tool_key": "block_contact",
      "ai_agent_instance_id": 7,
      "approval_status": "approved",
      "comment": "AI agent proposed to block contact (reason: spam)",
      "reason": "Contact is sending spam content",
      "approved_by_user_id": 22,
      "rejected_by_user_id": null,
      "rejected_reason": null,
      "execution_result": {
        "ok": true,
        "action": "contact_blocked",
        "contact_id": 89,
        "reason": "Contact is sending spam content"
      },
      "created_at": "2026-05-11T12:00:00.000000Z",
      "resolved_at": "2026-05-11T12:05:00.000000Z"
    }
  }
}

The X-AISAR-Signature header carries an HMAC-SHA256 signature of the request body — use it to verify the request came from AISAR.

Example payload

json
{
  "event": "ai.action.approved",
  "event_id": "evt_01JXXXXXXXXXXXXXXXXXXXXX",
  "timestamp": "2026-05-11T12:05:00.000000Z",
  "company_id": 1,
  "data": {
    "ai_action": {
      "id": 999,
      "company_id": 1,
      "conversation_id": 45,
      "tool_key": "block_contact",
      "ai_agent_instance_id": 7,
      "approval_status": "approved",
      "comment": "AI agent proposed to block contact (reason: spam)",
      "reason": "Contact is sending spam content",
      "approved_by_user_id": 22,
      "rejected_by_user_id": null,
      "rejected_reason": null,
      "execution_result": {
        "ok": true,
        "action": "contact_blocked",
        "contact_id": 89,
        "reason": "Contact is sending spam content"
      },
      "created_at": "2026-05-11T12:00:00.000000Z",
      "resolved_at": "2026-05-11T12:05:00.000000Z"
    }
  }
}

Payload fields

FieldTypeDescription
ai_action.idintegerAction ID (same as in `ai.action.pending`)
ai_action.tool_keystringTool the agent invoked
ai_action.approval_statusstringAlways `approved`
ai_action.approved_by_user_idintegerOperator who approved
ai_action.resolved_atstringWhen the operator decided (ISO 8601)
ai_action.execution_resultobjectResult of the actual operation: `ok: true/false` and `action` describing what changed (`contact_blocked`, `conversation_closed`). Failure is signalled by `ok: false` plus a `reason` field (e.g. `contact_not_found`, `already_blocked`, `exception`)