POST
/
v1
/
policies
/
{policy_id}
/
rules
curl --request POST \
  --url https://api.privy.io/v1/policies/{policy_id}/rules \
  --header 'Authorization: Basic <encoded-value>' \
  --header 'Content-Type: application/json' \
  --header 'privy-app-id: <privy-app-id>' \
  --data '{
  "name": "Allowlist USDC contract on Base",
  "method": "eth_sendTransaction",
  "conditions": [
    {
      "field_source": "ethereum_transaction",
      "field": "to",
      "operator": "eq",
      "value": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913"
    }
  ],
  "action": "ALLOW"
}'
{
  "id": "allowlist-usdc-contract-on-base-14351345",
  "name": "Allowlist USDC contract on Base",
  "method": "eth_sendTransaction",
  "conditions": [
    {
      "field_source": "ethereum_transaction",
      "field": "to",
      "operator": "eq",
      "value": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913"
    }
  ],
  "action": "ALLOW"
}

Authorizations

Authorization
string
header
required

Basic Auth header with your app ID as the username and your app secret as the password.

Headers

privy-app-id
string
required

ID of your Privy app.

privy-authorization-signature
string

Request authorization signature. If multiple signatures are required, they should be comma separated.

Path Parameters

policy_id
string
required
Required string length: 24

Body

application/json

Response

200 - application/json

Created policy rule object.

The response is of type object.