Skip to main content

The ApiKey object

Represents an API key for authenticating with the ZenPays API. API keys are used to authenticate requests and can be scoped to specific permissions and environments.

Fields

FieldTypeDescription
id
REQUIRED
stringUnique identifier for the API key
name
REQUIRED
stringDescriptive name for the API key
keyPrefix
REQUIRED
stringPrefix of the key for identification (e.g., 'sk_live_abc...')
environment
REQUIRED
'sandbox'| 'production'Environment the key is valid for
scopes
REQUIRED
string[]Permission scopes granted to this key
lastUsedAt
OPTIONAL
stringISO 8601 timestamp when the key was last used
expiresAt
OPTIONAL
stringISO 8601 timestamp when the key expires (if applicable)
createdAt
REQUIRED
stringISO 8601 timestamp when the key was created

Example

{
"id": "obj_1a2b3c",
"name": "string",
"keyPrefix": "string",
"environment": "sandbox",
"scopes": [],
"lastUsedAt": "2026-01-15T09:30:00Z",
"expiresAt": "2026-01-15T09:30:00Z",
"createdAt": "2026-01-15T09:30:00Z"
}