---
title: "Webhook logs metrics"
method: POST
path: "/api/webhook-logs/metrics"
tags: ["webhook_logs"]
---

# Webhook logs metrics

`POST /api/webhook-logs/metrics`

## Request

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

Period-bound delivery health: success_rate, failure_rate, p50 / p95 / p99 latency, total_retries, last_success_at and last_failure_at. The rates count terminal rows only (a delivery still on its ladder is in counts.groups.status.retrying, not here); a period with nothing terminal reads null. period {from, to} is required; filter is the search filter (created_at inside it is ignored, period is the window); group_by splits by status, event_type, response_code, webhook_sid or account_sid.

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

## Request body

- GetWebhookLogsMetricsRequest: Request body of `get_webhook_logs_metrics`.
  - `filter` object: Scopes the rows the metrics are computed over: the search filter operators. Omit for all rows.
    - `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
  - `period` object, required: Required metrics window.
    - `from` string, required: ISO 8601 UTC window start (inclusive).
    - `to` string, required: ISO 8601 UTC window end (exclusive).
  - `group_by` 'status' | 'event_type' | 'response_code' | 'webhook_sid' | 'account_sid': One split axis; omit for one total.

## Response `200`

`metrics` success envelope.

- GetWebhookLogsMetricsResponse
  - `success` true, required
  - `operation` 'metrics', required
  - `metrics` object, required
    - `filter` object
    - `period` object
      - `from` string, required
      - `to` string, required
    - `aggregated` object
      - `counts` object
      - `metrics` object
        - `success_rate` number, nullable, required: 0..1 over the terminal rows; null when none.
        - `failure_rate` number, nullable, required: 0..1, the mirror of success_rate.
        - `avg_duration_ms` number, nullable, required: Mean over timed rows.
        - `p50_duration_ms` number, nullable, required: Median latency over terminal rows.
        - `p95_duration_ms` number, nullable, required: 95th percentile.
        - `p99_duration_ms` number, nullable, required: 99th percentile.
        - `total_retries` number, required: Sum of retry_count over the set.
        - `last_success_at` string, nullable, required: The latest successful delivery in the window.
        - `last_failure_at` string, nullable, required: The latest failed delivery in the window.
    - `metrics` object
      - `success_rate` number, nullable, required: 0..1 over the terminal rows; null when none.
      - `failure_rate` number, nullable, required: 0..1, the mirror of success_rate.
      - `avg_duration_ms` number, nullable, required: Mean over timed rows.
      - `p50_duration_ms` number, nullable, required: Median latency over terminal rows.
      - `p95_duration_ms` number, nullable, required: 95th percentile.
      - `p99_duration_ms` number, nullable, required: 99th percentile.
      - `total_retries` number, required: Sum of retry_count over the set.
      - `last_success_at` string, nullable, required: The latest successful delivery in the window.
      - `last_failure_at` string, nullable, required: The latest failed delivery in the window.
  - `applied_filters` object
  - `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.

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