Skip to main content
POST
Create Policy
策略控制代理被允许执行的交易类型。每笔交易在 MPC 签名之前都会根据代理的策略进行评估。

请求体

string
必填
要附加此策略的代理。
string
必填
策略类型。值:spending_limitaddress_controltoken_controlvelocity_controlschedulehuman_approval
object
必填
策略规则对象。结构取决于 type

示例

授权

X-API-Key
string
header
必填

API key authentication. Keys are prefixed with awx_.

请求体

application/json
agent_id
string
必填

Agent to attach this policy to.

type
enum<string>
必填

Policy type.

可用选项:
spending_limit,
address_control,
token_control,
velocity_control,
schedule,
human_approval
rules
object
必填

Policy rules object. Structure depends on the policy type.

响应

Policy created successfully.

A policy that controls what transactions an agent is allowed to execute.

id
string

Unique policy identifier (e.g., pol_abc123).

agent_id
string

Agent this policy is attached to.

type
enum<string>

Policy type.

可用选项:
spending_limit,
address_control,
token_control,
velocity_control,
schedule,
human_approval
rules
object

Policy rules object. Structure depends on the policy type.

created_at
string<date-time>

ISO 8601 creation timestamp.

updated_at
string<date-time>

ISO 8601 last-update timestamp.