List API keys in tenant
List API keys within your tenant. Visibility depends on your permission:
with api-keys:manage applying to this tenant you see every key in it;
otherwise you see only your own keys.
Supports pagination, sorting, searching, and filtering.
Searchable fields: name, userEmail, userName Filterable fields: userId, enabled, roleId Sortable fields: createdAt, name, expiresAt, lastUsedAt, enabled, userName, userEmail
Query Parameters
- Type: integerpagemin:1
Page number (1-indexed, default: 1)
- Type: integerlimitmin:1max:100
Items per page (max varies by endpoint; default max 100)
- Type: stringsort
Sort field and direction (e.g., "createdAt:desc", "name:asc"). Supports comma-separated values for multi-column sorting.
- Type: stringsearch
Search term to filter results across relevant text fields
- Type: stringFormat: uuiduser
Id Filter by user ID. The filter intersects with your visibility scope: without
api-keys:manage, filtering another user returns an empty page (total: 0), not an error. - Type: true or falseenumenabled
Filter by enabled status. Accepts the strings
trueorfalse. - Type: stringrole
Id Filter by role ID, or the literal
nullto match keys that inherit the user's roles (no scoped role).
Responses
- application/json
- application/json
- application/json
- application/json
curl 'https://api.gpcn.com/v1/auth/api-keys?page=1&sort=createdAt%3Adesc&enabled=true' \
--header 'X-API-Key: YOUR_SECRET_TOKEN'
{
"success": true,
"data": [
{
"id": "string",
"name": "string",
"prefix": "string",
"start": "string",
"enabled": true,
"createdAt": "2026-10-21T16:19:07.205Z",
"expiresAt": "2026-10-21T16:19:07.205Z",
"lastUsedAt": "2026-10-21T16:19:07.205Z",
"roleId": "123e4567-e89b-12d3-a456-426614174000",
"isInherited": true,
"roles": [
{
"id": "123e4567-e89b-12d3-a456-426614174000",
"name": "string",
"displayName": "string",
"sortOrder": 1
}
],
"entityId": "123e4567-e89b-12d3-a456-426614174000",
"rateLimitEnabled": true,
"rateLimitMax": 1,
"rateLimitWindow": 1,
"userId": "123e4567-e89b-12d3-a456-426614174000",
"userName": "string",
"userEmail": "hello@example.com"
}
],
"meta": {
"total": 1,
"page": 1,
"pageSize": 1,
"totalPages": 1,
"hasNextPage": true,
"hasPreviousPage": true
}
}.png)