API Keys

Manage API keys for the Masumi Payment Service API

/api-key-status

This endpoint is used for checking the status of the existing API keys.

REQUIRES API KEY Authentication (+READ)

Gets api key status

GET./../api/v1//api-key-status/
Authorization
Response

API key status

Body
status*string
data*object
Request
const response = await fetch('./../api/v1//api-key-status/', {
    method: 'GET',
    headers: {
      "token": "API-Key <apiKey>"
    },
});
const data = await response.json();
Response
{
  "status": "success",
  "data": {
    "status": "ACTIVE",
    "apiKey": "masumi_payment_api_key_secret",
    "permission": "ADMIN",
    "usageLimited": true,
    "RemainingUsageCredits": [
      {
        "unit": "lovelace",
        "amount": 1000000
      }
    ]
  }
}

/api-key

These endpoints are used for managing API keys.

REQUIRES API KEY Authentication (+admin)

Gets api key status

GET./../api/v1//api-key/
Authorization
Query parameters
Response

Api key status

Body
status*string
data*object
Request
const response = await fetch('./../api/v1//api-key/', {
    method: 'GET',
    headers: {
      "token": "API-Key <apiKey>"
    },
});
const data = await response.json();
Response
{
  "data": {
    "apiKeys": [
      {
        "apiKey": "masumi_payment_api_key_secret",
        "permission": "ADMIN",
        "usageLimited": true,
        "RemainingUsageCredits": [
          {
            "unit": "lovelace",
            "amount": 1000000
          }
        ],
        "status": "ACTIVE"
      }
    ]
  },
  "status": "success"
}

REQUIRES API KEY Authentication (+admin)

Creates a API key

POST./../api/v1//api-key/
Authorization
Body
usageLimitedstring

Whether the API key is usage limited. Meaning only allowed to use the specified credits or can freely spend

UsageCredits*array of object

The credits allowed to be used by the API key. Only relevant if usageLimited is true.

permissionenum

The permission of the API key

READREAD_PAYADMIN
Response

API key deleted

Body
data*object
status*string
Request
const response = await fetch('./../api/v1//api-key/', {
    method: 'POST',
    headers: {
      "token": "API-Key <apiKey>",
      "Content-Type": "application/json"
    },
    body: JSON.stringify({
      "usageLimited": "true",
      "UsageCredits": [
        {
          "unit": "lovelace",
          "amount": 1000000
        }
      ],
      "permission": "ADMIN"
    }),
});
const data = await response.json();
Response
{
  "status": "success",
  "data": {
    "id": "unique_cuid_v2_of_entry_to_delete",
    "apiKey": "masumi_payment_api_key_secret",
    "permission": "ADMIN",
    "usageLimited": true,
    "status": "ACTIVE"
  }
}

REQUIRES API KEY Authentication (+admin)

Creates a API key

PATCH./../api/v1//api-key/
Authorization
Body
idstring

The id of the API key to update. Provide either id or apiKey

apiKeystring

The API key to update. Provide either id or apiKey

UsageCreditsarray of object

The remaining credits allowed to be used by the API key. Only relevant if usageLimited is true.

statusenum

The status of the API key

ACTIVEREVOKED
Response

API key deleted

Body
data*object
status*string
Request
const response = await fetch('./../api/v1//api-key/', {
    method: 'PATCH',
    headers: {
      "token": "API-Key <apiKey>",
      "Content-Type": "application/json"
    },
    body: JSON.stringify({
      "id": "id_or_apiKey_unique_cuid_v2_of_entry_to_update",
      "apiKey": "id_or_apiKey_api_key_to_update",
      "UsageCredits": [
        {
          "unit": "lovelace",
          "amount": 1000000
        }
      ],
      "status": "ACTIVE"
    }),
});
const data = await response.json();
Response
{
  "status": "success",
  "data": {
    "id": "unique_cuid_v2_of_entry_to_delete",
    "apiKey": "masumi_payment_api_key_secret",
    "permission": "ADMIN",
    "usageLimited": true,
    "status": "ACTIVE"
  }
}

REQUIRES API KEY Authentication (+admin)

Removes a API key

DELETE./../api/v1//api-key/
Authorization
Body
idstring

The id of the API key to delete. Provide either id or apiKey

apiKeystring

The API key to delete. Provide either id or apiKey

Response

API key deleted

Body
data*object
status*string
Request
const response = await fetch('./../api/v1//api-key/', {
    method: 'DELETE',
    headers: {
      "token": "API-Key <apiKey>",
      "Content-Type": "application/json"
    },
    body: JSON.stringify({
      "id": "id_or_apiKey_unique_cuid_v2_of_entry_to_delete",
      "apiKey": "id_or_apiKey_api_key_to_delete"
    }),
});
const data = await response.json();
Response
{
  "status": "success",
  "data": {
    "id": "unique_cuid_v2_of_entry_to_delete",
    "apiKey": "masumi_registry_api_key_secret"
  }
}

/rpc-api-keys

REQUIRES API KEY Authentication (+ADMIN)

Gets rpc api keys, currently only blockfrost is supported (internal)

GET./../api/v1//rpc-api-keys/
Authorization
Query parameters
Response

Blockfrost keys

Body
rpcProviderKeys*array of object
Request
const response = await fetch('./../api/v1//rpc-api-keys/', {
    method: 'GET',
    headers: {
      "token": "API-Key <apiKey>"
    },
});
const data = await response.json();
Response
{
  "rpcProviderKeys": [
    {
      "network": "PREPROD",
      "id": "unique_cuid_v2",
      "rpcProviderApiKey": "blockfrost_api_key",
      "createdAt": "2025-02-03T18:33:09.377Z",
      "updatedAt": "2025-02-03T18:33:09.377Z"
    }
  ]
}

Last updated