Webhooks
Learn how to integrate webhooks with Browser Use Cloud API
Webhooks allow you to receive real-time notifications about events in your Browser Use tasks. This guide will show you how to set up and verify webhook endpoints.
Prerequisites
You need an active subscription to create webhooks. See your billing page cloud.browser-use.com/billing
Setting Up Webhooks
To receive webhook notifications, you need to:
- Create an endpoint that can receive HTTPS POST requests
- Configure your webhook URL in the Browser Use dashboard
- Implement signature verification to ensure webhook authenticity
When adding a webhook URL in the dashboard, it must be a valid HTTPS URL that can receive POST requests.
On creation, we will send a test payload {"type": "test", "timestamp": "2024-03-21T12:00:00Z", "payload": {"test": "ok"}}
to verify the endpoint is working correctly before creating the actual webhook!
Webhook Events
Browser Use sends various types of events. Each event has a specific type and payload structure.
Event Types
Currently supported events:
Event Type | Description |
---|---|
agent.task.status_update | Status updates for running tasks |
Task Status Updates
The agent.task.status_update
event includes the following statuses:
Status | Description |
---|---|
initializing | A task is initializing |
started | A Task has started (browser available) |
paused | A task has been paused mid execution |
stopped | A task has been stopped mid execution |
finished | A task has finished |
Webhook Payload Structure
Each webhook call includes:
- A JSON payload with event details
X-Browser-Use-Timestamp
header with the current timestampX-Browser-Use-Signature
header for verification
The payload follows this structure:
Implementing Webhook Verification
To ensure webhook authenticity, you must verify the signature. Here’s an example implementation in Python using FastAPI:
Best Practices
- Always verify signatures: Never process webhook payloads without verifying the signature
- Handle retries: Browser Use will retry failed webhook deliveries up to 5 times
- Respond quickly: Return a 200 response as soon as you’ve verified the signature
- Process asynchronously: Handle the webhook payload processing in a background task
- Monitor failures: Set up monitoring for webhook delivery failures
- Handle unknown events: Implement graceful handling of new event types that may be added in the future
Need help? Contact our support team at support@browser-use.com or join our Discord community