api-key

Create a new API key. (admin access required)

Changed on

Creates a API key

post/api-key

Request

  • Base URL: ./../api/v1/ (relative, and the document was published on a file host, not at the API’s origin)
  • URL: ./../api/v1/api-key
  • Auth: API key in header token

Request body

usageLimitedstring

Whether the API key is usage limited. Meaning only allowed to use the specified credits or can freely spend. Omitted defaults to true for non-admin keys; admin keys are never usage limited.

NetworkLimitstring[]

The Cardano networks the API key is allowed to use

ChainIdLimitstring[]

Additional non-Cardano CAIP-2 chain identifiers the API key is allowed to use. Omit to grant every configured EVM chain, mirroring NetworkLimit defaulting to all Cardano networks; pass an empty array to grant none.

permission'Read' | 'ReadAndPay' | 'Admin'

[DEPRECATED] The permission of the API key. Use canRead/canPay/canAdmin flags instead. Will be removed in a future version. Omitted means read-only; sending it together with contradictory canRead/canPay/canAdmin flags is rejected.

canReadboolean

Whether this API key can access read endpoints

canPayboolean

Whether this API key can access payment/purchase endpoints

canAdminboolean

Whether this API key has admin access

WalletScopeHotWalletIdsstring[]

List of hot wallet IDs to scope this API key to

X402WalletScopeEvmWalletIdsstring[]

Managed EVM wallet IDs to scope this API key to. Only applied when x402WalletScopeEnabled is true; the key also always reaches wallets it created itself.

Example request

{
  "usageLimited": "true",
  "UsageCredits": [
    {
      "unit": "",
      "amount": "10000000"
    }
  ],
  "canAdmin": true,
  "walletScopeEnabled": "false",
  "WalletScopeHotWalletIds": []
}

Response

API key created

statusstring required

Example response

{
  "status": "Success",
  "data": {
    "id": "api_key_id",
    "token": "masumi_payment_api_key_secret",
    "permission": "Admin",
    "canRead": true,
    "canPay": true,
    "canAdmin": true,
    "usageLimited": true,
    "NetworkLimit": [
      "Preprod"
    ],
    "ChainIdLimit": [
      "cardano:preprod"
    ],
    "RemainingUsageCredits": [
      {
        "unit": "",
        "amount": "10000000"
      }
    ],
    "status": "Active",
    "walletScopeEnabled": false,
    "WalletScopes": [],
    "x402WalletScopeEnabled": false,
    "X402WalletScopes": []
  }
}

Changes

    • info

      added the new optional request property

    • info

      added the new optional request property

    • info

      the request property default value changed from false to false

    • info

      the request property default value was removed

    • info

      the request property default value Read was removed

    • info

      the request property default value true was removed

    • info

      request property list-of-types was widened by adding types boolean to media type application/json

    • info

      added the required property / to the response with the status

    • info

      added the required property / to the response with the status

    • breaking

      request property list-of-types was narrowed by removing types boolean from media type application/json

    • breaking

      removed the required property / from the response with the status

    • breaking

      removed the required property / from the response with the status

    • warning

      removed the request property

    • warning

      removed the request property

    • info

      the request property default value was added

    • info

      the request property default value Read was added

    • info

      the request property default value true was added

    • info

      the request property default value changed from false to false