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
| Field | Type | Description |
|---|---|---|
id REQUIRED | string | Unique identifier for the API key |
name REQUIRED | string | Descriptive name for the API key |
keyPrefix REQUIRED | string | Prefix 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 | string | ISO 8601 timestamp when the key was last used |
expiresAt OPTIONAL | string | ISO 8601 timestamp when the key expires (if applicable) |
createdAt REQUIRED | string | ISO 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"
}