# Replace Policy

> For the complete documentation index, see [llms.txt](/docs/llms.txt).

PUT https://manage.g.alchemy.com/api/gasManager/policy/{id}

Replaces all rules in an existing policy by id.

<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>


Reference: https://www.alchemy.com/docs/wallets/api-reference/gas-manager-admin-api/admin-api-endpoints/replace-policy

## Headers

| Name | Type | Required | Description |
|------|------|----------|-------------|
| Authorization | string | Yes | Bearer authentication token |

## Path Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| id | string | Yes | ID of the policy to be replaced |

## Code Examples

### cURL

```bash
curl --request PUT \
  --url https://manage.g.alchemy.com/api/gasManager/policy/a844e221-3c13-40c6-95db-d2db390e14b5 \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "policyName": "My Policy",
  "rules": {
    "maxSpendUsd": "5000.00",
    "maxSpendPerSenderUsd": "100.00",
    "maxSpendPerUoUsd": "20.00",
    "maxCount": "100",
    "maxCountPerSender": "2",
    "senderAllowlist": [
      "string"
    ],
    "senderBlocklist": [
      "string"
    ],
    "startTimeUnix": "1674228753",
    "endTimeUnix": "1679340742",
    "sponsorshipExpiryMs": "600000",
    "webhookRules": {
      "webhookUrl": "https://dashboard.alchemy.com/gas-manager/policy/create",
      "approveOnFailure": false
    }
  },
  "networks": [
    "string"
  ],
  "solana_rules": {
    "maxSpendUsd": "6500.00",
    "maxSpendPerTxnUsd": "30.00",
    "maxCount": "200",
    "startTimeUnix": "1674228753",
    "endTimeUnix": "1679340742"
  },
  "erc20_rules": {
    "tokens": [
      {
        "network": "string",
        "token_address": "string",
        "price_reference_network": "string",
        "price_reference_token_address": "string"
      }
    ],
    "recipient_address": "string",
    "use_post_op": false,
    "price_multiplier": 1,
    "rules": {
      "maxSpendUsd": "5000.00",
      "maxSpendPerSenderUsd": "100.00",
      "maxSpendPerUoUsd": "20.00",
      "maxCount": "100",
      "maxCountPerSender": "2",
      "senderAllowlist": [
        "string"
      ],
      "senderBlocklist": [
        "string"
      ],
      "startTimeUnix": "1674228753",
      "endTimeUnix": "1679340742",
      "sponsorshipExpiryMs": "600000",
      "webhookRules": {
        "webhookUrl": "https://dashboard.alchemy.com/gas-manager/policy/create",
        "approveOnFailure": false
      }
    }
  }
}'
```

### JavaScript

```javascript
const options = {
  method: 'PUT',
  headers: {'Content-Type': 'application/json', Authorization: 'Bearer <token>'},
  body: JSON.stringify({
    policyName: 'My Policy',
    rules: {
      maxSpendUsd: '5000.00',
      maxSpendPerSenderUsd: '100.00',
      maxSpendPerUoUsd: '20.00',
      maxCount: '100',
      maxCountPerSender: '2',
      senderAllowlist: ['string'],
      senderBlocklist: ['string'],
      startTimeUnix: '1674228753',
      endTimeUnix: '1679340742',
      sponsorshipExpiryMs: '600000',
      webhookRules: {
        webhookUrl: 'https://dashboard.alchemy.com/gas-manager/policy/create',
        approveOnFailure: false
      }
    },
    networks: ['string'],
    solana_rules: {
      maxSpendUsd: '6500.00',
      maxSpendPerTxnUsd: '30.00',
      maxCount: '200',
      startTimeUnix: '1674228753',
      endTimeUnix: '1679340742'
    },
    erc20_rules: {
      tokens: [
        {
          network: 'string',
          token_address: 'string',
          price_reference_network: 'string',
          price_reference_token_address: 'string'
        }
      ],
      recipient_address: 'string',
      use_post_op: false,
      price_multiplier: 1,
      rules: {
        maxSpendUsd: '5000.00',
        maxSpendPerSenderUsd: '100.00',
        maxSpendPerUoUsd: '20.00',
        maxCount: '100',
        maxCountPerSender: '2',
        senderAllowlist: ['string'],
        senderBlocklist: ['string'],
        startTimeUnix: '1674228753',
        endTimeUnix: '1679340742',
        sponsorshipExpiryMs: '600000',
        webhookRules: {
          webhookUrl: 'https://dashboard.alchemy.com/gas-manager/policy/create',
          approveOnFailure: false
        }
      }
    }
  })
};

fetch('https://manage.g.alchemy.com/api/gasManager/policy/a844e221-3c13-40c6-95db-d2db390e14b5', options)
  .then(res => res.json())
  .then(res => console.log(res))
  .catch(err => console.error(err));
```

