Skip to main content

List API keys

Retrieve all API keys with their owner and usage metadata.

GET/api/admin/api-keys 🔒 API key · admin role

Returns every API key with owner and usage metadata. The full secret is never returned after creation — only the start prefix is shown for display.

Example request

curl https://app.talent-ray.com/api/admin/api-keys \
  -H "Authorization: Bearer tr_YOUR_ADMIN_KEY"

Response

200 OK

{
  "success": true,
  "data": [
    {
      "id": "apikey_xyz789",
      "name": "Karaca SAP nightly sync",
      "prefix": "tr_",
      "start": "tr_aaaa",
      "enabled": true,
      "createdAt": "2026-06-04T10:00:00Z",
      "updatedAt": "2026-06-04T10:00:00Z",
      "lastRequest": "2026-06-04T15:30:45Z",
      "expiresAt": "2026-09-03T12:00:00Z",
      "requestCount": 1250,
      "owner": {
        "id": "user_abc123",
        "email": "[email protected]",
        "name": "Admin User",
        "platformRole": "admin",
        "orgRole": null,
        "organizationId": null
      }
    }
  ]
}
FieldTypeDescription
idstringKey ID.
namestring | nullLabel set at creation.
startstringFirst characters of the key, for display.
enabledbooleanWhether the key is active.
lastRequeststring | nullISO 8601 timestamp of last use.
expiresAtstring | nullISO 8601 expiry.
requestCountintegerLifetime request count.
ownerobjectThe user the key acts as.

Status codes

StatusMeaning
200Success.
401No valid API key.
403Caller is not an admin.
429Rate limited.