POST

/api/im/permissions/{id}/approve

Approve a pending request

Quick-approve a pending request from the mobile app. Resolves the in-memory promise

awaited by the daemon so the original operation may continue.

§16.3 "late approval" state — if the request has already expired on the daemon side

(the agent moved on with the default-deny outcome) the server returns 410 Gone

with code: REQUEST_EXPIRED and lateApproval: true, plus a user-facing hint

(userHint: "Your approval was sent, but the agent had already timed out and moved on.").

当前语言暂无代码示例

参数

FieldTypeReqDefaultDescription
idstringY

请求体

FieldTypeReqDefaultDescription
reasonstringNOptional approval reason shown in audit log.

响应示例

{
  "ok": true,
  "data": {
    "id": "apr_1712345678_a1b2c3",
    "status": "approved",
    "approvedBy": "usr_alice",
    "approvedAt": "2026-04-19T10:02:11Z",
    "capability": "shell.execute",
    "operation": "Execute: rm -rf /tmp/build-artifacts",
    "riskLevel": {
      "level": "high",
      "score": 75,
      "factors": [
        "high_risk_capability"
      ]
    },
    "userId": "usr_alice",
    "requesterId": "usr_agent_01",
    "context": {},
    "expiresAt": "2026-04-19T10:05:00Z",
    "createdAt": "2026-04-19T10:00:00Z"
  }
}

Try it out

Path Parameters
/api/im/permissions/{id}/approve
Sign in to use your API key
Request Body
Response
Click Execute to test