### Python

```python
import requests

url = "https://manage.g.alchemy.com/api/gasManager/policy/a844e221-3c13-40c6-95db-d2db390e14b5"

payload = {
    "policyName": "My Policy",
    "rules": {
        "maxSpendUsd": "5000.00",
        "maxSpendPerSenderUsd": "100.00",
        "maxSpendPerUoUsd": "20.00",
        "maxCount": "100",
        "maxCountPerSender": "2",
        "senderAllowlist": ["string"],
        "senderBlocklist": ["string"],
        "startTimeUnix": "1674228753",
        "endTimeUnix": "1679340742",
        "sponsorshipExpiryMs": "600000",
        "webhookRules": {
            "webhookUrl": "https://dashboard.alchemy.com/gas-manager/policy/create",
            "approveOnFailure": False
        }
    },
    "networks": ["string"],
    "solana_rules": {
        "maxSpendUsd": "6500.00",
        "maxSpendPerTxnUsd": "30.00",
        "maxCount": "200",
        "startTimeUnix": "1674228753",
        "endTimeUnix": "1679340742"
    },
    "erc20_rules": {
        "tokens": [
            {
                "network": "string",
                "token_address": "string",
                "price_reference_network": "string",
                "price_reference_token_address": "string"
            }
        ],
        "recipient_address": "string",
        "use_post_op": False,
        "price_multiplier": 1,
        "rules": {
            "maxSpendUsd": "5000.00",
            "maxSpendPerSenderUsd": "100.00",
            "maxSpendPerUoUsd": "20.00",
            "maxCount": "100",
            "maxCountPerSender": "2",
            "senderAllowlist": ["string"],
            "senderBlocklist": ["string"],
            "startTimeUnix": "1674228753",
            "endTimeUnix": "1679340742",
            "sponsorshipExpiryMs": "600000",
            "webhookRules": {
                "webhookUrl": "https://dashboard.alchemy.com/gas-manager/policy/create",
                "approveOnFailure": False
            }
        }
    }
}
headers = {
    "Content-Type": "application/json",
    "Authorization": "Bearer <token>"
}

response = requests.put(url, json=payload, headers=headers)

print(response.text)
```

### Go

