Skip to main content

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

MethodGET, POST, or PUT
HeadersCustom headers supported
BodyJSON with placeholders
Use caseApp integrations

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

  1. Click "More Options" in your automation
  2. Select "Webhook Config"
  3. Enable webhook delivery
  4. Configure your endpoint URL and settings

Configuring Your Endpoint

Endpoint URL

Enter the URL where webhooks should be sent:

  • https://api.example.com/webhook
  • https://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-token
  • X-API-Key: your-key
  • Content-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:

  1. Use a test endpoint (like webhook.site)
  2. Generate a test document
  3. Verify the webhook is received
  4. Check the request format and data
  5. 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:

  1. Learn about Triggers to start automations
  2. Explore Email Notifications for email delivery
  3. Check out Run History to track webhook deliveries