Complete reference for the APAAI REST API
https://api.apaai.cloudAll API requests require authentication using an API key in the request header.
x-apaaikey: your_api_key_here
Track and manage AI agent actions
/actionsPropose a new action for policy evaluation.
1{2 "type": "send_email",3 "actor": {4 "kind": "agent",5 "name": "marketing-bot",6 "provider": "openai"7 },8 "target": "user@example.com",9 "params": {10 "subject": "Welcome!",11 "body": "Thanks for signing up"12 }13}
1{2 "actionId": "act_abc123",3 "status": "approved",4 "policyIds": ["pol_xyz789"],5 "decision": {6 "status": "approved",7 "checks": []8 }9}
/actions/:idRetrieve details of a specific action by ID.
/actionsList all actions for your organization.
statusFilter by status (approved, pending_approval, rejected)limitMax results (default: 50)cursorPagination cursorSubmit evidence to fulfill policy requirements
/actions/:actionId/evidenceSubmit evidence checks to satisfy policy requirements for a pending action.
1{2 "checks": [3 {4 "name": "security_scan",5 "pass": true,6 "note": "No threats detected",7 "meta": {8 "scanner": "clamav",9 "version": "1.0.0"10 }11 }12 ]13}
1curl -X POST https://api.apaai.cloud/actions/act_123/evidence \2 -H "x-apaaikey: your_key" \3 -H "Content-Type: application/json" \4 -d '{5 "checks": [6 {7 "name": "content_review",8 "pass": true,9 "note": "Content approved by reviewer"10 }11 ]12 }'
Define rules for actions
/policyCreate a new policy.
1{2 "name": "Email Approval Required",3 "description": "All emails require human approval",4 "mode": "enforce",5 "rules": [6 {7 "when": {8 "actionType": "send_email"9 },10 "require": ["content_review"]11 }12 ],13 "status": "active"14}
Actions require manual approval before proceeding.
Actions auto-approve but are logged for monitoring.
/policyList all policies for your organization.
/policy/:idUpdate an existing policy.
/policy/:idArchive a policy (soft delete).
Manage pending action approvals
/approvals/pendingList actions awaiting manual approval.
/approvals/:approvalId/approveApprove a pending action.
1curl -X POST https://api.apaai.cloud/approvals/apr_123/approve \2 -H "x-apaaikey: your_key"
/approvals/:approvalId/rejectReject a pending action.
1curl -X POST https://api.apaai.cloud/approvals/apr_123/reject \2 -H "x-apaaikey: your_key" \3 -H "Content-Type: application/json" \4 -d '{"reason": "Content violates guidelines"}'
Receive real-time notifications
Configure webhooks in Settings → Webhooks to receive notifications when actions need approval.
action.pending_approvalaction.approvedaction.rejectedaction.expired1{2 "event": "action.pending_approval",3 "actionId": "act_abc123",4 "type": "send_email",5 "actor": {6 "kind": "agent",7 "name": "marketing-bot"8 },9 "params": {10 "subject": "Welcome!",11 "recipient_count": 112 },13 "approvalUrl": "https://app.apaai.cloud/approve/act_abc123",14 "timestamp": "2024-01-15T10:30:00Z"15}
All error responses follow a consistent format:
1{2 "error": "ERROR_CODE",3 "message": "Human-readable description"4}
400Bad Request - Invalid parameters401Unauthorized - Invalid or missing API key402Payment Required - Usage limit exceeded404Not Found - Resource does not exist409Conflict - Resource already exists429Too Many Requests - Rate limit exceeded500Internal Server ErrorX-RateLimit-Limit: 1000X-RateLimit-Remaining: 950X-RateLimit-Reset: 1640995200