Create Policy

Creates a new gas manager policy with the specified rules. The newly created policy will be in the `inactive` status. <Note title="Header Access Token"> To call this endpoint, you must use your [access token](/docs/how-to-create-access-keys) in the [authorization header](/docs/how-to-use-api-keys-in-http-headers) of the API request. </Note>

Headers

AuthorizationstringRequired
Bearer authentication of the form `Bearer <token>`, where token is your auth token.

Request

This endpoint expects an object.
policyNamestringRequiredDefaults to My Policy
Name of the policy
policyTypeenumRequiredDefaults to sponsorship
Type of the policy. Currently we support `sponsorship` (for sponsoring gas on EVM networks), `erc20` (for enabling users to pay gas with any ERC-20 token on EVM networks), and `solana` (for sponsoring fees and rent on Solana).
Allowed values:
appIdstringRequiredDefaults to 6d834x9k1yh4dx6z
ID for the app associated with the new policy.
networkslist of stringsRequired
Networks to be enabled for the policy. Example: `ETH_MAINNET`. For Solana policies, valid values are `SOLANA_MAINNET` and `SOLANA_DEVNET`.
rulesobjectOptional
Rules for `sponsorship` policy type. Empty if `policyType` is not `sponsorship`.
solana_rulesobjectOptional
Rules for `solana` policy type. Empty if `policyType` is not `solana`.
erc20_rulesobjectOptional
Rules for `erc20` policy type. Empty if `policyType` is not `erc20`.

Response

Policy created successfully
dataobject
errorobject