---
title: "Search webhook logs"
method: POST
path: "/api/webhook-logs/search"
tags: ["webhook_logs"]
---

# Search webhook logs

`POST /api/webhook-logs/search`

## Request

- Base URL: `https://beta.getsales.io/integrations/v1`
- URL: `https://beta.getsales.io/integrations/v1/api/webhook-logs/search`
- Auth: HTTP bearer and API key in header `Team-SID`

The deliveries of the team's webhooks, one row per event per subscription, from every producing service: per webhook, per sending identity, per event type, per status or response code; include webhook. The auditing and outage-debugging read (why did the integrator not get the event). Period-bound success rates are get_webhook_logs_metrics. page_size 0 returns the counts only.

Contract:
- MCP tool `search_webhook_logs`, registry package `mcp.integrations/webhook_logs`, mount `integrations.webhooks`.
- Operation `search`, response envelope `search`.
- Flags: read only.

## Request body

- SearchWebhookLogsRequest: Request body of `search_webhook_logs`.
  - `filter` object: Field filters, ANDed: {field: {eq | ne | in | nin | gte | lte | gt | lt | is_null}}; q inside it is free text. Omit for every row.
    - `sid` object: Delivery sid(s).
      - `eq` string
      - `in` string[]
    - `webhook_sid` object: One subscription's deliveries.
      - `eq` string
      - `in` string[]
    - `account_sid` object: One sending identity; is_null true = team-wide events.
      - `eq` string
      - `in` string[]
      - `is_null` boolean
    - `source_service` object: playtables | unibox | signals | integrations.
      - `eq` string
      - `in` string[]
    - `event_type` object: The event type.
      - `eq` string
      - `ne` string
      - `in` string[]
      - `nin` string[]
    - `event_source_sid` object: The row that produced the event.
      - `eq` string
      - `in` string[]
    - `status` object: in [pending, retrying] = still in flight.
      - `eq` 'pending' | 'in_progress' | 'retrying' | 'success' | 'failed' | 'cancelled'
      - `ne` 'pending' | 'in_progress' | 'retrying' | 'success' | 'failed' | 'cancelled'
      - `in` string[]
      - `nin` string[]
    - `cancel_reason` object: Why a row was cancelled.
      - `eq` 'manual' | 'webhook_deleted' | 'webhook_disabled' | 'webhook_failed'
      - `in` string[]
      - `is_null` boolean
    - `retry_count` object: Executed attempts.
      - `eq` number
      - `ne` number
      - `gte` number
      - `lte` number
      - `gt` number
      - `lt` number
    - `response_code` object: is_null true = no HTTP answer (network, timeout).
      - `eq` number
      - `ne` number
      - `gte` number
      - `lte` number
      - `gt` number
      - `lt` number
      - `is_null` boolean
    - `duration_ms` object: The last attempt's latency.
      - `eq` number
      - `ne` number
      - `gte` number
      - `lte` number
      - `gt` number
      - `lt` number
      - `is_null` boolean
    - `scheduled_at` object: ISO 8601 bounds.
      - `gte` string
      - `lte` string
      - `gt` string
      - `lt` string
    - `executed_at` object: ISO 8601 bounds; is_null true = never attempted.
      - `gte` string
      - `lte` string
      - `gt` string
      - `lt` string
      - `is_null` boolean
    - `created_at` object: ISO 8601 bounds.
      - `gte` string
      - `lte` string
      - `gt` string
      - `lt` string
  - `include` string[]: Relations to attach to every item; omit for the bare rows.
  - `sort` object: One column and its direction; omit for the default order.
    - `field` 'created_at' | 'scheduled_at' | 'executed_at' | 'duration_ms', required: The column to order by.
    - `direction` 'asc' | 'desc': asc or desc; default desc.
  - `page_size` integer: 0..500, default 50; 0 = counts only, 1 = the first row.
  - `cursor` string, nullable: pagination.next_cursor of the previous page.

## Response `200`

`search` success envelope.

