List API Keys
Retrieve all API keys for the account.
GET /api/v1/keys
Returns all API keys on the authenticated account. The full key value is never included — only the prefix. Authenticate with a JWT.
Response
Returns 200 OK with an api_keys array:
{
"api_keys": [
{
"id": "key_01hx...",
"name": "Production",
"key_prefix": "sk_live_abc",
"scopes": ["send"],
"created_at": "2024-01-15T10:00:00Z",
"revoked_at": null
}
]
}Code examples
curl https://api.smail.dev/api/v1/keys \
-H "Authorization: Bearer eyJ..."const { api_keys } = await smail.keys.list();
for (const key of api_keys) {
console.log(`${key.name} — ${key.key_prefix}...`);
}keys, err := client.Keys.List(ctx)
for _, key := range keys {
fmt.Printf("%s — %s...\n", key.Name, key.KeyPrefix)
}Error responses
| Status | Error | Description |
|---|---|---|
401 | unauthorized | Missing or invalid JWT |