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/whoami
API key

Any 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"]
}
FieldTypeDescription
tenant_iduuidThe tenant the key belongs to.
actor_typestringAlways "api_key" on this endpoint.
actor_iduuidThe API key's id. It appears as actor_id in audit logs for actions taken with this key.
scopesstring[]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

CodeStatusWhen
missing_authorization401No Authorization header.
malformed_authorization401Header is not Bearer <key>.
invalid_api_key401Unknown or malformed key.
revoked_api_key401The key was revoked.
whoami · API · poolse docs