Get logs that match the given query with pagination.
Pagination on large result sets
For tenants with very large log volumes, the default exact count(*) may exceed Postgres statement_timeout. Pass enableCap=true to short-circuit the count query: any tenant with more than 10,000 matching logs saturates Total-Number at the sentinel value 10001 and the response includes Total-Number-Is-Capped: true. In capped responses the Link header omits rel="last" and rel="next"; walk forward by incrementing page and stop on an empty response.
Query parameters
-
Filter logs by user ID.
-
Filter logs by application ID.
-
Filter logs by log key.
-
When
true, short-circuits the underlyingcount(*)query: any tenant with more than 10,000 matching logs saturatesTotal-Numberat the sentinel value10001and the response emitsTotal-Number-Is-Capped: true. TheLinkheader then omitsrel="last"andrel="next"because the real total is unknown. Defaultfalse; recommendedtruefor any client whose tenant volume may exceed 10,000 matching logs to avoidstatement_timeout. -
Exclusive lower bound on
createdAt, in unix milliseconds. When set, returns only logs wherecreatedAt > start_time. Recommended for clients paginating across very large log ranges to keep query latency consistent. -
Exclusive upper bound on
createdAt, in unix milliseconds. When set, returns only logs wherecreatedAt < end_time. Returns400ifstart_time >= end_timewhen both are present. -
Page number (starts from 1).
Minimum value is
1. Default value is1. -
Entries per page.
Minimum value is
1. Default value is20.
curl \
--request GET 'https://[tenant_id].logto.app/api/logs' \
--header "Authorization: Bearer $ACCESS_TOKEN"
# Headers
Total-Number: 42
Total-Number-Is-Capped: true
Link: string
# Payload
[
{
"tenantId": "string",
"id": "string",
"key": "string",
"payload": {
"key": "string",
"result": "Success",
"error": {},
"ip": "string",
"userAgent": "string",
"userAgentParsed": {
"ua": "string",
"browser": {
"name": "string",
"version": "string",
"major": "string",
"type": "string"
},
"device": {
"model": "string",
"type": "string",
"vendor": "string"
},
"engine": {
"name": "string",
"version": "string"
},
"os": {
"name": "string",
"version": "string"
},
"cpu": {
"architecture": "string"
}
},
"userId": "string",
"applicationId": "string",
"sessionId": "string",
"params": {}
},
"createdAt": 42.0
}
]