---
title: "Retry webhook delivery"
method: POST
path: "/api/webhook-logs/{sid}/retry"
tags: ["webhook_logs"]
---

# Retry webhook delivery

`POST /api/webhook-logs/{sid}/retry`

## Request

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

Re-arm one delivery by hand: status back to pending, scheduled_at now, cancel_reason cleared; retry_count stays (it counts executed attempts) and the original envelope goes to the original URL. Refused on an in_progress row (409: cancel or wait), on a cancelled one (that was a decision), and while the parent is deleted or off (422). expected_status is a compare-and-set guard: 409 invalid_transition when the row moved since it was read. Re-delivers to the integrator.

Contract:
- MCP tool `retry_webhook_log`, registry package `mcp.integrations/webhook_logs`, mount `integrations.webhooks`.
- Operation `action`, response envelope `action`.
- Flags: dangerous: the MCP layer gates it behind a preview/commit token, and the effect cannot be undone through this API.

## Path parameters

- `sid` string, required: Webhook log (delivery) sid (wh_lg_...).

## Request body

- RetryWebhookLogRequest: Request body of `retry_webhook_log`.
  - `expected_status` 'pending' | 'in_progress' | 'retrying' | 'success' | 'failed' | 'cancelled': Optional guard: the retry only runs when the row still has this status.

## Response `200`

`action` success envelope.

- RetryWebhookLogResponse
  - `success` true, required
  - `operation` 'action', required
  - `action` string, required: kebab-case verb; matches the route segment.
  - `item` object, nullable, 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.
  - `result` object, required
    - `previous_status` 'pending' | 'in_progress' | 'retrying' | 'success' | 'failed' | 'cancelled', required: The status before the re-arm.
    - `scheduled_at` string, required: ISO 8601 UTC when the attempt is due (now).
    - `retry_count` integer, required: Attempts executed so far; unchanged by the re-arm.
  - `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)
