# Get recent logs for a hook **GET /api/hooks/{id}/recent-logs** Get recent logs that match the given query for the specified hook with pagination. See `GET /api/logs` for details on the `enableCap` parameter and capped-response headers. ## Servers - Logto endpoint address.: https://[tenant_id].logto.app (Logto endpoint address.) ## Authentication methods - O auth2 ## Parameters ### Path parameters - **id** (string) The unique identifier of the hook. ### Query parameters - **logKey** (string) The log key to filter logs. - **enableCap** (string) When `true`, short-circuits the underlying `count(*)` query: results with more than 10,000 matching logs saturate `Total-Number` at the sentinel `10001` and emit `Total-Number-Is-Capped: true`; the `Link` header omits `rel="last"` and `rel="next"`. Default `false`. (This endpoint is already scoped to a single hook over the last 24 hours, so the cap rarely triggers in practice.) - **start_time** (string) Inclusive lower bound on `createdAt`, in unix milliseconds. Supplying either `start_time` or `end_time` replaces the endpoint's default 24-hour lower bound, so callers can query an arbitrary historical window. Returns `400` if `start_time > end_time` when both are present. - **end_time** (string) Inclusive upper bound on `createdAt`, in unix milliseconds. Supplying either `start_time` or `end_time` replaces the endpoint's default 24-hour lower bound. - **page** (integer) Page number (starts from 1). - **page_size** (integer) Entries per page. ## Responses ### 200 A list of recent logs for the hook. #### Headers - **Total-Number** (integer) When `enableCap=false`: exact match count. When `enableCap=true`: either the exact count (≤ 10,000) or the saturation sentinel `10001`. - **Total-Number-Is-Capped** (string) Present and set to `true` only when `enableCap=true` and the result has more than 10,000 matching logs (in which case `Total-Number` is `10001`). - **Link** (string) Pagination links per RFC 5988. When the response is capped, `rel="last"` and `rel="next"` are omitted; walk forward by incrementing `page` and stop on an empty response. #### Body: application/json (array[object]) - **id** (string) - **key** (string) - **payload** (object) - **createdAt** (number) ### 400 Returned when `start_time` or `end_time` is not a finite number, or when `start_time > end_time`. ### 401 Unauthorized ### 403 Forbidden [Powered by Bump.sh](https://bump.sh)