HTTP API Reference for Momento API Keys
Momento provides an HTTP API for managing the API keys on your account. This API lets you generate, list, refresh, and revoke API keys programmatically, without going through the Momento console.
Each API key is tied to a role, which determines what the key is allowed to do. See the Roles HTTP API for how to create and manage the roles referenced here.
This is a global, account-level API served from a single endpoint: https://mga.registry.prod.a.momentohq.com.
Unlike the region-based cache endpoints, it is not tied to a specific cell or region.
Authentication
You will need a Momento API Key that grants auth-management access on your account. API Keys control access to Momento services and can be set to expire.
The API Key must be provided in the Authorization header.
Error responses
All errors share a common JSON body:
{
"code": "Bad Request",
"message": "A human-readable description of what went wrong."
}
| Field | Type | Description |
|---|---|---|
| code | String | A short, machine-readable label for the error class (for example, Bad Request, NotFound, PermissionDenied). |
| message | String | A human-readable description of the error. |
| err | String | An optional additional error metadata string, present only for some errors. |
API Keys API
The API Keys API lets you generate new API keys, list the keys that exist on your account, refresh a key, and revoke a key.
API key object
Operations that return key metadata use a common shape. The plaintext key material is never included in this object — it is returned only once, at generation time.
{
"key_id": "api-key-id",
"account_id": "account-id",
"description": "For deploying to CI/CD environments",
"role_id": "cicd-role",
"expires_at_epoch_seconds": 1719363600,
"issued_at_epoch_seconds": 1719360000
}
| Field | Type | Description |
|---|---|---|
| key_id | String | The unique identifier for the key. Use this value to revoke the key. |
| account_id | String | The account the key belongs to. |
| description | String | The description supplied when the key was generated. |
| role_id | String | The identifier of the role that determines the key's permissions. |
| expires_at_epoch_seconds | Integer | When the key expires, in seconds since the Unix epoch. Omitted for keys that never expire. |
| issued_at_epoch_seconds | Integer | When the key was generated, in seconds since the Unix epoch. |
Refresh tokens
Every expiring key is issued a refresh token alongside it, unless you opt out with exclude_refresh_token. A refresh token can be used exactly once, through Refresh API Key, for a successor key with the same role and description.
Refresh tokens are credentials and should be stored securely (e.g. in a secrets manager). They expire when the original key does, so make sure to rotate before they expire.
Generate API Key
Generates a new API key with the specified role, description, and expiry. The plaintext api_key is returned once in the response; copy it and store it securely (for example, in a secret manager such as AWS Secrets Manager, Azure Key Vault, or GCP Secret Manager). It cannot be retrieved again.