---
title: "Search log events with filters"
method: POST
path: "/log_search"
tags: ["Log Search"]
---

# Search log events with filters

`POST /log_search`

Search log events with the same project-scoped data and filter catalog used by the logs UI.

## Request body

- LogSearchRequest
  - `query` string
  - `period` '24h' | '7d' | 'context'
  - `source` 'all' | 'external_api_log' | 'whatsapp_webhook_event' | 'flow_event' | 'webhook_delivery'
  - `problems_only` boolean
  - `errors_only` boolean — Alias for problems_only.
  - `limit` integer
  - `cursor` string — Cursor returned as pagination.next_cursor from a previous response.
  - `around` string, date-time — Center a context search around this timestamp. Use with period=context.
  - `highlight_event_id` string — Include this event in the page when available.
  - `highlight_resource_id` string — Include an event for this resource in the page when available.
  - `filters` union
    - object
    - LogSearchFilterEntry[]
      - `key` string, required
      - `value` union, required
        - string
        - integer
        - number
        - boolean

## Response `200`

Success

- LogSearchResponse
  - `data` object, required
    - `available` boolean, required
    - `source` union
      - string
      - string[]
    - `window` LogSearchWindow
      - `since` string, date-time
      - `until` string, date-time
    - `events` LogSearchEvent[], required
      - `id` string, required — Indexed log event ID
      - `source` 'external_api_log' | 'whatsapp_webhook_event' | 'flow_event' | 'webhook_delivery', required
      - `timestamp` string, date-time, nullable
      - `occurred_at` string, date-time, nullable
      - `ingested_at` string, date-time, nullable
      - `level` string, nullable
      - `status` string, nullable
      - `message` string, nullable
      - `resource_type` string, nullable
      - `resource_id` string, nullable
      - `http_method` string, nullable
      - `endpoint` string, nullable
      - `api_key_id` string, nullable
      - `api_key_name` string, nullable
      - `response_status` integer, nullable
      - `response_time_ms` number, nullable
      - `event_type` string, nullable
      - `field` string, nullable
      - `event` string, nullable
      - `message_type` string, nullable
      - `phone_number_id` string, nullable
      - `display_phone_number` string, nullable
      - `flow_name` string, nullable
      - `flow_id` string, nullable
      - `flow_execution_id` string, nullable
      - `flow_event_id` string, nullable
      - `step_identifier` string, nullable
      - `step_type` string, nullable
      - `webhook_id` string, nullable
      - `webhook_url` string, nullable
      - `error_class` string, nullable
      - `error_message` string, nullable
      - `attributes` object, nullable
      - `payload` object, nullable
    - `pagination` LogSearchPagination
      - `has_more` boolean
      - `next_cursor` string, nullable
    - `error` string, nullable
    - `code` string, nullable

## Other responses

- `401` — Missing or invalid API key
- `422` — Invalid filters or search failure

---

[API](https://skmtc.net/kapso/apis/kapso-platform-api.md) · [All operations](https://skmtc.net/kapso/apis/kapso-platform-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/kapso/kapso-platform-api/revisions/18ff5548a33f/schema)
