> ## Documentation Index
> Fetch the complete documentation index at: https://docs.reap.video/llms.txt
> Use this file to discover all available pages before exploring further.

# Webhooks

> Receive real-time notifications when your video projects finish processing

> **For AI agents:** a documentation index is at [/llms.txt](https://docs.reap.video/llms.txt). Every page is also available as markdown, just append `.md` to the URL.

## Overview

Webhooks let Reap push status updates to your server the moment a video project reaches a final state -- no more polling. When a project completes, fails, or expires, Reap sends a POST request to your configured endpoint with the project's status.

## How It Works

**1. Create a Project**

Use the API to create a clipping, captions, transcription, reframe, or dubbing project as usual.

**2. Processing Begins**

Reap processes your video in the background.

**3. Project Reaches Final State**

The project finishes with a status of `completed` or `invalid`.

**4. Reap Sends a Webhook**

A POST request with the project status is sent to every active webhook URL configured in your studio.

**5. Your Server Processes the Event**

Your endpoint receives the payload, returns HTTP 200 with an empty body, and handles the event.

## Webhook Payload

Every webhook delivery sends a JSON POST request with this structure:

```json theme={"system"}
{
  "projectId": "65f1a2b3c4d5e6f7a8b9c0d1",
  "projectType": "clipping",
  "source": "Upload",
  "status": "completed"
}
```

**projectId** `string`

Unique identifier of the project.

**projectType** `string`

Type of project: `clipping`, `captions`, `reframe`, `dubbing`, `transcription`, or `editor`.

**source** `string`

Source of the original video: `Youtube`, `Upload`, or `Generic`.

**status** `string`

The final status that triggered the webhook.

### Statuses That Trigger Webhooks

| Status | Description |
| - | - |
| `completed` | Project finished processing successfully. Clips/results are ready. |
| `invalid` | The source video was invalid or processing failed. |
| `expired` | Project results expired and are no longer available. |

> [!NOTE]
>
> Webhooks are only sent when a project reaches a **final state**. You will not receive webhooks for intermediate states like `processing`.

For an editor project ([Create Editor Project](https://docs.reap.video/api-reference/create-editor.md)), `completed` means the project is ready to edit, not rendered. Its clip has no file until it is exported from the editor.

## Setting Up a Webhook

Webhooks are configured from the Reap dashboard, not via the API.

> [!NOTE]
>
> The documentation is public. Dashboard links require a Reap account and are only needed for account setup, API key management, integrations, or webhook configuration.

<video controls playsInline width="100%" poster="/images/help-center/webhooks-poster.jpg" src="https://mintcdn.com/reap/KDevp7fQ_nNnw83g/images/help-center/webhooks.mp4?fit=max&auto=format&n=KDevp7fQ_nNnw83g&q=85&s=b2581877686d339507c97e103ce04369" title="Add a webhook in Reap" />

**1. Open Webhook Settings**

Log in to your [Reap dashboard](https://app.reap.video), open your avatar menu in the top right, and go to **Settings** > **Webhooks**.

**2. Create a New Webhook**

Click **Create Webhook**. Provide a descriptive name and your HTTPS endpoint URL.

**3. Validation**

Reap sends a test POST request to your URL with the following dummy payload. Your endpoint must return HTTP **200** with an **empty response body** within **5 seconds**.

```json theme={"system"}
{
  "projectId": "000000000000000000000000",
  "projectType": "clipping",
  "source": "Upload",
  "status": "completed"
}
```

**4. Webhook is Active**

Once the test passes, the webhook is saved and active. All future project status changes in your studio will be delivered to this endpoint.

> [!WARNING]
>
> Your endpoint must be live and responding correctly **before** you create the webhook. Reap will reject the webhook if the test request fails.

## Endpoint Requirements

Your webhook endpoint must meet these requirements:

> [card] HTTPS Only
>
> The URL must use HTTPS. HTTP, localhost, and private IP addresses are not allowed.

> [card] Accept POST with JSON
>
> Your endpoint must accept POST requests with a `Content-Type: application/json` body.

> [card] Return 200 Empty
>
> Respond with HTTP status **200** and an **empty response body**. Any other status code is treated as a failure.

> [card] Respond Within Timeout
>
> Respond within **5 seconds** during webhook creation/validation, and within **10 seconds** for live deliveries. Exceeding the timeout counts as a failure.

### URL Restrictions

Your webhook URL must pass these validation checks:

* Must use the `https://` scheme
* Cannot point to `localhost`, `127.0.0.1`, or `0.0.0.0`
* Cannot point to private or reserved IP address ranges

## Example Webhook Receiver

```javascript Node.js (Express) theme={"system"}
const express = require('express');
const app = express();

app.use(express.json());

app.post('/webhook/reap', (req, res) => {
  const { projectId, projectType, source, status } = req.body;

  // Return 200 immediately with empty body
  res.status(200).send('');

  // Process the event asynchronously
  handleProjectUpdate(projectId, projectType, source, status);
});

async function handleProjectUpdate(projectId, projectType, source, status) {
  if (status === 'completed') {
    // Fetch clips or project details from the API
    console.log(`Project ${projectId} completed. Fetching results...`);
  } else if (status === 'invalid') {
    console.log(`Project ${projectId} failed with status: ${status}`);
  } else if (status === 'expired') {
    console.log(`Project ${projectId} expired.`);
  }
}

app.listen(3000, () => console.log('Webhook receiver running on port 3000'));
```

```python Python (Flask) theme={"system"}
from flask import Flask, request

app = Flask(__name__)

@app.route('/webhook/reap', methods=['POST'])
def handle_webhook():
    data = request.json
    project_id = data['projectId']
    status = data['status']

    # Process asynchronously in production (e.g. Celery task)
    if status == 'completed':
        print(f'Project {project_id} completed. Fetching results...')
    elif status == 'invalid':
        print(f'Project {project_id} failed with status: {status}')
    elif status == 'expired':
        print(f'Project {project_id} expired.')

    # Return 200 with empty body
    return '', 200

if __name__ == '__main__':
    app.run(port=3000)
```

```go Go theme={"system"}
package main

import (
	"encoding/json"
	"fmt"
	"net/http"
)

type WebhookPayload struct {
	ProjectID   string `json:"projectId"`
	ProjectType string `json:"projectType"`
	Source      string `json:"source"`
	Status      string `json:"status"`
}

func webhookHandler(w http.ResponseWriter, r *http.Request) {
	var payload WebhookPayload
	json.NewDecoder(r.Body).Decode(&payload)

	// Return 200 with empty body immediately
	w.WriteHeader(http.StatusOK)

	// Process the event
	go func() {
		if payload.Status == "completed" {
			fmt.Printf("Project %s completed. Fetching results...\n", payload.ProjectID)
		}
	}()
}

func main() {
	http.HandleFunc("/webhook/reap", webhookHandler)
	fmt.Println("Webhook receiver running on port 3000")
	http.ListenAndServe(":3000", nil)
}
```

## Managing Webhooks

All webhook management is done from the [Reap dashboard](https://app.reap.video) under your avatar menu > **Settings** > **Webhooks**.

You can:

* **Update** the name or URL of an existing webhook. Changing the URL triggers a new test request.
* **Disable/Enable** a webhook. Re-enabling a disabled webhook triggers a test request to verify your endpoint is working.
* **Delete** a webhook to stop receiving notifications permanently.
* **View delivery history** for each webhook, including response codes and delivery times.

> [!TIP]
>
> All active webhooks in a studio receive notifications for **every** project in that studio. You cannot scope a webhook to specific project types.

## Auto-Disable on Failures

Reap tracks consecutive delivery failures for each webhook:

* Each failed delivery (non-200 response, timeout, or unreachable endpoint) increments the failure counter.
* After **5 consecutive failures**, the webhook is **automatically disabled** and you are notified via email.
* Any **successful delivery** resets the failure counter back to 0.

To re-enable a disabled webhook:

1. Fix the issue with your endpoint
2. In the dashboard, open your avatar menu and go to **Settings** > **Webhooks**
3. Toggle the webhook back on (this triggers a test request)

> [!WARNING]
>
> There are no automatic retries. If a delivery fails, Reap logs the failure and moves on. Design your system to handle missed events by periodically checking [Get Project Status](https://docs.reap.video/api-reference/get-project-status.md) for critical projects.

## Plan Limits

| Plan | Max Active Webhooks |
| - | - |
| Free | 0 (no webhook access) |
| Creator | 1 |
| Studio | 5 |

> [!TIP]
>
> Need more webhooks? [Contact us](mailto:hello@reap.video) to discuss enterprise options.

## Best Practices

> [card] Respond Fast
>
> Return 200 immediately and process the event asynchronously. Don't do heavy work before responding.

> [card] Handle Duplicates
>
> Design your handler to be idempotent. In rare cases, you may receive the same event more than once.

> [card] Monitor Deliveries
>
> Check webhook delivery history in your dashboard regularly to catch issues before the auto-disable threshold.

> [card] Have a Fallback
>
> Use [Get Project Status](https://docs.reap.video/api-reference/get-project-status.md) as a fallback for critical workflows in case a webhook delivery is missed.

## Next Steps

* [Get Project Status](https://docs.reap.video/api-reference/get-project-status.md) -- fallback polling endpoint
* [Get Project Details](https://docs.reap.video/api-reference/get-project-details.md) -- fetch full project data after a `completed` webhook
* [Get Project Clips](https://docs.reap.video/api-reference/get-project-clips.md) -- retrieve generated clips after completion


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.