```go
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://manage.g.alchemy.com/api/gasManager/policy/a844e221-3c13-40c6-95db-d2db390e14b5"

	payload := strings.NewReader("{\n  \"policyName\": \"My Policy\",\n  \"rules\": {\n    \"maxSpendUsd\": \"5000.00\",\n    \"maxSpendPerSenderUsd\": \"100.00\",\n    \"maxSpendPerUoUsd\": \"20.00\",\n    \"maxCount\": \"100\",\n    \"maxCountPerSender\": \"2\",\n    \"senderAllowlist\": [\n      \"string\"\n    ],\n    \"senderBlocklist\": [\n      \"string\"\n    ],\n    \"startTimeUnix\": \"1674228753\",\n    \"endTimeUnix\": \"1679340742\",\n    \"sponsorshipExpiryMs\": \"600000\",\n    \"webhookRules\": {\n      \"webhookUrl\": \"https://dashboard.alchemy.com/gas-manager/policy/create\",\n      \"approveOnFailure\": false\n    }\n  },\n  \"networks\": [\n    \"string\"\n  ],\n  \"solana_rules\": {\n    \"maxSpendUsd\": \"6500.00\",\n    \"maxSpendPerTxnUsd\": \"30.00\",\n    \"maxCount\": \"200\",\n    \"startTimeUnix\": \"1674228753\",\n    \"endTimeUnix\": \"1679340742\"\n  },\n  \"erc20_rules\": {\n    \"tokens\": [\n      {\n        \"network\": \"string\",\n        \"token_address\": \"string\",\n        \"price_reference_network\": \"string\",\n        \"price_reference_token_address\": \"string\"\n      }\n    ],\n    \"recipient_address\": \"string\",\n    \"use_post_op\": false,\n    \"price_multiplier\": 1,\n    \"rules\": {\n      \"maxSpendUsd\": \"5000.00\",\n      \"maxSpendPerSenderUsd\": \"100.00\",\n      \"maxSpendPerUoUsd\": \"20.00\",\n      \"maxCount\": \"100\",\n      \"maxCountPerSender\": \"2\",\n      \"senderAllowlist\": [\n        \"string\"\n      ],\n      \"senderBlocklist\": [\n        \"string\"\n      ],\n      \"startTimeUnix\": \"1674228753\",\n      \"endTimeUnix\": \"1679340742\",\n      \"sponsorshipExpiryMs\": \"600000\",\n      \"webhookRules\": {\n        \"webhookUrl\": \"https://dashboard.alchemy.com/gas-manager/policy/create\",\n        \"approveOnFailure\": false\n      }\n    }\n  }\n}")

	req, _ := http.NewRequest("PUT", url, payload)

	req.Header.Add("Content-Type", "application/json")
	req.Header.Add("Authorization", "Bearer <token>")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(string(body))

}
```

### Java

```java
HttpResponse<String> response = Unirest.put("https://manage.g.alchemy.com/api/gasManager/policy/a844e221-3c13-40c6-95db-d2db390e14b5")
  .header("Content-Type", "application/json")
  .header("Authorization", "Bearer <token>")
  .body("{\n  \"policyName\": \"My Policy\",\n  \"rules\": {\n    \"maxSpendUsd\": \"5000.00\",\n    \"maxSpendPerSenderUsd\": \"100.00\",\n    \"maxSpendPerUoUsd\": \"20.00\",\n    \"maxCount\": \"100\",\n    \"maxCountPerSender\": \"2\",\n    \"senderAllowlist\": [\n      \"string\"\n    ],\n    \"senderBlocklist\": [\n      \"string\"\n    ],\n    \"startTimeUnix\": \"1674228753\",\n    \"endTimeUnix\": \"1679340742\",\n    \"sponsorshipExpiryMs\": \"600000\",\n    \"webhookRules\": {\n      \"webhookUrl\": \"https://dashboard.alchemy.com/gas-manager/policy/create\",\n      \"approveOnFailure\": false\n    }\n  },\n  \"networks\": [\n    \"string\"\n  ],\n  \"solana_rules\": {\n    \"maxSpendUsd\": \"6500.00\",\n    \"maxSpendPerTxnUsd\": \"30.00\",\n    \"maxCount\": \"200\",\n    \"startTimeUnix\": \"1674228753\",\n    \"endTimeUnix\": \"1679340742\"\n  },\n  \"erc20_rules\": {\n    \"tokens\": [\n      {\n        \"network\": \"string\",\n        \"token_address\": \"string\",\n        \"price_reference_network\": \"string\",\n        \"price_reference_token_address\": \"string\"\n      }\n    ],\n    \"recipient_address\": \"string\",\n    \"use_post_op\": false,\n    \"price_multiplier\": 1,\n    \"rules\": {\n      \"maxSpendUsd\": \"5000.00\",\n      \"maxSpendPerSenderUsd\": \"100.00\",\n      \"maxSpendPerUoUsd\": \"20.00\",\n      \"maxCount\": \"100\",\n      \"maxCountPerSender\": \"2\",\n      \"senderAllowlist\": [\n        \"string\"\n      ],\n      \"senderBlocklist\": [\n        \"string\"\n      ],\n      \"startTimeUnix\": \"1674228753\",\n      \"endTimeUnix\": \"1679340742\",\n      \"sponsorshipExpiryMs\": \"600000\",\n      \"webhookRules\": {\n        \"webhookUrl\": \"https://dashboard.alchemy.com/gas-manager/policy/create\",\n        \"approveOnFailure\": false\n      }\n    }\n  }\n}")
  .asString();
```

