Quickstart
Not a developer? You can set up webhooks without writing any code using the Deel Developer Center. This guide is for developers who want to integrate webhooks programmatically.
What You’ll Learn
This quickstart guide will walk you through:
- Creating a webhook endpoint to receive events
- Verifying webhook signatures for security
- Subscribing to specific events
- Testing your webhook integration
Time to complete: ~15 minutes
Prerequisites
Before you begin, ensure you have:
- API Token – Get your API token from the Deel Developer Center
- Development Environment – Node.js, Python, Go, or PHP installed locally
- Testing Tool – ngrok or a similar tool to expose localhost
Step 1: Create a Webhook Endpoint
First, create a simple HTTP endpoint that can receive POST requests from Deel.
Choose your language: We’ll show examples in multiple languages. Pick the one you’re most comfortable with!
Start your server and make sure it’s running on port 3000. We’ll expose it publicly in the next step.
Step 2: Expose Your Local Server
Use ngrok to create a public HTTPS URL for your local server:
Keep ngrok running in a separate terminal window while testing. If you restart ngrok, you’ll get a new URL and need to update your webhook subscription.
Step 3: Create a Webhook Subscription
Now subscribe to webhook events using the Deel API.
Prefer a visual interface? You can also create webhooks through the Deel Developer Center without writing code. This guide uses the API for learning purposes.
Save the signing key! The API response includes a signing_key that you’ll need for signature verification in the next step. Store it securely as an environment variable.
Don’t know which events to subscribe to? List all available events first:
Step 4: Add Signature Verification
Now add security to your webhook endpoint by verifying signatures:
Security tip: The signature is computed as HMAC-SHA256(signing_key, "POST" + raw_body). Always prefix with “POST” before hashing!
Step 5: Test It Out!
Now trigger a webhook event to see everything working:
Ensure everything is running
Make sure you have:
- ✅ Your webhook server running on port 3000
- ✅ ngrok tunnel active
- ✅ Webhook subscription created
Trigger an event in Deel Sandbox
Log into your Deel Sandbox and perform an action that triggers your subscribed event:
- Create a new contract (triggers
contract.created) - Sign a contract (triggers
contract.signed) - Complete a payment (triggers
payment.completed)
Verify in ngrok dashboard
Open the ngrok web interface at http://localhost:4040 to see the webhook request details
Webhook not arriving? Deel retries failed deliveries with exponential backoff. If your endpoint was down, the webhook will be retried automatically up to 10 times.
What’s in a Webhook Payload?
Here’s what you’ll receive when an event occurs:
Key fields:
data.meta.event_type- The type of event that occurreddata.meta.organization_id- Your organization IDdata.resource- Event-specific data (varies by event type)timestamp- When the event occurred (ISO 8601 format)
Common Issues & Solutions
Not receiving any webhooks
Check:
- Is your server running and accessible via ngrok?
- Did you use the correct ngrok HTTPS URL when creating the subscription?
- Are you triggering the right events you subscribed to?
Quick test:
Signature verification failing
Common mistakes:
- Not prefixing with “POST” before hashing
- Using parsed JSON instead of raw body
- Wrong signing key (check your environment variables)
Debug it:
Getting 401 or 403 errors when creating webhook
Possible causes:
- Invalid or expired API token
- Using sandbox token for production API (or vice versa)
Solution: Verify your token:
Learn More
Managing Webhooks
You can manage webhook subscriptions via API or through the Developer Center:
Via API:
GET /webhooks- List all your webhooksGET /webhooks/{id}- Get webhook detailsPATCH /webhooks/{id}- Update webhook URL or eventsDELETE /webhooks/{id}- Delete webhook
Via Developer Center: Visit the Managing Webhooks guide to learn how to create, view, edit, test, and monitor webhooks through the visual interface.
Webhook Retry Behavior
Deel retries failed webhooks up to 10 times with exponential backoff:
- 1st retry: 1 minute
- 2nd retry: 2 minutes
- 3rd retry: 4 minutes
- 4th-9th retries: Continue with exponential backoff
- 10th attempt: After 16 hours, webhook is disabled if it fails
After 10 failures, the webhook is automatically disabled and you’ll need to re-enable it.
Production Best Practices
Before going live, make sure you:
- Always verify signatures with constant-time comparison
- Respond within 30 seconds (ideally under 5 seconds)
- Use HTTPS with a valid SSL certificate
- Log webhook deliveries for debugging
- Monitor for failures and retries
- Implement graceful error handling
- Set up alerts for webhook failures