API keys

List API keys

Returns a page of every API key in the company, whoever issued it, so an administrator can see what exists. A key's secret is never included. Requires the api_keys:read permission.

GET
https://auth.magicdoor.com/company-portal/api-keys

Authorization

Authorizationstringrequired
Bearer token — Send your API token in the Authorization header as Bearer <token>. Requests without a valid token are rejected with 401 Unauthorized.

Query parameters

pageinteger

Which page to return, starting at 1.

default: 1example: 1
pageSizeinteger

How many keys to return per page. Between 1 and 100.

default: 50example: 50
userIdstring

Return only the keys issued by this user, as a Snowflake id in decimal-string form. Leave it out to list every key in the company.

example: 1824903117441335296
revokedboolean

true returns only revoked keys, false only keys that are still live. Leave it out to get both.

example: false

Response

200 · A page of API keys

itemsApiKey[]

The keys on this page.

totalCountinteger

How many keys match across every page.

totalPagesinteger

How many pages the matching keys fill at this page size.

pageinteger

The page that was returned.

pageSizeinteger

How many keys were asked for per page.

400 · `page` was below 1, or `pageSize` was outside 1 to 100

401 · The access token is missing, expired, or invalid

403 · The caller does not hold the `api_keys:read` permission

The second key in the example above is unscoped — it has no permissions field at all, so it carries whatever its user can do at the moment it is exchanged. It is also revoked, so exchanging it now fails.