curl "https://win.oneshotagent.com/v1/agents/me/action-policy" \
-H "X-Agent-ID: 0xYourWalletAddress" \
-H "x-agent-proof: <base64 signed proof, scope=read>"
{
"success": true,
"data": {
"enabled": true,
"rules": [
{
"id": "review-email",
"tool": "email",
"when": {
"always": true
},
"action": "require_approval"
}
],
"approver": {
"email": "[email protected]",
"phone": null
},
"timeout_seconds": 3600
}
}
Approvals
Get action policy
Read the agent’s action policy
GET
/
v1
/
agents
/
me
/
action-policy
curl "https://win.oneshotagent.com/v1/agents/me/action-policy" \
-H "X-Agent-ID: 0xYourWalletAddress" \
-H "x-agent-proof: <base64 signed proof, scope=read>"
{
"success": true,
"data": {
"enabled": true,
"rules": [
{
"id": "review-email",
"tool": "email",
"when": {
"always": true
},
"action": "require_approval"
}
],
"approver": {
"email": "[email protected]",
"phone": null
},
"timeout_seconds": 3600
}
}
Authentication
X-Agent-ID plus a signed x-agent-proof with scope: "read". See proof authentication.
An access token can also read the policy. See token authentication.
curl "https://win.oneshotagent.com/v1/agents/me/action-policy" \
-H "X-Agent-ID: 0xYourWalletAddress" \
-H "x-agent-proof: <base64 signed proof, scope=read>"
Parameters
No path, query or body parameters.Response
200 returns data: null when no policy is configured, otherwise the policy below.
{
"success": true,
"data": {
"enabled": true,
"rules": [
{
"id": "review-email",
"tool": "email",
"when": {
"always": true
},
"action": "require_approval"
}
],
"approver": {
"email": "[email protected]",
"phone": null
},
"timeout_seconds": 3600
}
}
boolean
Whether the configured policy is active.
object[]
object
Configured
email and phone, each nullable.integer
Time allowed for a decision.
503 action_policy_unavailable means the policy could not be read; retry later.
Held calls
A matchingrequire_approval rule makes the protected call return 403 approval_required before it runs or is charged. This is a response from the protected endpoint, not this policy endpoint. Response excerpt:
{
"error": "approval_required",
"status": "pending_approval",
"message": "This email call needs a human approval (rule review-email). It was not run or charged. Retry the same call with X-Approval-Id once approved.",
"approval_id": "appr_01J...",
"approval": { "approval_id": "appr_01J...", "source": "policy", "tool": "email", "status": "pending", "policy_rule": "review-email" }
}
approval is the full approval object. Poll it, then retry the same call with X-Approval-Id once approved. See held-call behavior.