Overview
The Webhooks integration allows you to send custom metrics from any source - Zapier, Make (Integromat), n8n, custom scripts, or any tool that can make HTTP requests.Use Cases
- Track custom business events
- Monitor cron jobs and scheduled tasks
- Integrate legacy systems
- Send metrics from internal tools
- Aggregate data from multiple sources
- Track metrics not available in standard integrations
Features
- Unlimited Flexibility: Track any metric you can imagine
- Simple API: Just POST JSON to your webhook URL
- Secure: API key authentication
- Real-time: Metrics appear instantly
- Batch Support: Send multiple metrics in one request
Setup Instructions
Step 1: Create Webhook Connection
- Go to your project dashboard
- Click on Integrations in the sidebar
- Find Custom Webhooks in the Custom category
- Click Connect
- Give your webhook a name (e.g., “Cron Job Metrics”)
- Click Create
Step 2: Copy Your Credentials
You’ll receive:- Webhook URL:
https://yourdomain.com/api/webhooks/custom - API Key: A secure token for authentication
- Project ID: Your project identifier
Step 3: Send Your First Metric
Step 4: View Your Metrics
- Metrics appear instantly in your dashboards
- Create widgets to visualize your custom metrics
- Set up alerts on custom metrics (Pro+)
API Reference
Endpoint
Headers
Request Body
Response
Success (200):Integration Examples
Zapier
- Create a new Zap
- Choose your trigger (e.g., “New Row in Google Sheets”)
- Add action: Webhooks by Zapier → POST
- Configure:
- URL: Your webhook URL
- Payload Type: JSON
- Headers:
Authorization: Bearer YOUR_API_KEY - Data: Map your fields to the metrics format
Make (Integromat)
- Create a new scenario
- Add your trigger module
- Add HTTP → Make a Request module
- Configure:
- URL: Your webhook URL
- Method: POST
- Headers: Add Authorization header
- Body: JSON with metrics data
n8n
- Create a new workflow
- Add your trigger node
- Add HTTP Request node
- Configure:
- Method: POST
- URL: Your webhook URL
- Authentication: Header Auth
- Body: JSON with metrics
JavaScript/Node.js
Python
Best Practices
Metric IDs
- Use consistent, descriptive IDs (e.g.,
daily_signups,api_response_time) - Use snake_case for readability
- Don’t change IDs once created (historical data won’t match)
Metric Names
- Use human-readable names (e.g., “Daily Signups”, “API Response Time”)
- Keep names concise but descriptive
- Use title case for consistency
Units
- Always specify units when applicable (
USD,ms,count,%) - Be consistent with units across similar metrics
- Use standard abbreviations
Timestamps
- Send timestamps in Unix milliseconds
- If omitted, current time is used
- Don’t send future timestamps
Batching
- Send multiple metrics in one request when possible
- Reduces API calls and improves performance
- Maximum 100 metrics per request
Error Handling
- Always check response status
- Implement retry logic for failed requests
- Log errors for debugging
Troubleshooting
401 Unauthorized
- Verify your API key is correct
- Check that the Authorization header is properly formatted
- Ensure the API key hasn’t been revoked
400 Bad Request
- Verify your JSON is valid
- Check that all required fields are present
- Ensure
valueis a number, not a string
Metrics Not Appearing
- Check that
projectIdmatches your project - Verify
metricIdis consistent - Wait a few seconds and refresh the dashboard
Rate Limiting
- Free tier: 100 requests per hour
- Pro tier: 1,000 requests per hour
- Scale+ tier: 10,000 requests per hour
Security
- Never expose your API key in client-side code
- Use environment variables for credentials
- Rotate API keys periodically
- Monitor webhook usage for suspicious activity
- You can revoke and regenerate API keys anytime
Support
Need help with webhooks?- Email: support@dashtray.com
- Check our FAQ
- Join our Discord community