Skip to main content
PATCH
/
v1
/
intents
/
policies
/
{policy_id}
/
rules
/
{rule_id}
Create policy rule update intent
curl --request PATCH \
  --url https://api.privy.io/v1/intents/policies/{policy_id}/rules/{rule_id} \
  --header 'Authorization: Basic <encoded-value>' \
  --header 'Content-Type: application/json' \
  --header 'privy-app-id: <privy-app-id>' \
  --data '
{
  "name": "<string>",
  "method": "eth_sendTransaction",
  "conditions": [
    {
      "field_source": "ethereum_transaction",
      "field": "to",
      "operator": "eq",
      "value": "<string>"
    }
  ],
  "action": "ALLOW"
}
'
{
  "intent_id": "<string>",
  "created_by_display_name": "<string>",
  "created_at": 123,
  "resource_id": "<string>",
  "authorization_details": [
    {
      "members": [
        {
          "type": "user",
          "user_id": "<string>",
          "signed_at": 123
        }
      ],
      "threshold": 123,
      "display_name": "<string>"
    }
  ],
  "status": "pending",
  "custom_expiry": true,
  "expires_at": 123,
  "intent_type": "RULE",
  "request_details": {
    "method": "POST",
    "url": "<string>",
    "body": {
      "name": "<string>",
      "method": "eth_sendTransaction",
      "conditions": [
        {
          "field_source": "ethereum_transaction",
          "field": "to",
          "operator": "eq",
          "value": "<string>"
        }
      ],
      "action": "ALLOW"
    }
  },
  "created_by_id": "<string>",
  "rejected_at": 123,
  "dismissed_at": 123,
  "dismissal_reason": "<string>",
  "current_resource_data": {
    "id": "rule_123",
    "name": "Allowlist USDC contract on Base",
    "method": "eth_sendTransaction",
    "conditions": [
      {
        "field_source": "ethereum_transaction",
        "field": "to",
        "operator": "eq",
        "value": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913"
      }
    ],
    "action": "ALLOW"
  },
  "policy": {
    "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
  },
  "action_result": {
    "status_code": 123,
    "executed_at": 123,
    "authorized_by_display_name": "<string>",
    "authorized_by_id": "<string>",
    "response_body": {
      "id": "rule_123",
      "name": "Allowlist USDC contract on Base",
      "method": "eth_sendTransaction",
      "conditions": [
        {
          "field_source": "ethereum_transaction",
          "field": "to",
          "operator": "eq",
          "value": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913"
        }
      ],
      "action": "ALLOW"
    },
    "prior_state": {
      "id": "rule_123",
      "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-request-expiry
string

Request expiry. Value is a Unix timestamp in milliseconds representing the deadline by which the request must be processed.

Path Parameters

policy_id
string
required

ID of the policy.

rule_id
string
required

ID of the rule.

Body

application/json

The rules that apply to each method the policy covers.

name
string
required
Required string length: 1 - 50
method
enum<string>
required

Method the rule applies to.

Available options:
eth_sendTransaction,
eth_signTransaction,
eth_signUserOperation,
eth_signTypedData_v4,
eth_sign7702Authorization,
signTransaction,
signAndSendTransaction,
exportPrivateKey,
signTransactionBytes,
*
conditions
(ethereum_transaction · object | ethereum_calldata · object | ethereum_typed_data_domain · object | ethereum_typed_data_message · object | ethereum_7702_authorization · object | solana_program_instruction · object | solana_system_program_instruction · object | solana_token_program_instruction · object | system · object | TronTransactionCondition · object | TronCalldataCondition · object | SuiTransactionCommandCondition · object | SuiTransferObjectsCommandCondition · object | AggregationCondition · object)[]
required

The verbatim Ethereum transaction object in an eth_signTransaction or eth_sendTransaction request.

action
enum<string>
required

Action to take if the conditions are true.

Available options:
ALLOW,
DENY

Response

200 - application/json

Created rule update intent.

Response for a rule intent

intent_id
string
required

Unique ID for the intent

created_by_display_name
string
required

Display name of the user who created the intent

created_at
number
required

Unix timestamp when the intent was created

resource_id
string
required

ID of the resource being modified (wallet_id, policy_id, etc)

authorization_details
IntentAuthorization · object[]
required

Detailed authorization information including key quorum members, thresholds, and signature status

status
enum<string>
required

Current status of an intent.

Available options:
pending,
executed,
failed,
expired,
rejected,
dismissed
custom_expiry
boolean
required

Whether this intent has a custom expiry time set by the client. If false, the intent expires after a default duration.

expires_at
number
required

Unix timestamp when the intent expires

intent_type
enum<string>
required
Available options:
RULE
request_details
RuleIntentCreateRequestDetails · object
required

Request details for creating a rule via intent.

created_by_id
string

ID of the user who created the intent. If undefined, the intent was created using the app secret

rejected_at
number

Unix timestamp when the intent was rejected, present when status is 'rejected'

dismissed_at
number

Unix timestamp when the intent was dismissed, present when status is 'dismissed'

dismissal_reason
string

Human-readable reason for dismissal, present when status is 'dismissed'

current_resource_data
PolicyRuleResponse · object

Current state of the rule before any changes. Undefined for create intents or if the rule was deleted

Example:
{
"id": "rule_123",
"name": "Allowlist USDC contract on Base",
"method": "eth_sendTransaction",
"conditions": [
{
"field_source": "ethereum_transaction",
"field": "to",
"operator": "eq",
"value": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913"
}
],
"action": "ALLOW"
}
policy
Policy · object

Parent policy containing this rule, including sibling rules for contextual display

Example:
{
"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
}
action_result
BaseActionResult · object

Result of rule execution (only present if status is 'executed' or 'failed')