---
updatedAt: 2026-04-03T06:38:44.000Z
agentTools:
  projectIndex: https://docs.nodereal.io/llms.txt
---

# pm_updatePolicy

> 📘 Supported on both Mainnet and Testnet.

Endpoint

- **Mainnet**: `https://open-platform-ap.nodereal.io/{apikey}/megafuel`
- **Testnet**: `https://open-platform-ap.nodereal.io/{apikey}/megafuel-testnet`

The `{apikey}` should be created via Nodereal MegaNode. Please refer to [Sponsor Guidelines](https://docs.nodereal.io/docs/megafuel-sponsor-guidelines).

Update an existing sponsor policy. Only the policy owner (identified via the api key) may call this method.

**`fundingFromAddress` semantics:**
- Omit the field → no change
- Pass `""` → clear the address (disables auto-deposit)
- Pass a valid hex address → set or replace the auto-deposit address


# OpenAPI definition

```json
{
  "openapi": "3.1.0",
  "info": {
    "title": "MEGAFUEL API",
    "version": "1.0"
  },
  "servers": [
    {
      "url": "https://open-platform-ap.nodereal.io"
    }
  ],
  "paths": {
    "/{apiKey}/megafuel": {
      "post": {
        "summary": "pm_updatePolicy",
        "description": "> 📘 Supported on both Mainnet and Testnet.\n\nEndpoint\n\n- **Mainnet**: `https://open-platform-ap.nodereal.io/{apikey}/megafuel`\n- **Testnet**: `https://open-platform-ap.nodereal.io/{apikey}/megafuel-testnet`\n\nThe `{apikey}` should be created via Nodereal MegaNode. Please refer to [Sponsor Guidelines](https://docs.nodereal.io/docs/megafuel-sponsor-guidelines).\n\nUpdate an existing sponsor policy. Only the policy owner (identified via the api key) may call this method.\n\n**`fundingFromAddress` semantics:**\n- Omit the field → no change\n- Pass `\"\"` → clear the address (disables auto-deposit)\n- Pass a valid hex address → set or replace the auto-deposit address\n",
        "tags": [
          "pm_updatePolicy"
        ],
        "parameters": [
          {
            "name": "apiKey",
            "in": "path",
            "schema": {
              "type": "string",
              "default": "<your-nodereal-apikey>"
            },
            "required": true
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "allOf": [
                  {
                    "type": "object",
                    "properties": {
                      "id": {
                        "type": "integer",
                        "default": 1
                      },
                      "jsonrpc": {
                        "type": "string",
                        "default": "2.0"
                      }
                    }
                  },
                  {
                    "type": "object",
                    "properties": {
                      "method": {
                        "type": "string",
                        "default": "pm_updatePolicy",
                        "enum": [
                          "pm_updatePolicy"
                        ]
                      },
                      "params": {
                        "type": "array",
                        "minItems": 1,
                        "maxItems": 1,
                        "items": {
                          "type": "object",
                          "required": [
                            "uuid"
                          ],
                          "properties": {
                            "uuid": {
                              "type": "string",
                              "format": "uuid",
                              "description": "UUID of the policy to update. Required.",
                              "example": "22a1e2e5-1234-11fd-9223-bc9ee5f5abc0"
                            },
                            "name": {
                              "type": "string",
                              "description": "New policy name. Max 64 characters. Omit to leave unchanged.",
                              "example": "updated-policy-name"
                            },
                            "maxGasCostPerAddr": {
                              "type": "string",
                              "description": "Maximum total gas cost (in wei) per address. Pass `\"-1\"` for unlimited.\nOmit or pass `\"\"` to leave unchanged.\n",
                              "example": "1000000000000000000"
                            },
                            "maxGasCostPerAddrPerDay": {
                              "type": "string",
                              "description": "Maximum gas cost (in wei) per address per day. Pass `\"-1\"` for unlimited.\nOmit or pass `\"\"` to leave unchanged.\n",
                              "example": "100000000000000000"
                            },
                            "maxGasCost": {
                              "type": "string",
                              "description": "Maximum total gas budget (in wei) for the policy. Pass `\"-1\"` for unlimited.\nOmit or pass `\"\"` to leave unchanged. (Admin only — ignored for sponsor callers.)\n",
                              "example": "10000000000000000000"
                            },
                            "minSupportedAmount": {
                              "type": "string",
                              "description": "Minimum transaction value (in wei) for sponsorship eligibility. Omit or pass `\"\"` to leave unchanged.",
                              "example": "0"
                            },
                            "maxTxCountPerAddrPerDay": {
                              "type": "string",
                              "description": "Maximum sponsored transactions per address per day. Omit or pass `\"\"` to leave unchanged.",
                              "example": "100"
                            },
                            "start": {
                              "type": "integer",
                              "format": "int64",
                              "description": "New policy start Unix timestamp. Omit or pass `0` to leave unchanged.",
                              "example": 1700000000
                            },
                            "end": {
                              "type": "integer",
                              "format": "int64",
                              "description": "New policy end Unix timestamp. Must be greater than `start`. Omit or pass `0` to leave unchanged.",
                              "example": 1900000000
                            },
                            "activated": {
                              "type": "boolean",
                              "description": "Set to `true` to activate or `false` to deactivate the policy. Omit to leave unchanged.",
                              "example": true
                            },
                            "sponsorName": {
                              "type": "string",
                              "description": "Display name of the sponsor. Max 64 characters. Omit or pass `\"\"` to leave unchanged.",
                              "example": "Acme Corp"
                            },
                            "sponsorIcon": {
                              "type": "string",
                              "description": "URL of the sponsor's icon. Max 2048 characters. Omit or pass `\"\"` to leave unchanged.",
                              "example": "https://example.com/icon.png"
                            },
                            "sponsorWebsite": {
                              "type": "string",
                              "description": "URL of the sponsor's website. Max 2048 characters. Omit or pass `\"\"` to leave unchanged.",
                              "example": "https://example.com"
                            },
                            "fundingFromAddress": {
                              "type": "string",
                              "description": "On-chain address used for auto-deposit detection.\n- Omit (or do not include the field) to leave unchanged.\n- Pass `\"\"` to clear (disable auto-deposit).\n- Pass a valid hex address to set or update.\n",
                              "nullable": true,
                              "example": "0xDE08B1Fd79b7016F8DD3Df11f7fa0FbfdF07c941"
                            }
                          }
                        },
                        "default": [
                          {
                            "uuid": "22a1e2e5-1234-11fd-9223-bc9ee5f5abc0",
                            "activated": true,
                            "fundingFromAddress": "0xDE08B1Fd79b7016F8DD3Df11f7fa0FbfdF07c941"
                          }
                        ]
                      }
                    }
                  }
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "integer"
                        },
                        "jsonrpc": {
                          "type": "string"
                        }
                      }
                    },
                    {
                      "type": "object",
                      "properties": {
                        "result": {
                          "description": "The updated policy with its current spend cost data.",
                          "type": "object",
                          "properties": {
                            "uuid": {
                              "type": "string",
                              "format": "uuid",
                              "description": "Unique identifier for the policy"
                            },
                            "name": {
                              "type": "string",
                              "description": "Name of the policy, max length 64 characters"
                            },
                            "type": {
                              "type": "integer",
                              "description": "Type of the policy"
                            },
                            "network": {
                              "type": "integer",
                              "description": "Chain ID of the network"
                            },
                            "owner": {
                              "type": "string",
                              "format": "uuid",
                              "description": "UUID of the policy owner"
                            },
                            "start": {
                              "type": "integer",
                              "format": "int64",
                              "description": "Start timestamp of the policy"
                            },
                            "end": {
                              "type": "integer",
                              "format": "int64",
                              "description": "End timestamp of the policy"
                            },
                            "activated": {
                              "type": "boolean",
                              "description": "Whether the policy is currently activated"
                            },
                            "fromWhitelistEnabled": {
                              "type": "boolean",
                              "description": "Whether the from-address whitelist is enabled"
                            },
                            "toWhitelistEnabled": {
                              "type": "boolean",
                              "description": "Whether the to-address whitelist is enabled"
                            },
                            "contractMethodSigWhitelistEnabled": {
                              "type": "boolean",
                              "description": "Whether the contract method signature whitelist is enabled"
                            },
                            "bep20ReceiverWhitelistEnabled": {
                              "type": "boolean",
                              "description": "Whether the BEP20 receiver whitelist is enabled"
                            },
                            "createTimestamp": {
                              "type": "integer",
                              "format": "int64",
                              "description": "Timestamp when the policy was created"
                            },
                            "updateTimestamp": {
                              "type": "integer",
                              "format": "int64",
                              "description": "Timestamp when the policy was last updated"
                            },
                            "sponsorName": {
                              "type": "string",
                              "description": "Name of the policy sponsor, max length 64 characters"
                            },
                            "sponsorIcon": {
                              "type": "string",
                              "description": "URL of the sponsor's icon, max length 2048 characters"
                            },
                            "sponsorWebsite": {
                              "type": "string",
                              "description": "URL of the sponsor's website, max length 2048 characters"
                            },
                            "maxGasCostPerAddr": {
                              "type": "string",
                              "description": "Maximum gas cost allowed per address"
                            },
                            "maxGasCostPerAddrPerDay": {
                              "type": "string",
                              "description": "Maximum gas cost allowed per address per day"
                            },
                            "maxGasCost": {
                              "type": "string",
                              "description": "Maximum total gas cost allowed for the policy"
                            },
                            "maxTxCountPerAddrPerDay": {
                              "type": "string",
                              "description": "Maximum number of transactions allowed per address per day"
                            },
                            "minSupportedAmount": {
                              "type": "string",
                              "description": "Minimum amount that needs to be supported"
                            },
                            "fundingFromAddress": {
                              "type": "string",
                              "description": "On-chain address used for auto-deposit detection. Null if not configured.",
                              "nullable": true,
                              "example": "0xDE08B1Fd79b7016F8DD3Df11f7fa0FbfdF07c941"
                            },
                            "sponsoredGasfee": {
                              "type": "string",
                              "description": "Total amount of gas fees sponsored under this policy"
                            },
                            "remainingBalance": {
                              "type": "string",
                              "description": "Remaining balance available for sponsoring gas fees"
                            }
                          }
                        }
                      }
                    }
                  ]
                }
              }
            }
          }
        },
        "operationId": "pm-updatePolicy"
      }
    }
  }
}
```