- SearchWebhookLogsResponse
  - `success` true, required
  - `operation` 'search', required
  - `items` object[], required
    - `item` object, required
      - `sid` string, required: Delivery sid (wh_lg_...).
      - `team_sid` string, required: The subscribing workspace (ts_tm_...).
      - `webhook_sid` string, required: The parent subscription (wh_hk_...).
      - `account_sid` string, nullable, required: The sending identity the subscription matched on (ub_sp_...); null on a team-wide event.
      - `source_service` string, nullable, required: Which service produced the event (playtables, unibox, signals, integrations); observability only.
      - `event_type` string, required: The event type (a WebhookEventTypeEnum value).
      - `event_source_sid` string, nullable, required: The row whose state change produced the event; null when none.
      - `status` 'pending' | 'in_progress' | 'retrying' | 'success' | 'failed' | 'cancelled', required: pending or retrying = waiting for the tick; in_progress = leased by a worker; success; failed (the ladder ran out, or a 4xx); cancelled.
      - `retry_count` integer, required: Executed attempts; a manual re-arm does not move it.
      - `cancel_reason` 'manual' | 'webhook_deleted' | 'webhook_disabled' | 'webhook_failed', nullable, required: manual, or the cascade of a deleted, disabled or failed webhook; null unless cancelled.
      - `request_method` 'POST', required: POST.
      - `request_url` string, required: The target URL at insert: a retry replays it.
      - `request_headers` object, required: The X-Webhook-* and X-Trace-Id headers as sent.
      - `request_payload` object, required: The stored envelope.
        - `webhook_log_sid` string, required: This row's own sid: the receiver's dedup key.
        - `type` string, required: The event type (a WebhookEventTypeEnum value).
        - `emitted_at` string, required: ISO 8601 UTC of the state change.
        - `team_sid` string, required: The workspace (ts_tm_...).
        - `trace_id` string, required: The trace of the write that produced the event.
        - `payload` object, required: The event-specific payload.
      - `response_code` integer, nullable, required: The receiver's status; null on a network error.
      - `error_message` string, nullable, required: The last attempt's error.
      - `duration_ms` integer, nullable, required: The last attempt's wall clock; null before one ran.
      - `scheduled_at` string, required: ISO 8601 UTC when the next (or last) attempt is due.
      - `executed_at` string, nullable, required: ISO 8601 UTC of the last attempt; null before one ran.
      - `created_at` string, required: ISO 8601 UTC.
      - `updated_at` string, required: ISO 8601 UTC.
    - `included` object, required
      - `webhook` object: The parent subscription (WebhookDomain, secret masked).
  - `pagination` object, required
    - `next_cursor` string, nullable, required
    - `has_more` boolean, required
    - `total_count` integer, nullable, required
  - `applied_filters` object, required
  - `includes` string[], required
  - `meta` object, required
    - `trace_id` string, required: UUID v7; same 128-bit value as the X-Trace-Id header.
    - `span_id` string, required: 16 hex chars, root span of this request.
    - `timestamp` string, required: ISO 8601 UTC (Y-m-dTH:i:sZ), response time.
    - `duration_ms` integer, required: Server-side wall clock.
    - `team_sid` string, nullable: The team this call ran in (the token team, or the team_sid override). Null when unauthenticated; absent from pre-2026-08-20 backends.
    - `actor_type` string, nullable: user | agent | api_key | system. Null when unauthenticated; absent from pre-2026-08-20 backends.
  - `counts` object
    - `total_count` number, required: Deliveries matching the filter.
    - `groups` object, required: status, event_type, response_code, webhook_sid, account_sid: the count per value.

## Other responses

- `4XX`: MCP error envelope. `error.code` is one of validation_failed, nothing_to_update, not_found, relation_not_found, invalid_transition, limit_exceeded, payment_required, duplicate_rejected, conflict, delete_blocked, unauthorized, forbidden, rate_limited, not_implemented.
- `5XX`: MCP error envelope with `error.code` internal_error or service_unavailable.

---

[API](https://skmtc.dev/getsales/apis/getsales-public-contract-gs-service-integrations.md) - [All operations](https://skmtc.dev/getsales/apis/getsales-public-contract-gs-service-integrations/llms.txt) - [OpenAPI document](https://skmtc.dev/getsales/apis/getsales-public-contract-gs-service-integrations/revisions/2e7105d58335?raw)
