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

# Recover Failed Messages

POST https://api.airweave.ai/webhooks/subscriptions/{subscription_id}/recover
Content-Type: application/json

Retry failed message deliveries for a webhook subscription.

Triggers a recovery process that replays all failed messages within the
specified time window. This is useful when:

- Your endpoint was temporarily down and you want to catch up
- You've fixed a bug in your webhook handler
- You want to reprocess events after re-enabling a disabled subscription

Messages are retried in chronological order. Successfully delivered messages
are skipped; only failed or pending messages are retried.

Reference: https://docs.airweave.ai/api-reference/webhooks/recover-failed-messages-webhooks-subscriptions-subscription-id-recover-post

## Authentication

- `x-api-key` header (required) — API Key authentication via header

## Servers

- `https://api.airweave.ai` (Production, default)
- `http://localhost:8001` (Local)

## Request

### Path parameters

- `subscription_id` (string, required) — The unique identifier of the subscription to recover messages for (UUID).

### Body (application/json)

This endpoint expects a RecoverMessagesRequest.

- `since` (string, required) — Start of the recovery time window (inclusive). All failed messages from this time onward will be retried.
- `until` (string, optional, nullable) — End of the recovery time window (exclusive). If not specified, recovers all failed messages up to now.

## Response

### 200

Recovery task information

- `id` (string, required) — Unique identifier for this recovery task (Svix internal ID)
- `status` (string, required) — Recovery task status: 'running' or 'completed'

## Errors

### 404 Not Found Error

Subscription Not Found

- `detail` (string, required) — Error message describing what was not found

### 422 Unprocessable Entity Error

Validation Error

- `detail` (list of ValidationErrorDetail, required) — List of validation errors

### 429 Too Many Requests Error

Rate Limit Exceeded

- `detail` (string, required) — Error message explaining the rate limit

## Types

### ValidationErrorDetail

Details about a validation error for a specific field.

- `loc` (list of string, required) — Location of the error (e.g., ['body', 'url'])
- `msg` (string, required) — Human-readable error message
- `type` (string, required) — Error type identifier

## Examples

**Request**

```json
{
  "since": "2024-03-14T00:00:00Z",
  "summary": "Recover last 24 hours",
  "value": {
    "since": "2024-03-14T00:00:00Z",
    "until": "2024-03-15T00:00:00Z"
  }
}
```

**Response**

```json
{
  "id": "rcvr_2bVxUn3RFnLYHa8z6ZKHMT9PqPX",
  "status": "running"
}
```

**SDK Code**

```python
import requests

url = "https://api.airweave.ai/webhooks/subscriptions/550e8400-e29b-41d4-a716-446655440000/recover"

payload = {
    "since": "2024-03-14T00:00:00Z",
    "summary": "Recover last 24 hours",
    "value": {
        "since": "2024-03-14T00:00:00Z",
        "until": "2024-03-15T00:00:00Z"
    }
}
headers = {
    "x-api-key": "<apiKey>",
    "Content-Type": "application/json"
}

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

print(response.json())
```

```typescript
import { AirweaveSDKClient } from "@airweave/sdk";

const client = new AirweaveSDKClient({ apiKey: "YOUR_API_KEY" });
await client.webhooks.recoverFailedMessages("550e8400-e29b-41d4-a716-446655440000", {
    since: "2024-03-14T00:00:00Z"
});

```

```go
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://api.airweave.ai/webhooks/subscriptions/550e8400-e29b-41d4-a716-446655440000/recover"

	payload := strings.NewReader("{\n  \"since\": \"2024-03-14T00:00:00Z\",\n  \"summary\": \"Recover last 24 hours\",\n  \"value\": {\n    \"since\": \"2024-03-14T00:00:00Z\",\n    \"until\": \"2024-03-15T00:00:00Z\"\n  }\n}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("x-api-key", "<apiKey>")
	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

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

url = URI("https://api.airweave.ai/webhooks/subscriptions/550e8400-e29b-41d4-a716-446655440000/recover")

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

request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<apiKey>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"since\": \"2024-03-14T00:00:00Z\",\n  \"summary\": \"Recover last 24 hours\",\n  \"value\": {\n    \"since\": \"2024-03-14T00:00:00Z\",\n    \"until\": \"2024-03-15T00:00:00Z\"\n  }\n}"

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.airweave.ai/webhooks/subscriptions/550e8400-e29b-41d4-a716-446655440000/recover")
  .header("x-api-key", "<apiKey>")
  .header("Content-Type", "application/json")
  .body("{\n  \"since\": \"2024-03-14T00:00:00Z\",\n  \"summary\": \"Recover last 24 hours\",\n  \"value\": {\n    \"since\": \"2024-03-14T00:00:00Z\",\n    \"until\": \"2024-03-15T00:00:00Z\"\n  }\n}")
  .asString();
```

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

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.airweave.ai/webhooks/subscriptions/550e8400-e29b-41d4-a716-446655440000/recover', [
  'body' => '{
  "since": "2024-03-14T00:00:00Z",
  "summary": "Recover last 24 hours",
  "value": {
    "since": "2024-03-14T00:00:00Z",
    "until": "2024-03-15T00:00:00Z"
  }
}',
  'headers' => [
    'Content-Type' => 'application/json',
    'x-api-key' => '<apiKey>',
  ],
]);

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

```csharp
using RestSharp;

var client = new RestClient("https://api.airweave.ai/webhooks/subscriptions/550e8400-e29b-41d4-a716-446655440000/recover");
var request = new RestRequest(Method.POST);
request.AddHeader("x-api-key", "<apiKey>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"since\": \"2024-03-14T00:00:00Z\",\n  \"summary\": \"Recover last 24 hours\",\n  \"value\": {\n    \"since\": \"2024-03-14T00:00:00Z\",\n    \"until\": \"2024-03-15T00:00:00Z\"\n  }\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = [
  "x-api-key": "<apiKey>",
  "Content-Type": "application/json"
]
let parameters = [
  "since": "2024-03-14T00:00:00Z",
  "summary": "Recover last 24 hours",
  "value": [
    "since": "2024-03-14T00:00:00Z",
    "until": "2024-03-15T00:00:00Z"
  ]
] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://api.airweave.ai/webhooks/subscriptions/550e8400-e29b-41d4-a716-446655440000/recover")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

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()
```