whoami
Returns who the presented API key is. Use it to check, at startup or after a key rotation, that a service holds the right key for the right tenant with the scopes it needs.
GET
/v1/whoamiAny valid API key works. No scope is needed. There are no parameters.
Response
200:
{
"tenant_id": "65787825-3152-4c1e-9b8a-0d6f4e2a7c11",
"actor_type": "api_key",
"actor_id": "8a7e2f9c-1234-4d5e-8f90-a1b2c3d4e5f6",
"scopes": ["users:manage", "webhooks:admin"]
}
| Field | Type | Description |
|---|---|---|
tenant_id | uuid | The tenant the key belongs to. |
actor_type | string | Always "api_key" on this endpoint. |
actor_id | uuid | The API key's id. It appears as actor_id in audit logs for actions taken with this key. |
scopes | string[] | The key's scopes. See Authentication. |
The key's name, prefix and timestamps are not returned. See them in the dashboard.
curl https://api.poolse.dev/v1/whoami \
-H "Authorization: Bearer $POOLSE_API_KEY"
Errors
| Code | Status | When |
|---|---|---|
missing_authorization | 401 | No Authorization header. |
malformed_authorization | 401 | Header is not Bearer <key>. |
invalid_api_key | 401 | Unknown or malformed key. |
revoked_api_key | 401 | The key was revoked. |