Skip to content

📡 Webhooks

FFmate supports webhooks, allowing external systems to receive real-time notifications when specific events occur. By registering a webhook, you can automatically trigger actions in response to changes in FFmate, such as task creation, status updates, batch processing, or preset modifications.


🔗 Setting Up a Webhook

To configure a webhook, make a POST request to the API with the event you want to subscribe to and the URL where FFmate should send notifications.

sh
curl -X POST http://localhost:3000/api/v1/webhooks \
     -H "Content-Type: application/json" \
     -d '{
       "event": "task.created",
       "url": "https://yourserver.com/webhook-handler"
     }'

Webhook Payload:

When the specified event occurs, FFmate will send an HTTP POST request to the provided URL with relevant event data.

json
{
  "event": "task.created",
  "timestamp": "2025-02-13T14:05:32Z",
  "data": {
    "taskId": "550e8400-e29b-41d4-a716-446655440000",
    "inputFile": "/source/video.mp4",
    "outputFile": "/destination/video_converted.mp4",
    "status": "queued"
  }
}

Available Webhook Events

FFmate provides a variety of webhook events, grouped into different categories:

Task Events:

EventDescription
task.createdTriggered when a new task is added.
task.updatedTriggered when a task's status or details are updated.
task.deletedTriggered when a task is deleted.

Batch Events:

EventDescription
batch.createdTriggered when a new batch of tasks is created.
batch.finishedTriggered when a batch of tasks is completed.

Preset Events:

EventDescription
preset.createdTriggered when a new preset is created.
preset.updatedTriggered when an existing preset is modified.
preset.deletedTriggered when a preset is removed.

Watchfolder Events:

EventDescription
watchfolder.createdTriggered when a new watchfolder is created.
watchfolder.updatedTriggered when an existing watchfolder is modified.
watchfolder.deletedTriggered when a watchfolder is removed.

Webhook Events :

EventDescription
webhook.createdTriggered when a new webhook is registered.
webhook.deletedTriggered when a webhook is removed.

❌ Deleting a Webhook

To remove a webhook, send a DELETE request with its ID:

sh
curl -X DELETE http://localhost:3000/api/v1/webhooks/{webhookId} \
     -H "accept: application/json"

📢 Handling Webhook Requests

Ensure your webhook handler:

  • Accepts HTTP POST requests.
  • Responds with 200 OK to confirm receipt.
  • Retries failed requests if needed.

FFmate does not store webhook logs, so ensure your server logs incoming requests for debugging.


Released under the SSPL License.