ApiKeyService
List API Keys
List non-revoked API keys for the caller account, or for a sub-account the caller owns or administers, newest first.
Request
curl --request GET \ \ --url 'https://api.testnet.polyester.com/v1/auth/api-keys?subaccountId=6789012345678' \ --header 'Accept: */*' \ --header 'X-API-KEY-ID: YOUR_API_KEY_ID' \ --header 'X-API-TIMESTAMP: YOUR_API_TIMESTAMP' \ --header 'X-API-SIGNATURE: YOUR_API_SIGNATURE'
Responses
{
"apiKeys": [
{
"color": "#7C3AED",
"createdAt": "2025-01-01T00:00:00Z",
"createdByActor": "dashboard",
"expiresAt": "2025-01-01T00:00:00Z",
"icon": "💰",
"ipWhitelist": [
"203.0.113.0/24"
],
"keyId": "ak_1a3c6de8153d5a5b04cd2a6529779542",
"label": "Trading Bot",
"lastUsedAt": "2025-01-01T00:00:00Z",
"policyId": "3Gxbxht1EK",
"publicKeyEd25519": "AA==",
"revision": "1",
"status": "ACTIVE",
"subaccountId": "37E2o5r2qHk",
"updatedAt": "2025-01-01T00:00:00Z"
}
]
}Optional filter: only keys scoped to this sub-account (opaque ID). The caller must own or administer the sub-account. If unset, only non-revoked keys owned by the caller are returned.
Stable opaque identifier used to refer to this key, formatted as "ak_" followed by 32 lowercase hex characters.
ak_1a3c6de8153d5a5b04cd2a6529779542Human-readable label for the key. Maximum length is 64 characters.
Trading BotOptional user-chosen icon/emoji for UI display.
💰Optional user-chosen color token for UI display.
#7C3AEDOptional CIDR whitelist. Empty means no IP restriction. Maximum 32 unique entries.
["203.0.113.0/24"]Current key status.
ACTIVEOptional sub-account this key is scoped to (opaque ID; empty = root-level).
37E2o5r2qHkOptional API policy attached to this key (opaque ID). Empty means no policy is attached and the key has no permissions.
3Gxbxht1EKTime in UTC when this key was created.
2025-01-01T00:00:00ZLast time in UTC when this key authenticated a request. Omitted when the key has not been used.
2025-01-01T00:00:00ZEd25519 public key bytes associated with this API key. The private key or seed is never returned by the API.
AA==Optional expiry time in UTC. When set, the key cannot authenticate requests after this time, regardless of status.
2025-01-01T00:00:00ZRead-only actor label describing who created this key, such as a username or account label.
dashboardTime in UTC when this key's configuration was last changed. For the same key, later is fresher, equal is an idempotent replay, and earlier is stale. Equal timestamps with different configuration indicate an invariant failure. This is independent of last_used_at, which tracks authentication activity.
2025-01-01T00:00:00ZMonotonic resource revision used for conditional updates.
1| Key | Status | Error | When |
|---|---|---|---|
| unauthenticated | 401 | Unauthenticated | Authentication required. |
| permission-denied | 403 | Permission Denied | Permission denied. |
| invalid-argument | 400 | Invalid Argument | Invalid argument. |
| not-found | 404 | Not Found | Not found. |
| unavailable | 503 | Unavailable | Service unavailable. |