Webhooks
Time to learn: 10 minutes
Prerequisites: Understanding of APIs and HTTP requests (intermediate level)
Webhooks let you send data to other applications when documents are generated. Think of them as automatic notifications to other apps - when Gdocify generates a document, it can notify your other systems.
Webhooks Quick Reference
What Are Webhooks?
Webhooks are HTTP requests sent to a URL you specify. When Gdocify generates a document, it can:
- Send a POST request to your endpoint
- Include document information in the request
- Notify other systems about the generation
- Trigger workflows in other apps
Why Use Webhooks?
Webhooks let you:
- Integrate with other apps - Connect Gdocify to your existing tools
- Automate workflows - Trigger actions in other systems
- Track document generation - Log events in your systems
- Build custom integrations - Create your own automation
Setting Up Webhooks
- Click "More Options" in your automation
- Select "Webhook Config"
- Enable webhook delivery
- Configure your endpoint URL and settings
Configuring Your Endpoint
Endpoint URL
Enter the URL where webhooks should be sent:
https://api.example.com/webhookhttps://your-app.com/gdocify-webhook
HTTP Method
Choose how to send the request:
- GET - Send data as query parameters
- POST - Send data in request body (most common)
- PUT - Send data in request body
Custom Headers
Add custom headers for authentication or identification:
Authorization: Bearer your-tokenX-API-Key: your-keyContent-Type: application/json
Request Body
Configure what data to send in the request body.
Using Placeholders
Include placeholders in the request body to send dynamic data:
{
"documentId": "{{documentId}}",
"customerName": "{{customerName}}",
"invoiceNumber": "{{invoiceNumber}}",
"status": "generated",
"timestamp": "{{timestamp}}"
}
Available Data
You can include:
- Any field from your data source
- Document metadata (ID, URL, etc.)
- Generation timestamp
- Custom values
Testing Webhooks
Before using webhooks in production:
- Use a test endpoint (like webhook.site)
- Generate a test document
- Verify the webhook is received
- Check the request format and data
- Once confirmed, switch to your production endpoint
Use Cases
Notify Your Application
Send webhooks to your own application:
{
"event": "document_generated",
"documentId": "{{documentId}}",
"customerId": "{{customerId}}",
"documentUrl": "{{documentUrl}}"
}
Update CRM Systems
Notify CRM systems when documents are generated:
{
"contactId": "{{contactId}}",
"documentType": "invoice",
"documentUrl": "{{documentUrl}}",
"status": "sent"
}
Log Events
Log document generation events:
{
"timestamp": "{{timestamp}}",
"documentType": "resume",
"recordId": "{{recordId}}",
"status": "success"
}
Trigger Workflows
Trigger workflows in automation tools:
{
"trigger": "document_ready",
"data": {
"documentId": "{{documentId}}",
"customerEmail": "{{customerEmail}}"
}
}
Security
Authentication
Use custom headers for authentication:
- Bearer tokens
- API keys
- Custom authentication schemes
HTTPS
Always use HTTPS endpoints:
- ✅
https://api.example.com/webhook - ❌
http://api.example.com/webhook(insecure)
Validation
Validate webhook requests in your endpoint:
- Verify authentication headers
- Check request signatures if provided
- Validate request format
Best Practices
Endpoint Configuration
- Use HTTPS: Always use secure connections
- Handle errors: Your endpoint should handle failures gracefully
- Return quickly: Respond quickly to avoid timeouts
- Log requests: Keep logs for debugging
Request Body
- Include necessary data: Send only what you need
- Use placeholders: Make data dynamic
- Keep it structured: Use JSON for easy parsing
- Document your format: Note what data is sent
Testing
- Test thoroughly: Verify webhooks work before production
- Use test endpoints: Test with webhook.site or similar
- Monitor failures: Watch for failed webhook deliveries
- Handle retries: Your endpoint should handle retry attempts
Common Issues
"Webhook not received"
- Verify your endpoint URL is correct
- Check that your endpoint is accessible
- Ensure your endpoint accepts the HTTP method
- Check firewall/network settings
"Authentication failed"
- Verify custom headers are correct
- Check authentication credentials
- Ensure your endpoint validates auth properly
"Timeout errors"
- Make sure your endpoint responds quickly
- Check endpoint performance
- Verify network connectivity
Tips
- Start simple: Begin with basic webhooks, add complexity later
- Test first: Always test with a test endpoint
- Monitor delivery: Check execution history for webhook status
- Use placeholders: Include relevant data in webhook payloads
- Document your setup: Note your webhook configuration
Next Steps
Now that you understand webhooks:
- Learn about Triggers to start automations
- Explore Email Notifications for email delivery
- Check out Run History to track webhook deliveries