> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.rasen.ai/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.rasen.ai/_mcp/server.

# Resend a delivery

POST https://api.rasen.ai/v1/webhook-deliveries/{delivery_id}/resend

Sends a succeeded or failed delivery again with the same webhook-id and the same body bytes. One conditional update moves it back to pending, increments chain_no and starts a new schedule of 8 attempts; attempt_count restarts at 0. A concurrent second resend finds no finished delivery and is refused with delivery_in_progress. Refusals are conflict with one reason, tested in this order: endpoint_deleted, event_expired, delivery_cancelled, delivery_in_progress, endpoint_disabled, event_unsubscribed. A webhook.test delivery is never event_unsubscribed. A foreign or unknown delivery answers 404 not_found. In a suspended workspace the answer is workspace_unavailable. A replay returns the original answer. Idempotency fingerprint: method and path.

Reference: https://docs.rasen.ai/enterprise/api-reference/webhooks/resend-delivery

## Authentication

- `Authorization` header (bearer token, required) — An organisation-owned key whose secret starts ra_org_. The Owner or an Admin of an organisation that Rasen has invited makes it in the app; no API operation makes, changes, rotates or revokes a key. On a workspace operation send the workspace ID in the Rasen-Workspace header; without it the answer is 400 invalid_request with details.field Rasen-Workspace. A workspace outside the organisation or outside the key's workspace list is 404 not_found. An organisation that is not invited gets 403 organisation_api_not_enabled.

## Request

### Path parameters

- `delivery_id` (string, required) — Delivery identity within the authenticated workspace.

### Headers

- `Idempotency-Key` (string, required) — Stable key per logical intent, 1–255 printable characters. Persist it before sending. Retry the same key/body after an uncertain result for 24 hours. A changed body conflicts. Beyond retention, reconcile the resource before retrying; this is not permanent deduplication. Current authorization is rechecked on replay. Evaluation order: authenticate and check current authorization; look up intent; replay its stored receipt before checking the current revision; only a new intent evaluates If-Match and executes. Fingerprint includes method, path, body and original If-Match. A changed request returns idempotency_key_reused. The server stores only a keyed (HMAC) fingerprint, and no error or response ever returns a fingerprint or hash of a request. In-flight intent returns 409 idempotency_in_progress with Retry-After; retry the same intent after reconciliation. Receipts describe that attempt, not current resource state. A replay returns the original status code and body, with the response header Idempotent-Replayed: true.
- `Rasen-Workspace` (string, required) — The ID of the workspace that this operation acts in. It must be a workspace of the key's organisation and in the key's workspace list. A missing, empty or malformed value is 400 invalid_request with details.field Rasen-Workspace; a workspace outside the organisation or the key's workspace list is the hidden 404 not_found.

## Response

### 200

The delivery, now pending, with its new chain_no.

- `id` (string, required) — Opaque delivery identifier (prefix wdl_).
- `endpoint_id` (string, required)
- `event_id` (string, required) — The event id; equal to the webhook-id header of every attempt (prefix wevt_).
- `event_type` (string, required)
- `event_created_at` (datetime, required)
- `call_id` (string, required, nullable) — The call of a call event; null for webhook.test.
- `state` (string, required) — Projected state. Stored states are pending, delivering, retrying, succeeded, failed and cancelled. held is a pending or retrying delivery whose endpoint is disabled; it makes no attempt until the endpoint is enabled. failed means all 8 attempts of the current chain failed; resend is possible for 30 days. Open response vocabulary.
- `cancel_reason` (string, required, nullable) — Why a cancelled delivery was cancelled; null for every other state.
- `chain_no` (integer, required) — 1 for the first delivery; each resend adds 1.
- `attempt_count` (integer, required) — Finished attempts in the current chain, a lost attempt included.
- `max_attempts` (integer, required) — Attempts in one chain. 8 in this version.
- `last_attempt_at` (datetime, required, nullable)
- `last_status_code` (integer, required, nullable) — HTTP status of the last finished attempt; null when it got no status line.
- `last_error_class` (string, required, nullable) — Class of the last failed attempt; null after a success or before the first attempt. http_status: a status that is not 2xx (a 3xx included, because redirects are not followed). connection: among others, a status line and headers longer than 16 KiB. lost: the sender stopped during the attempt and the attempt was counted. The response body is never read, stored or returned.
- `next_attempt_at` (datetime, required, nullable) — When the next attempt is due, for pending and retrying deliveries only; null for every other state, held included.
- `created_at` (datetime, required) — Fan-out time. A resend does not change it.
- `updated_at` (datetime, required)

