Policies
Create Policy
Changed onCreate a new policy.
post/v1/policies
Request
- Base URLhttps://api.privy.io
- URLhttps://api.privy.io/v1/policies
- AuthHTTP basic
Headers
privy-app-idstring required
ID of your Privy app.
privy-idempotency-keystring
Idempotency keys ensure API requests are executed only once within a 24-hour window.
Request body
Example request
{
"rules": [
{
"conditions": [
{
"field": "content"
}
]
}
]
}Response
Created policy object.
Example response
{
"id": "tb54eps4z44ed0jepousxi4n",
"name": "Allowlisted stablecoins",
"chain_type": "ethereum",
"rules": [
{
"id": "bdyfoa65pro1eez6iwtzanol",
"name": "Allowlist USDC contract on Base",
"method": "eth_sendTransaction",
"conditions": [
{
"field_source": "ethereum_transaction",
"field": "to",
"operator": "eq",
"value": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913"
}
],
"action": "ALLOW"
}
],
"owner_id": null,
"version": "1.0",
"created_at": 1741833088894
}Changes
- warning
added the new
earn_incentive_claimenum value to the//response property for the response status - info
added the new
earn_incentive_claimenum value to the request property//
- warning
- breaking
the
response property's maxLength was increased from50to100for the response status - info
the
request property's maxLength was increased from50to100
- breaking