### C#

```csharp
using RestSharp;


var options = new RestClientOptions("https://manage.g.alchemy.com/api/gasManager/policy/a844e221-3c13-40c6-95db-d2db390e14b5");
var client = new RestClient(options);
var request = new RestRequest("");
request.AddHeader("Authorization", "Bearer <token>");
request.AddJsonBody("{\n  \"policyName\": \"My Policy\",\n  \"rules\": {\n    \"maxSpendUsd\": \"5000.00\",\n    \"maxSpendPerSenderUsd\": \"100.00\",\n    \"maxSpendPerUoUsd\": \"20.00\",\n    \"maxCount\": \"100\",\n    \"maxCountPerSender\": \"2\",\n    \"senderAllowlist\": [\n      \"string\"\n    ],\n    \"senderBlocklist\": [\n      \"string\"\n    ],\n    \"startTimeUnix\": \"1674228753\",\n    \"endTimeUnix\": \"1679340742\",\n    \"sponsorshipExpiryMs\": \"600000\",\n    \"webhookRules\": {\n      \"webhookUrl\": \"https://dashboard.alchemy.com/gas-manager/policy/create\",\n      \"approveOnFailure\": false\n    }\n  },\n  \"networks\": [\n    \"string\"\n  ],\n  \"solana_rules\": {\n    \"maxSpendUsd\": \"6500.00\",\n    \"maxSpendPerTxnUsd\": \"30.00\",\n    \"maxCount\": \"200\",\n    \"startTimeUnix\": \"1674228753\",\n    \"endTimeUnix\": \"1679340742\"\n  },\n  \"erc20_rules\": {\n    \"tokens\": [\n      {\n        \"network\": \"string\",\n        \"token_address\": \"string\",\n        \"price_reference_network\": \"string\",\n        \"price_reference_token_address\": \"string\"\n      }\n    ],\n    \"recipient_address\": \"string\",\n    \"use_post_op\": false,\n    \"price_multiplier\": 1,\n    \"rules\": {\n      \"maxSpendUsd\": \"5000.00\",\n      \"maxSpendPerSenderUsd\": \"100.00\",\n      \"maxSpendPerUoUsd\": \"20.00\",\n      \"maxCount\": \"100\",\n      \"maxCountPerSender\": \"2\",\n      \"senderAllowlist\": [\n        \"string\"\n      ],\n      \"senderBlocklist\": [\n        \"string\"\n      ],\n      \"startTimeUnix\": \"1674228753\",\n      \"endTimeUnix\": \"1679340742\",\n      \"sponsorshipExpiryMs\": \"600000\",\n      \"webhookRules\": {\n        \"webhookUrl\": \"https://dashboard.alchemy.com/gas-manager/policy/create\",\n        \"approveOnFailure\": false\n      }\n    }\n  }\n}", false);
var response = await client.PutAsync(request);

Console.WriteLine("{0}", response.Content);

```


## Operation Specification