## Errors

### 400 Bad Request Error

Invalid input or cursor. Correct the request.

- `error` (ErrorResponseError, required) — Only code and message are required. Rasen sends details, request_id and retry on every error, but clients must parse an error that lacks them, so a typed error is never lost to a parsing failure.

### 401 Unauthorized Error

Invalid, expired or revoked API key. Creator departure or membership changes do not invalidate a workspace key.

- `error` (ErrorResponseError, required) — Only code and message are required. Rasen sends details, request_id and retry on every error, but clients must parse an error that lacks them, so a typed error is never lost to a parsing failure.

### 403 Forbidden Error

Operation not allowed by current credential or workspace access.

- `error` (ErrorResponseError, required) — Only code and message are required. Rasen sends details, request_id and retry on every error, but clients must parse an error that lacks them, so a typed error is never lost to a parsing failure.

### 404 Not Found Error

Resource absent or not visible in this workspace.

- `error` (ErrorResponseError, required) — Only code and message are required. Rasen sends details, request_id and retry on every error, but clients must parse an error that lacks them, so a typed error is never lost to a parsing failure.

### 409 Conflict Error

Conflict. Not retryable: read the current state, fix the request and send a new request. The one exception is idempotency_in_progress, which carries Retry-After: wait, then resend the identical request with the same Idempotency-Key. The operation lists its codes in x-error-codes; branch on error.code and, for conflict, error.details.reason.

- `error` (ErrorResponseError, required) — Only code and message are required. Rasen sends details, request_id and retry on every error, but clients must parse an error that lacks them, so a typed error is never lost to a parsing failure.

### 429 Too Many Requests Error

Rate limited. Respect Retry-After and retry the same intent where permitted.

- `error` (ErrorResponseError, required) — Only code and message are required. Rasen sends details, request_id and retry on every error, but clients must parse an error that lacks them, so a typed error is never lost to a parsing failure.

### 500 Internal Server Error

Internal error. The effect may have happened. Retry the same request with the same Idempotency-Key; read the resource before creating a new intent. For an operation that takes an Idempotency-Key, a client retry with the same key is safe: the server replays the stored outcome if the first attempt took effect; if the first attempt had no effect, the retry performs the operation once. Never retry with a new key.

- `error` (ErrorResponseError, required) — Only code and message are required. Rasen sends details, request_id and retry on every error, but clients must parse an error that lacks them, so a typed error is never lost to a parsing failure.

### 503 Service Unavailable Error

Service unavailable. Respect Retry-After where present. For an operation that takes an Idempotency-Key, a client retry with the same key is safe: the server replays the stored outcome if the first attempt took effect; if the first attempt had no effect, the retry performs the operation once. Never retry with a new key.

- `error` (ErrorResponseError, required) — Only code and message are required. Rasen sends details, request_id and retry on every error, but clients must parse an error that lacks them, so a typed error is never lost to a parsing failure.

## Types

### ErrorResponseError

Only code and message are required. Rasen sends details, request_id and retry on every error, but clients must parse an error that lacks them, so a typed error is never lost to a parsing failure.

