Policies

Update a policy by policy ID.

patch/v1/policies/{policy_id}

Request

  • Base URL
    https://api.privy.io
  • URL
    https://api.privy.io/v1/policies/{policy_id}
  • Auth
    HTTP basic

Path parameters

policy_idstring required

Headers

privy-app-idstring required

ID of your Privy app.

privy-authorization-signaturestring

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

privy-request-expirystring

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

Request body

namestring

Name to assign to the policy, up to 100 characters.

owner_idstring cuid2 nullable

The key quorum ID to set as the owner of the resource. If you provide this, do not specify an owner.

Example request

{
  "rules": [
    {
      "conditions": [
        {
          "field": "content"
        }
      ]
    }
  ]
}

Response

Updated policy object.

version'1.0' required

Version of the policy. Currently, 1.0 is the only version.

namestring required

Name to assign to the policy, up to 100 characters.

chain_type'ethereum' | 'solana' | 'cosmos' | 'stellar' | 'sui' | 'aptos' | 'movement' | 'tron' | 'bitcoin-segwit' | 'bitcoin-taproot' | 'pearl' | 'near' | 'ton' | 'starknet' | 'xrpl' | 'spark' required

The wallet chain types.

idstring required

Unique ID of the created policy. This will be the primary identifier when using the policy in the future.

owner_idstring cuid2 required

A unique identifier for a key quorum.

created_atnumber required

Unix timestamp of when the policy was created in milliseconds.

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_claim enum value to the // response property for the response status

    • info

      added the new earn_incentive_claim enum value to the request property //

    • breaking

      the response property's maxLength was increased from 50 to 100 for the response status

    • info

      the request property's maxLength was increased from 50 to 100