---
title: "Get recent logs for a hook"
method: GET
path: "/api/hooks/{id}/recent-logs"
tags: ["Hooks"]
---

# 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.

## Path parameters

- `id` string, required

## Query parameters

- `logKey` string
- `enableCap` string
- `start_time` string
- `end_time` string
- `page` integer
- `page_size` integer

## Response `200`

A list of recent logs for the hook.

- object[]
  - `id` string, required
  - `key` string, required
  - `payload` object, required
    - `key` string, required
    - `result` 'Success' | 'Error', required
    - `error` union
      - object
      - string
    - `ip` string
    - `userAgent` string
    - `userAgentParsed` object
      - `ua` string
      - `browser` object
        - `name` string
        - `version` string
        - `major` string
        - `type` string
      - `device` object
        - `model` string
        - `type` string
        - `vendor` string
      - `engine` object
        - `name` string
        - `version` string
      - `os` object
        - `name` string
        - `version` string
      - `cpu` object
        - `architecture` string
    - `userId` string
    - `applicationId` string
    - `sessionId` string
    - `params` object
  - `createdAt` number, required

## Other responses

- `400` — Returned when `start_time` or `end_time` is not a finite number, or when `start_time > end_time`.
- `401` — Unauthorized
- `403` — Forbidden

---

[API](https://skmtc.net/logto/apis/logto-api-references.md) · [All operations](https://skmtc.net/logto/apis/logto-api-references/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/logto/logto-api-references/versions/a163dc77d842/schema)
