# Resend webhook

Retry a failed or exhausted webhook delivery.

Resets attempt counters on a failed or exhausted delivery and queues it again. Pending, delivering, or successful deliveries cannot be retried.

This route is console / Firebase only for now. Tenant API keys are not accepted.

## See also

- [Webhooks](https://www.invunion.com/knowledge-base/api/webhooks/). Events you can subscribe to and the JSON posted to your URL.

- HTTP method: `POST`
- Path: `/api/v1/webhook-deliveries/:id/retry`
- URL: `https://api.invunion.com/api/v1/webhook-deliveries/:id/retry`
- Required scope: `none — Firebase console only`
- HTML docs: https://www.invunion.com/knowledge-base/api/resend-webhook/
- Markdown docs: https://www.invunion.com/knowledge-base/api/resend-webhook.md

## Path parameters

| Name | Type | Required | Description | Allowed values | Example |
| --- | --- | --- | --- | --- | --- |
| `id` | string, no maximum | required | Webhook delivery UUID. |  | `5f3deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6d` |



## Errors

| Error | HTTP code | Description |
| --- | --- | --- |
| `Missing Bearer token` | `401` | The Authorization header is missing or is not a Bearer token. |
| `Invalid token` | `401` | Webhook destinations and deliveries are console-only. Send a Firebase ID token. Tenant API keys are not accepted on these routes. |
| `Too many requests, please try again later` | `429` | Wait and retry. The Retry-After header is the number of seconds to wait. |
| `Retryable webhook delivery not found` | `404` | The delivery does not exist, or its status is not failed or exhausted. |
| `Internal server error` | `500` | Unexpected server error. The JSON body includes correlationId. Retry with backoff. |

## Request (curl)

```bash
curl --request POST \
  --url https://api.invunion.com/api/v1/webhook-deliveries/5f3deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6d/retry \
  --header 'accept: application/json' \
  --header 'authorization: Bearer FIREBASE_ID_TOKEN'
```

## Request (Python)

```python
import requests

url = "https://api.invunion.com/api/v1/webhook-deliveries/5f3deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6d/retry"
headers = {
    "Accept": "application/json",
    "Authorization": "Bearer FIREBASE_ID_TOKEN",
}
response = requests.post(url, headers=headers)
print(response.json())
```

## Request (Ruby)

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

uri = URI("https://api.invunion.com/api/v1/webhook-deliveries/5f3deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6d/retry")
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = true
request = Net::HTTP::Post.new(uri)
request['Accept'] = 'application/json'
request['Authorization'] = 'Bearer FIREBASE_ID_TOKEN'
response = http.request(request)
puts response.body
```

## Request (JavaScript)

```javascript
const response = await fetch("https://api.invunion.com/api/v1/webhook-deliveries/5f3deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6d/retry", {
  method: "POST",
  headers: {
    "Accept": "application/json",
    "Authorization": "Bearer FIREBASE_ID_TOKEN"
  },
});
const data = await response.json();
```

## Request (Go)

```go
package main

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

func main() {
	req, err := http.NewRequest("POST", "https://api.invunion.com/api/v1/webhook-deliveries/5f3deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6d/retry", nil)
	if err != nil {
		panic(err)
	}
	req.Header.Set("Accept", "application/json")
	req.Header.Set("Authorization", "Bearer FIREBASE_ID_TOKEN")
	resp, err := http.DefaultClient.Do(req)
	if err != nil {
		panic(err)
	}
	defer resp.Body.Close()
	body, _ := io.ReadAll(resp.Body)
	fmt.Println(string(body))
}
```

## Request (Node)

```javascript
const response = await fetch("https://api.invunion.com/api/v1/webhook-deliveries/5f3deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6d/retry", {
  method: "POST",
  headers: {
    "Accept": "application/json",
    "Authorization": "Bearer FIREBASE_ID_TOKEN"
  },
});
console.log(await response.json());
```

## Success (202)

```json
{
  "success": true,
  "data": {
    "deliveryId": "5f3deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6d"
  }
}
```
