---
title: "pm_createPolicy"
method: POST
path: "/{apiKey}/megafuel"
tags: ["pm_createPolicy"]
---

# pm_createPolicy

`POST /{apiKey}/megafuel`

## Request

- Base URL: `https://open-platform-ap.nodereal.io`
- URL: `https://open-platform-ap.nodereal.io/{apiKey}/megafuel`
- Auth: none declared

> 📘 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).

Create a new sponsor policy. The caller's MegaNode identity (derived from the api-key) is automatically set as the policy owner.

**Notes:**
- `maxGasCost` is always initialised to `0` at creation time. Fund the policy afterwards via the deposit API.
- Each sponsor may own at most **N** policies (default 5, configurable by the platform).

## Path parameters

- `apiKey` string, required

## Request body

- object
  - `id` integer
  - `jsonrpc` string
  - `method` 'pm_createPolicy'
  - `params` object[]
    - `name` string, required: Policy name. Must be non-empty and at most 64 characters.
    - `chainID` integer, required: Chain ID of the network this policy applies to (e.g. 56 for BSC mainnet, 97 for BSC testnet).
    - `type` integer, required: Policy type. Refer to platform documentation for supported values.
    - `maxGasCostPerAddr` string: Maximum total gas cost (in wei) that can be sponsored for a single address over the policy lifetime. Omit or pass `""` for no limit.
    - `maxGasCostPerAddrPerDay` string: Maximum gas cost (in wei) that can be sponsored for a single address per day. Omit or pass `""` for no limit.
    - `minSupportedAmount` string, required: Minimum transaction value (in wei) required for sponsorship eligibility. Must be a non-negative integer string. Use `"0"` for no minimum.
    - `maxTxCountPerAddrPerDay` string: Maximum number of transactions that can be sponsored for a single address per day. Omit or pass `""` for no limit.
    - `start` integer, required: Unix timestamp (seconds) when the policy becomes active. Must be less than `end`.
    - `end` integer, required: Unix timestamp (seconds) when the policy expires. Must be greater than `start`.
    - `sponsorName` string: Display name of the sponsor. Max 64 characters. Optional.
    - `sponsorIcon` string: URL of the sponsor's icon. Max 2048 characters. Optional.
    - `sponsorWebsite` string: URL of the sponsor's website. Max 2048 characters. Optional.
    - `fundingFromAddress` string: Optional. The on-chain address from which BNB transfers to the platform wallet are automatically credited to this policy (Type-2 auto-deposit). Must be a valid hex address. Omit or pass `null` to leave unset.
    - `description` string: Short description of the policy. Max 200 characters. Optional.
    - `telegram` string: Telegram contact for the sponsor. Max 200 characters. Optional.
    - `phone` string: Phone contact for the sponsor. Max 200 characters. Optional.

## Response `200`

- object
  - `id` integer
  - `jsonrpc` string
  - `result` object: The newly created policy. maxGasCost will be "0" until the policy is funded.
    - `uuid` string, uuid: Unique identifier for the policy
    - `name` string: Name of the policy, max length 64 characters
    - `type` integer: Type of the policy
    - `network` integer: Chain ID of the network
    - `owner` string, uuid: UUID of the policy owner
    - `start` integer: Start timestamp of the policy
    - `end` integer: End timestamp of the policy
    - `activated` boolean: Whether the policy is currently activated
    - `fromWhitelistEnabled` boolean: Whether the from-address whitelist is enabled
    - `toWhitelistEnabled` boolean: Whether the to-address whitelist is enabled
    - `contractMethodSigWhitelistEnabled` boolean: Whether the contract method signature whitelist is enabled
    - `bep20ReceiverWhitelistEnabled` boolean: Whether the BEP20 receiver whitelist is enabled
    - `createTimestamp` integer: Timestamp when the policy was created
    - `updateTimestamp` integer: Timestamp when the policy was last updated
    - `sponsorName` string: Name of the policy sponsor, max length 64 characters
    - `sponsorIcon` string: URL of the sponsor's icon, max length 2048 characters
    - `sponsorWebsite` string: URL of the sponsor's website, max length 2048 characters
    - `maxGasCostPerAddr` string: Maximum gas cost allowed per address
    - `maxGasCostPerAddrPerDay` string: Maximum gas cost allowed per address per day
    - `maxGasCost` string: Maximum total gas cost allowed for the policy
    - `maxTxCountPerAddrPerDay` string: Maximum number of transactions allowed per address per day
    - `minSupportedAmount` string: Minimum amount that needs to be supported
    - `fundingFromAddress` string, nullable: On-chain address used for auto-deposit detection. Null if not configured.
    - `description` string: Short description of the policy. Max 200 characters.
    - `telegram` string: Telegram contact for the sponsor. Max 200 characters.
    - `phone` string: Phone contact for the sponsor. Max 200 characters.
    - `sponsoredGasfee` string: Total amount of gas fees sponsored under this policy
    - `remainingBalance` string: Remaining balance available for sponsoring gas fees

---

[API](https://skmtc.dev/nodereal/apis/megafuel-api.md) - [All operations](https://skmtc.dev/nodereal/apis/megafuel-api/llms.txt) - [OpenAPI document](https://skmtc.dev/nodereal/apis/megafuel-api/revisions/2a73dccf6778?raw)