- `code` (string, required) — Stable code. Branch on code (and details.reason for conflict), never on message. Each code has one HTTP status; see components.x-error-catalog.
- `message` (string, required) — Safe description; no provider payload or submitted secrets.
- `details` (map from string to any, optional) — Safe code-specific details. The public fields for each code are listed in components.x-error-catalog. Details never contain a request fingerprint, a hash of a request, secret material or another tenant's data. forbidden may include required_capabilities (a list).
- `request_id` (string, optional) — Same value as the X-Request-Id header. Quote it to support.
- `retry` (string, optional) — Retry class of this code: no (fix the request or state first), yes (retry the same request and the same Idempotency-Key), retry_after (wait for Retry-After, then retry the same request). Open response vocabulary. Preserve unknown values; never assume they mean success.

## Examples

**Response**

```json
{
  "id": "wdl_01j00000000000000000000000",
  "endpoint_id": "string",
  "event_id": "wevt_01j00000000000000000000000",
  "event_type": "string",
  "event_created_at": "2024-01-15T09:30:00Z",
  "call_id": "string",
  "state": "string",
  "cancel_reason": "string",
  "chain_no": 1,
  "attempt_count": 1,
  "max_attempts": 8,
  "last_attempt_at": "2024-01-15T09:30:00Z",
  "last_status_code": 1,
  "last_error_class": "string",
  "next_attempt_at": "2024-01-15T09:30:00Z",
  "created_at": "2024-01-15T09:30:00Z",
  "updated_at": "2024-01-15T09:30:00Z"
}
```

**SDK Code**

```python
import requests

url = "https://api.rasen.ai/v1/webhook-deliveries/delivery_id/resend"

headers = {
    "Idempotency-Key": "intent-appointment-001",
    "Rasen-Workspace": "ws_01j00000000000000000000000",
    "Authorization": "Bearer <token>"
}

response = requests.post(url, headers=headers)

print(response.json())
```

```javascript
const url = 'https://api.rasen.ai/v1/webhook-deliveries/delivery_id/resend';
const options = {
  method: 'POST',
  headers: {
    'Idempotency-Key': 'intent-appointment-001',
    'Rasen-Workspace': 'ws_01j00000000000000000000000',
    Authorization: 'Bearer <token>'
  }
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```ruby
require 'uri'
require 'net/http'

url = URI("https://api.rasen.ai/v1/webhook-deliveries/delivery_id/resend")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Idempotency-Key"] = 'intent-appointment-001'
request["Rasen-Workspace"] = 'ws_01j00000000000000000000000'
request["Authorization"] = 'Bearer <token>'

response = http.request(request)
puts response.read_body
```

```java
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://api.rasen.ai/v1/webhook-deliveries/delivery_id/resend")
  .header("Idempotency-Key", "intent-appointment-001")
  .header("Rasen-Workspace", "ws_01j00000000000000000000000")
  .header("Authorization", "Bearer <token>")
  .asString();
```

```php
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.rasen.ai/v1/webhook-deliveries/delivery_id/resend', [
  'headers' => [
    'Authorization' => 'Bearer <token>',
    'Idempotency-Key' => 'intent-appointment-001',
    'Rasen-Workspace' => 'ws_01j00000000000000000000000',
  ],
]);

echo $response->getBody();
```

```csharp
using RestSharp;

var client = new RestClient("https://api.rasen.ai/v1/webhook-deliveries/delivery_id/resend");
var request = new RestRequest(Method.POST);
request.AddHeader("Idempotency-Key", "intent-appointment-001");
request.AddHeader("Rasen-Workspace", "ws_01j00000000000000000000000");
request.AddHeader("Authorization", "Bearer <token>");
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = [
  "Idempotency-Key": "intent-appointment-001",
  "Rasen-Workspace": "ws_01j00000000000000000000000",
  "Authorization": "Bearer <token>"
]

let request = NSMutableURLRequest(url: NSURL(string: "https://api.rasen.ai/v1/webhook-deliveries/delivery_id/resend")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```