Update a policy
Use the PrivyClient
’s updatePolicy
method to update an existing policy.
Use the PrivyClient
’s updatePolicy
method to update an existing policy.
To update an existing policy, make a PATCH
request to:
Replacing <policy_id>
with the ID of your desired policy.
In the request headers, make sure to include Privy’s required authentication headers and headers that may be required for your app’s wallet API setup.
Body
In the request body, include the following fields:
(Optional) New name to assign to policy.
(Optional) New list of Rule
objects describing what rules to apply to each RPC method (e.g.
'eth_sendTransaction'
) that the wallet can take. Learn more about
Rule
s.
Any fields not included in the PATCH
request body will remain unchanged from the original policy.
Response
If the policy is updated successfully, the response will include the full updated policy object.
Unique ID for the policy.
Version of the policy. Currently, 1.0 is the only version.
Updated name of the policy.
Chain type for wallets that the policy will be applied to.
Updated list of Rule
objects describing what rules to apply to each RPC method (e.g.
'eth_sendTransaction'
) that the wallet can take. Learn more about
MethodRule
s.
Example
As an example, a sample request to update the rules
of a policy with ID fmfdj6yqly31huorjqzq38zc
might look like the following:
A successful response will look like the following: