Skip to main content

List API Keys

Retrieve all API keys for the current organization. Note that the actual key secrets are never returned after initial creation.

Request

GET /api-keys

Authentication

Requires an Admin Bearer JWT token.

Authorization: Bearer <access_token>

Query Parameters

None.

Response

Returns an array of API key objects.

Success Response

Status Code: 200 OK

Response Body:

[
{
"id": "550e8400-e29b-41d4-a716-446655440000",
"name": "CI/CD Pipeline Key",
"description": "API key for automated deployments",
"keyPrefix": "egk_live_abc123",
"scopes": ["sessions:read", "sessions:write"],
"isRevoked": false,
"revokedAt": null,
"expiresAt": "2026-12-31T23:59:59Z",
"lastUsedAt": "2026-02-15T10:30:00Z",
"lastUsedIp": "203.0.113.42",
"createdByEmail": "[email protected]",
"createdAt": "2026-01-01T00:00:00Z"
}
]

Response Fields

FieldTypeDescription
idUUIDUnique identifier for the API key
namestringHuman-readable name for the key
descriptionstringOptional description
keyPrefixstringFirst few characters of the key for identification
scopesstring[]Array of permission scopes granted to this key
isRevokedbooleanWhether the key has been revoked
revokedAtstringISO timestamp of revocation (null if not revoked)
expiresAtstringISO timestamp when key expires (null if no expiration)
lastUsedAtstringISO timestamp of last usage (null if never used)
lastUsedIpstringIP address of last usage (null if never used)
createdByEmailstringEmail of the user who created the key
createdAtstringISO timestamp of creation

Errors

Status CodeError CodeDescription
401UNAUTHORIZEDMissing or invalid JWT token
403FORBIDDENUser does not have admin privileges

Example

Request

curl -X GET https://api.entryguard.io/api/v1/api-keys \
-H "Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..."

Response

[
{
"id": "550e8400-e29b-41d4-a716-446655440000",
"name": "CI/CD Pipeline Key",
"description": "API key for automated deployments",
"keyPrefix": "egk_live_abc123",
"scopes": ["sessions:read", "sessions:write"],
"isRevoked": false,
"revokedAt": null,
"expiresAt": "2026-12-31T23:59:59Z",
"lastUsedAt": "2026-02-15T10:30:00Z",
"lastUsedIp": "203.0.113.42",
"createdByEmail": "[email protected]",
"createdAt": "2026-01-01T00:00:00Z"
},
{
"id": "660e8400-e29b-41d4-a716-446655440001",
"name": "Monitoring Service",
"description": "Read-only key for monitoring dashboard",
"keyPrefix": "egk_live_def456",
"scopes": ["sessions:read", "resources:read", "audit:read"],
"isRevoked": false,
"revokedAt": null,
"expiresAt": null,
"lastUsedAt": null,
"lastUsedIp": null,
"createdByEmail": "[email protected]",
"createdAt": "2026-02-01T12:00:00Z"
}
]