v11

latestOpenAPI 3.0.3raw.githubusercontent.com2026-08-023710598.2 KB
Policies

Allocate a grant and return the EIP-712 payload the owner signs

Allocates the policy id, validation entity, and session signer, builds the exact installValidation calldata the signature will commit to, and returns the typed data for eth_signTypedData_v4. Stores nothing: a prepare that is never submitted leaves no state behind. The echoed fields must be passed back verbatim to :submit — the gateway recomputes everything from them, so tampering only produces a signature that no longer verifies.

post/wallets/{address}/policies:prepare

Request body

chainIdinteger required

Numeric chain ID (e.g. 11155111 for Sepolia, 8453 for Base). On chain-aware trigger/node configs this is required and must be a configured chain; on query/filter params it is optional.

agentLabelstring required
justificationstring
expiresInSecondsinteger required

Grant lifetime, relative (skew-proof). Becomes an absolute validUntil.

Example request

{
  "chainId": 11155111,
  "allowedActions": [
    {
      "target": "0x82F2Dd9a552a69f2ceD7Ff2D05c43aB8430158FB"
    }
  ],
  "erc20SpendCap": {
    "token": "0x82F2Dd9a552a69f2ceD7Ff2D05c43aB8430158FB",
    "amount": "500000000"
  }
}

Response

Payload to sign, plus the allocations submit must echo.

policyIdstring required

ULID identifier (26-char Crockford base32).

chainIdinteger required

Numeric chain ID (e.g. 11155111 for Sepolia, 8453 for Base). On chain-aware trigger/node configs this is required and must be a configured chain; on query/filter params it is optional.

entityIdinteger required

The validation entity allocated for this grant (provisional until submit).

sessionSignerstring required

Lowercase or checksummed hex EOA / contract address.

deadlineinteger required

Unix seconds; bounds signing → first use, NOT the grant lifetime.

validUntilinteger required

Absolute grant expiry, unix milliseconds. Echo verbatim to submit.

digeststring required

The EIP-712 hash the typed data produces, for client-side verification.

typedDataobject required

The exact eth_signTypedData_v4 payload for the owner's wallet.

Example response

{
  "policyId": "01JG2FE5MDVKBPHEG0PEYSDKAC",
  "chainId": 11155111,
  "sessionSigner": "0x82F2Dd9a552a69f2ceD7Ff2D05c43aB8430158FB"
}