```yaml
path: /api/gasManager/policy/{id}
method: PUT
operation:
  summary: Replace Policy
  description: |
    Replaces all rules in an existing policy by id.

    <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>
  operationId: replace-policy
  security:
    - BearerAuth: []
  parameters:
    - name: id
      description: ID of the policy to be replaced
      in: path
      required: true
      schema:
        type: string
        default: a844e221-3c13-40c6-95db-d2db390e14b5
  requestBody:
    content:
      application/json:
        schema:
          type: object
          properties:
            policyName:
              type: string
              description: Name of the policy
              default: My Policy
            rules:
              description: Rules for "sponsorship" policy type. Empty if `policyType` is not "sponsorship".
              type: object
              properties:
                maxSpendUsd:
                  type: string
                  description: Maximum amount of USD that can be sponsored
                  default: '5000.00'
                maxSpendPerSenderUsd:
                  type: string
                  description: Maximum amount of USD that can be sponsored for a single sender (not enforced on testnets)
                  default: '100.00'
                maxSpendPerUoUsd:
                  type: string
                  description: Maximum amount of USD that can be sponsored for a single userOperation (not enforced on testnets)
                  default: '20.00'
                maxCount:
                  type: string
                  description: Maximum number of userOperations that can be sponsored
                  default: '100'
                maxCountPerSender:
                  type: string
                  description: Maximum number of userOperations that can be sponsored for a single sender
                  default: '2'
                senderAllowlist:
                  type: array
                  items:
                    type: string
                  description: List of addresses that are eligible for sponsorship
                  default:
                    - '0xf39fd6e51aad88f6f4ce6ab8827279cfffb92266'
                    - '0x70997970c51812dc3a010c7d01b50e0d17dc79c8'
                senderBlocklist:
                  type: array
                  items:
                    type: string
                  description: List of addresses that are banned from receiving sponsorship
                startTimeUnix:
                  type: string
                  description: Unix timestamp of when the policy starts
                  default: '1674228753'
                endTimeUnix:
                  type: string
                  description: Unix timestamp of when the policy ends
                  default: '1679340742'
                sponsorshipExpiryMs:
                  type: string
                  description: Milliseconds from signing that the sponsorship expires
                  default: '600000'
                webhookRules:
                  type: object
                  description: Enable conditional gas sponsorship by making a request to your server to verify sponsorship eligibility
                  properties:
                    webhookUrl:
                      type: string
                      format: uri
                      description: The URL to call to verify sponsorship eligibility.
                      example: https://dashboard.alchemy.com/gas-manager/policy/create
                    approveOnFailure:
                      type: boolean
                      description: If true, the userOp will be sponsored in the event on an error or timeout.
                      default: false
                  required:
                    - webhookUrl
                    - approveOnFailure
              required:
                - startTimeUnix
                - sponsorshipExpiryMs
            networks:
              description: |
                Networks for the policy. Example: `ETH_MAINNET`. For Solana policies, valid values are `SOLANA_MAINNET` and `SOLANA_DEVNET`.
              type: array
              items:
                type: string
            solana_rules:
              description: Rules for `solana` policy type. Empty if `policyType` is not `solana`.
              type: object
              properties:
                maxSpendUsd:
                  type: string
                  description: Maximum amount of USD that can be sponsored
                  default: '6500.00'
                maxSpendPerTxnUsd:
                  type: string
                  description: Maximum amount of USD that can be sponsored per transaction (not enforced on testnet)
                  default: '30.00'
                maxCount:
                  type: string
                  description: Maximum number of transactions that can be sponsored
                  default: '200'
                startTimeUnix:
                  type: string
                  description: Unix timestamp of when the policy starts
                  default: '1674228753'
                endTimeUnix:
                  type: string
                  description: Unix timestamp of when the policy ends
                  default: '1679340742'
            erc20_rules:
              description: Rules for `erc20` policy type. Empty if `policyType` is not `erc20`.
              type: object
              properties:
                tokens:
                  type: array
                  items:
                    type: object
                    properties:
                      network:
                        type: string
                        description: Network of the Erc20 token
                      token_address:
                        type: string
                        description: Erc20 token contract address
                      price_reference_network:
                        type: string
                        description: Network to be used to calculate conversion rate (required for testnet ERC-20 tokens)
                      price_reference_token_address:
                        type: string
                        description: Erc20 token contract address (on `price_reference_network`) to be used to calculate conversion rate (required for testnet ERC-20 tokens)
                    required:
                      - network
                      - token_address
                  description: Erc20 tokens allowed under this policy
                recipient_address:
                  type: string
                  description: Wallet address that will receive the tokens paid by users. Please ensure that you own this address across all networks enabled under this policy
                use_post_op:
                  type: boolean
                  description: |
                    Erc20 transfer mode
                    - [Recommended] True: The user pays for the gas after the userOp execution. Enables the user to allow the paymaster contract to spend the ERC-20 token on their behalf (`approve()`) without a separate tx, improving ux. If the transfer fails, the userOp will revert but you’ll remain liable for the gas costs.
                    - False: The user pays for the gas before the userOp execution. Requires the paymaster contract to have allowance onchain before the userOp gets submitted. If the allowance doesn’t exist, the userOp will fail immediately.
                price_multiplier:
                  type: number
                  description: |
                    Adjust the Erc20 amount the user pays. For example: 
                    - `1.1` means that they user pays 10% more (you monetize gas payments)
                    - `0.95` means that the user pays 5% less (you partially sponsor gas)
                rules:
                  description: Rules for `erc20` policy type.
                  type: object
                  properties:
                    maxSpendUsd:
                      type: string
                      description: Maximum amount of USD that can be sponsored
                      default: '5000.00'
                    maxSpendPerSenderUsd:
                      type: string
                      description: Maximum amount of USD that can be sponsored for a single sender (not enforced on testnets)
                      default: '100.00'
                    maxSpendPerUoUsd:
                      type: string
                      description: Maximum amount of USD that can be sponsored for a single userOperation (not enforced on testnets)
                      default: '20.00'
                    maxCount:
                      type: string
                      description: Maximum number of userOperations that can be sponsored
                      default: '100'
                    maxCountPerSender:
                      type: string
                      description: Maximum number of userOperations that can be sponsored for a single sender
                      default: '2'
                    senderAllowlist:
                      type: array
                      items:
                        type: string
                      description: List of addresses that are eligible for sponsorship
                      default:
                        - '0xf39fd6e51aad88f6f4ce6ab8827279cfffb92266'
                        - '0x70997970c51812dc3a010c7d01b50e0d17dc79c8'
                    senderBlocklist:
                      type: array
                      items:
                        type: string
                      description: List of addresses that are banned from receiving sponsorship
                    startTimeUnix:
                      type: string
                      description: Unix timestamp of when the policy starts
                      default: '1674228753'
                    endTimeUnix:
                      type: string
                      description: Unix timestamp of when the policy ends
                      default: '1679340742'
                    sponsorshipExpiryMs:
                      type: string
                      description: Milliseconds from signing that the sponsorship expires
                      default: '600000'
                    webhookRules:
                      type: object
                      description: Enable conditional gas sponsorship by making a request to your server to verify sponsorship eligibility
                      properties:
                        webhookUrl:
                          type: string
                          format: uri
                          description: The URL to call to verify sponsorship eligibility.
                          example: https://dashboard.alchemy.com/gas-manager/policy/create
                        approveOnFailure:
                          type: boolean
                          description: If true, the userOp will be sponsored in the event on an error or timeout.
                          default: false
                      required:
                        - webhookUrl
                        - approveOnFailure
                  required:
                    - startTimeUnix
                    - sponsorshipExpiryMs
  responses:
    '200':
      description: Policy rules replaced successfully
      content:
        application/json:
          schema:
            type: object
            properties:
              data:
                type: object
                properties:
                  policy:
                    type: object
                    properties:
                      policyId:
                        type: string
                        description: String ID of the policy
                        default: '0x1234567890abcdef'
                      appId:
                        type: string
                        description: String ID of the app
                        default: '0x1234567890abcdef'
                      status:
                        type: string
                        description: Status of the policy
                        default: active
                      rules:
                        description: Rules for `sponsorship` policy type. Empty if `policyType` is not `sponsorship`.
                        type: object
                        properties:
                          maxSpendUsd:
                            type: string
                            description: Maximum amount of USD that can be sponsored
                            default: '5000.00'
                          maxSpendPerSenderUsd:
                            type: string
                            description: Maximum amount of USD that can be sponsored for a single sender (not enforced on testnets)
                            default: '100.00'
                          maxSpendPerUoUsd:
                            type: string
                            description: Maximum amount of USD that can be sponsored for a single userOperation (not enforced on testnets)
                            default: '20.00'
                          maxCount:
                            type: string
                            description: Maximum number of userOperations that can be sponsored
                            default: '100'
                          maxCountPerSender:
                            type: string
                            description: Maximum number of userOperations that can be sponsored for a single sender
                            default: '2'
                          senderAllowlist:
                            type: array
                            items:
                              type: string
                            description: List of addresses that are eligible for sponsorship
                            default:
                              - '0xf39fd6e51aad88f6f4ce6ab8827279cfffb92266'
                              - '0x70997970c51812dc3a010c7d01b50e0d17dc79c8'
                          senderBlocklist:
                            type: array
                            items:
                              type: string
                            description: List of addresses that are banned from receiving sponsorship
                          startTimeUnix:
                            type: string
                            description: Unix timestamp of when the policy starts
                            default: '1674228753'
                          endTimeUnix:
                            type: string
                            description: Unix timestamp of when the policy ends
                            default: '1679340742'
                          sponsorshipExpiryMs:
                            type: string
                            description: Milliseconds from signing that the sponsorship expires
                            default: '600000'
                          webhookRules:
                            type: object
                            description: Enable conditional gas sponsorship by making a request to your server to verify sponsorship eligibility
                            properties:
                              webhookUrl:
                                type: string
                                format: uri
                                description: The URL to call to verify sponsorship eligibility.
                                example: https://dashboard.alchemy.com/gas-manager/policy/create
                              approveOnFailure:
                                type: boolean
                                description: If true, the userOp will be sponsored in the event on an error or timeout.
                                default: false
                            required:
                              - webhookUrl
                              - approveOnFailure
                        required:
                          - startTimeUnix
                          - sponsorshipExpiryMs
                      policyName:
                        type: string
                        description: Name of the policy
                        default: Gas Manager Policy
                      lastUpdatedUnix:
                        type: string
                        description: Unix timestamp of when the policy was last updated
                        default: '1674228753'
                      policyVersion:
                        type: number
                        description: Version of the policy
                        default: 0
                      policyType:
                        description: Type of the policy.
                        type: string
                        enum:
                          - sponsorship
                          - erc20
                          - solana
                        default: sponsorship
                      policyState:
                        type: string
                        description: State of the policy
                        default: ongoing
                      networks:
                        type: array
                        items:
                          type: string
                        description: List of networks the policy is active on
                      gas_pump_id:
                        type: string
                        description: Gas pump id
                      erc20_rules:
                        description: Erc20 rules for policy. Empty if `policyType` is not `erc20`.
                        type: object
                        properties:
                          tokens:
                            type: array
                            items:
                              type: object
                              properties:
                                network:
                                  type: string
                                  description: Network of the Erc20 token
                                token_address:
                                  type: string
                                  description: Erc20 token contract address
                                price_reference_network:
                                  type: string
                                  description: Network to be used to calculate conversion rate (required for testnet ERC-20 tokens)
                                price_reference_token_address:
                                  type: string
                                  description: Erc20 token contract address (on `price_reference_network`) to be used to calculate conversion rate (required for testnet ERC-20 tokens)
                              required:
                                - network
                                - token_address
                            description: Erc20 tokens allowed under this policy
                          recipient_address:
                            type: string
                            description: Wallet address that will receive the tokens paid by users. Please ensure that you own this address across all networks enabled under this policy
                          use_post_op:
                            type: boolean
                            description: |
                              Erc20 transfer mode
                              - [Recommended] True: The user pays for the gas after the userOp execution. Enables the user to allow the paymaster contract to spend the ERC-20 token on their behalf (`approve()`) without a separate tx, improving ux. If the transfer fails, the userOp will revert but you’ll remain liable for the gas costs.
                              - False: The user pays for the gas before the userOp execution. Requires the paymaster contract to have allowance onchain before the userOp gets submitted. If the allowance doesn’t exist, the userOp will fail immediately.
                          price_multiplier:
                            type: number
                            description: |
                              Adjust the Erc20 amount the user pays. For example: 
                              - `1.1` means that they user pays 10% more (you monetize gas payments)
                              - `0.95` means that the user pays 5% less (you partially sponsor gas)
                          rules:
                            description: Rules for `erc20` policy type.
                            type: object
                            properties:
                              maxSpendUsd:
                                type: string
                                description: Maximum amount of USD that can be sponsored
                                default: '5000.00'
                              maxSpendPerSenderUsd:
                                type: string
                                description: Maximum amount of USD that can be sponsored for a single sender (not enforced on testnets)
                                default: '100.00'
                              maxSpendPerUoUsd:
                                type: string
                                description: Maximum amount of USD that can be sponsored for a single userOperation (not enforced on testnets)
                                default: '20.00'
                              maxCount:
                                type: string
                                description: Maximum number of userOperations that can be sponsored
                                default: '100'
                              maxCountPerSender:
                                type: string
                                description: Maximum number of userOperations that can be sponsored for a single sender
                                default: '2'
                              senderAllowlist:
                                type: array
                                items:
                                  type: string
                                description: List of addresses that are eligible for sponsorship
                                default:
                                  - '0xf39fd6e51aad88f6f4ce6ab8827279cfffb92266'
                                  - '0x70997970c51812dc3a010c7d01b50e0d17dc79c8'
                              senderBlocklist:
                                type: array
                                items:
                                  type: string
                                description: List of addresses that are banned from receiving sponsorship
                              startTimeUnix:
                                type: string
                                description: Unix timestamp of when the policy starts
                                default: '1674228753'
                              endTimeUnix:
                                type: string
                                description: Unix timestamp of when the policy ends
                                default: '1679340742'
                              sponsorshipExpiryMs:
                                type: string
                                description: Milliseconds from signing that the sponsorship expires
                                default: '600000'
                              webhookRules:
                                type: object
                                description: Enable conditional gas sponsorship by making a request to your server to verify sponsorship eligibility
                                properties:
                                  webhookUrl:
                                    type: string
                                    format: uri
                                    description: The URL to call to verify sponsorship eligibility.
                                    example: https://dashboard.alchemy.com/gas-manager/policy/create
                                  approveOnFailure:
                                    type: boolean
                                    description: If true, the userOp will be sponsored in the event on an error or timeout.
                                    default: false
                                required:
                                  - webhookUrl
                                  - approveOnFailure
                            required:
                              - startTimeUnix
                              - sponsorshipExpiryMs
                      solana_rules:
                        description: Solana rules for policy. Empty if `policyType` is not `solana`.
                        type: object
                        properties:
                          maxSpendUsd:
                            type: string
                            description: Maximum amount of USD that can be sponsored
                            default: '6500.00'
                          maxSpendPerTxnUsd:
                            type: string
                            description: Maximum amount of USD that can be sponsored per transaction (not enforced on testnet)
                            default: '30.00'
                          maxCount:
                            type: string
                            description: Maximum number of transactions that can be sponsored
                            default: '200'
                          startTimeUnix:
                            type: string
                            description: Unix timestamp of when the policy starts
                            default: '1674228753'
                          endTimeUnix:
                            type: string
                            description: Unix timestamp of when the policy ends
                            default: '1679340742'
                    required:
                      - policyId
                      - appId
                      - status
              error:
                type: object
                properties:
                  msg:
                    type: string
```
