Authorizations
Headers
Body
application/json
Response
200 - application/json
Available options:
pending, executed, failed, expired, rejected Available options:
POLICY curl --request PATCH \
--url https://api.privy.io/v1/apps/{app_id}/intents/policies/{policy_id} \
--header 'Authorization: Basic <encoded-value>' \
--header 'Content-Type: application/json' \
--header 'privy-app-id: <privy-app-id>' \
--data '{
"name": "<string>",
"rules": [
{
"name": "<string>",
"method": "eth_sendTransaction",
"conditions": [
{
"field_source": "ethereum_transaction",
"field": "to",
"operator": "eq",
"value": "<string>"
}
],
"action": "ALLOW"
}
],
"owner": {
"public_key": "<string>"
},
"owner_id": "<string>"
}'{
"intent_id": "<string>",
"created_by_display_name": "<string>",
"created_by_id": "<string>",
"created_at": 123,
"resource_id": "<string>",
"authorization_details": [
{
"members": [
{
"type": "user",
"user_id": "<string>",
"display_name": "<string>",
"has_signed": true
}
],
"threshold": 123,
"display_name": "<string>"
}
],
"status": "pending",
"expires_at": 123,
"intent_type": "POLICY",
"request_details": {
"method": "PATCH",
"url": "<string>",
"body": {
"name": "<string>",
"rules": [
{
"name": "<string>",
"method": "eth_sendTransaction",
"conditions": [
{
"field_source": "ethereum_transaction",
"field": "to",
"operator": "eq",
"value": "<string>"
}
],
"action": "ALLOW"
}
],
"owner": {
"public_key": "<string>"
},
"owner_id": "<string>"
}
},
"current_resource_data": {
"version": "1.0",
"name": "<string>",
"chain_type": "ethereum",
"id": "<string>",
"owner_id": "<string>",
"created_at": 123,
"rules": [
{
"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"
}
]
},
"action_result": {
"status_code": 123,
"executed_at": 123,
"authorized_by_display_name": "<string>",
"authorized_by_id": "<string>",
"response_body": {
"version": "1.0",
"name": "<string>",
"chain_type": "ethereum",
"id": "<string>",
"owner_id": "<string>",
"created_at": 123,
"rules": [
{
"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": {
"version": "1.0",
"name": "<string>",
"chain_type": "ethereum",
"id": "<string>",
"owner_id": "<string>",
"created_at": 123,
"rules": [
{
"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"
}
]
}
}
}Create an intent to update a policy. The intent must be authorized by the policy owner before it can be executed.
curl --request PATCH \
--url https://api.privy.io/v1/apps/{app_id}/intents/policies/{policy_id} \
--header 'Authorization: Basic <encoded-value>' \
--header 'Content-Type: application/json' \
--header 'privy-app-id: <privy-app-id>' \
--data '{
"name": "<string>",
"rules": [
{
"name": "<string>",
"method": "eth_sendTransaction",
"conditions": [
{
"field_source": "ethereum_transaction",
"field": "to",
"operator": "eq",
"value": "<string>"
}
],
"action": "ALLOW"
}
],
"owner": {
"public_key": "<string>"
},
"owner_id": "<string>"
}'{
"intent_id": "<string>",
"created_by_display_name": "<string>",
"created_by_id": "<string>",
"created_at": 123,
"resource_id": "<string>",
"authorization_details": [
{
"members": [
{
"type": "user",
"user_id": "<string>",
"display_name": "<string>",
"has_signed": true
}
],
"threshold": 123,
"display_name": "<string>"
}
],
"status": "pending",
"expires_at": 123,
"intent_type": "POLICY",
"request_details": {
"method": "PATCH",
"url": "<string>",
"body": {
"name": "<string>",
"rules": [
{
"name": "<string>",
"method": "eth_sendTransaction",
"conditions": [
{
"field_source": "ethereum_transaction",
"field": "to",
"operator": "eq",
"value": "<string>"
}
],
"action": "ALLOW"
}
],
"owner": {
"public_key": "<string>"
},
"owner_id": "<string>"
}
},
"current_resource_data": {
"version": "1.0",
"name": "<string>",
"chain_type": "ethereum",
"id": "<string>",
"owner_id": "<string>",
"created_at": 123,
"rules": [
{
"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"
}
]
},
"action_result": {
"status_code": 123,
"executed_at": 123,
"authorized_by_display_name": "<string>",
"authorized_by_id": "<string>",
"response_body": {
"version": "1.0",
"name": "<string>",
"chain_type": "ethereum",
"id": "<string>",
"owner_id": "<string>",
"created_at": 123,
"rules": [
{
"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": {
"version": "1.0",
"name": "<string>",
"chain_type": "ethereum",
"id": "<string>",
"owner_id": "<string>",
"created_at": 123,
"rules": [
{
"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"
}
]
}
}
}Show child attributes
pending, executed, failed, expired, rejected POLICY Show child attributes
Show child attributes
Show child attributes
Was this page helpful?