---
title: "Test webhook"
method: POST
path: "/api/webhooks/{sid}/test"
tags: ["webhooks"]
---

# Test webhook

`POST /api/webhooks/{sid}/test`

## Request

- Base URL: `https://beta.getsales.io/integrations/v1`
- URL: `https://beta.getsales.io/integrations/v1/api/webhooks/{sid}/test`
- Auth: HTTP bearer and API key in header `Team-SID`

POST one signed synthetic envelope (type webhooks.test, or override_event_type) to the endpoint now and answer what came back: http_status, duration_ms, error_kind (none, http_error, network). Verifies the endpoint and its signature check without waiting for a real event; writes no log row, moves no counter, fires no event. Allowed on a failed webhook (the revival check), refused on one switched off (409). Throttled 10 a minute per webhook.

Contract:
- MCP tool `test_webhook`, registry package `mcp.integrations/webhooks`, mount `integrations.webhooks`.
- Operation `action`, response envelope `action`.
- Flags: none.

## Path parameters

- `sid` string, required: Webhook sid (wh_hk_...).

## Request body

- TestWebhookRequest: Request body of `test_webhook`.
  - `override_event_type` string: Send the envelope under this event type instead of webhooks.test.

## Response `200`

`action` success envelope.

- TestWebhookResponse
  - `success` true, required
  - `operation` 'action', required
  - `action` string, required: kebab-case verb; matches the route segment.
  - `item` object, nullable, required
    - `sid` string, required: Webhook sid (wh_hk_...).
    - `team_sid` string, required: The subscribing workspace (ts_tm_...).
    - `name` string, required: Free text, 1..255 chars.
    - `target_url` string, required: The https endpoint events are POSTed to; one subscription per team per URL.
    - `events` string[], required: The subscribed event types (WebhookEventTypeEnum values), exact membership.
    - `filters` object, nullable, required: The narrowing by sending identity; null or {} = every subscribed event.
      - `account_sid` string, nullable: Deliver only the events of this sending identity (18 chars, e.g. a sender profile ub_sp_...); null = no narrowing.
    - `secret` string, nullable: The 32-hex HMAC secret: in the create response only, null on every other read.
    - `status` 'on' | 'off' | 'failed', required: on; off (switched off by hand); failed (20 failed deliveries in a row or one 410: revive with update status on).
    - `consecutive_failed_attempts` integer, required: Failed deliveries in a row, driven by the log; 20 trips the auto-disable.
    - `last_failure_at` string, nullable, required: ISO 8601 UTC of the most recent failed delivery.
    - `created_by` object, required: Who subscribed.
      - `actor_type` 'user' | 'support' | 'api_key' | 'system' | 'agent', required
      - `actor_sid` string, nullable, required
      - `team_sid` string, required
      - `actor_name` string, nullable: The OAuth client that acted ("Claude", "n8n"); null for a user, an API key or a system job.
      - `oauth_client_sid` string, nullable: The acting OAuth client (id_oc_*); null off the OAuth path.
      - `reason` string, nullable: Why a system actor wrote the row (snapshot_capture_job, ...); null otherwise.
      - `permissions` object, required: Internal audit context: the grant set the actor held at write time. Not a contract.
      - `cluster_id` integer, nullable: Internal audit context: the cluster that served the write.
      - `trace_id` string, nullable: Internal audit context: the trace id of the request that wrote the row.
    - `deleted_by` object, nullable, required: Who deleted it; null while live.
      - `actor_type` 'user' | 'support' | 'api_key' | 'system' | 'agent', required
      - `actor_sid` string, nullable, required
      - `team_sid` string, required
      - `actor_name` string, nullable: The OAuth client that acted ("Claude", "n8n"); null for a user, an API key or a system job.
      - `oauth_client_sid` string, nullable: The acting OAuth client (id_oc_*); null off the OAuth path.
      - `reason` string, nullable: Why a system actor wrote the row (snapshot_capture_job, ...); null otherwise.
      - `permissions` object, required: Internal audit context: the grant set the actor held at write time. Not a contract.
      - `cluster_id` integer, nullable: Internal audit context: the cluster that served the write.
      - `trace_id` string, nullable: Internal audit context: the trace id of the request that wrote the row.
    - `created_at` string, required: ISO 8601 UTC.
    - `updated_at` string, required: ISO 8601 UTC.
    - `deleted_at` string, nullable, required: ISO 8601 UTC; null = live.
  - `result` object, required
    - `http_status` integer, nullable, required: The receiver's status; null when no answer came back.
    - `response_body` string, nullable, required: Not captured today (null).
    - `duration_ms` integer, required: Wall clock of the attempt.
    - `error_kind` string, required: none (2xx or 3xx), http_error (400 and up), network (no answer: refused, timed out, dropped).
    - `error_message` string, nullable, required: Not captured today (null).
  - `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)
