API Keys

Get Publishable Key

Retrieve the active publishable API key for the merchant. Publishable keys (pk_) are safe for client-side use with limited 'public' permission. Only one active publishable key exists per environment; creating a new one revokes the previous. Note: the implementation currently ignores the environment query parameter and always returns the 'live' key.

GET
/api-keys/publishable

Authorization

bearerAuth
AuthorizationBearer <token>

Use your secret API key as the bearer token

In: header

Query Parameters

environment?string

Environment to get the key for (currently hardcoded to 'live' in the implementation)

Default"live"
Value in"live" | "test"

Response Body

application/json

application/json

application/json

curl -X GET "https://api.getlumen.dev/v1/api-keys/publishable"
{
  "success": true,
  "data": {
    "id": "key_xyz789abc",
    "name": "Live Publishable Key",
    "keyType": "publishable",
    "environment": "live",
    "keyValue": "pk_live_m9n8o7p6q5r4s3t2u1v0w9x8",
    "prefix": "pk_live_m9n8",
    "createdAt": "2025-01-10T14:22:30.000Z"
  }
}
{
  "error": "No active publishable key found for this environment"
}
{
  "error": "Failed to get publishable key",
  "details": "Database temporarily unavailable"
}