Webhooks Advanced Usage
Pro Feature
Webhook support is available exclusively for Reasoner Pro users.
Complete Code Examples
These examples show production-ready implementations with proper error handling and security practices.
Python Requests
Node.js
cURL Script
Best Practices
Secure Your Credentials
- Store credentials in environment variables or a secure vault, never in code
- Rotate credentials periodically
- Use different credentials for different environments (development, staging, production)
Structure Your Data
- Use consistent JSON structures for your webhook payloads
- Include metadata like timestamps and event types
- Keep payloads concise and relevant
Example structure:
Handle Errors Gracefully
- Implement retry logic with exponential backoff for failed requests
- Log detailed error information for troubleshooting
- Set up monitoring to alert on persistent failures
Python example with retries:
Rate Limiting Considerations
- Avoid sending too many requests in a short period
- Batch data when possible instead of sending many small payloads
- Implement queuing for high-volume scenarios
Troubleshooting
Common Issues and Solutions
If you encounter problems with your webhook implementation, check these common issues:
Authentication Errors (401 Unauthorized)
Request Format Issues (400 Bad Request)
Connection Problems
Need More Help?
If you’re still experiencing issues after trying these solutions, contact Reasoner support with:
- The exact request you’re trying to send (with sensitive data redacted)
- Any error messages or status codes you’re receiving
- Your environment details (programming language, library versions, etc.)
FAQ
What data formats does the webhook endpoint accept?
The webhook endpoint accepts JSON data only. Make sure your Content-Type header is set to application/json and your payload is valid JSON.
Is there a size limit for webhook payloads?
Yes, webhook payloads are limited to 10MB. For larger datasets, consider breaking them into smaller chunks or using a different data ingestion method.
How do I know if my webhook was successfully received?
A successful webhook request will receive a 200 OK response. You can also check your Reasoner dashboard for the received data.
Can I use webhooks in a serverless environment?
Yes, webhooks work well with serverless functions like AWS Lambda, Google Cloud Functions, or Azure Functions. Just make sure to securely store your credentials using the environment’s secret management system.
How do I rotate my webhook credentials?
Go to Settings > Integrations in your Reasoner dashboard and generate new webhook credentials. Make sure to update all your systems using the old credentials before deactivating them.