Overview
Webhooks allow LatentGEO to send real-time notifications to your applications when events occur. You can also configure LatentGEO to receive webhooks from GitHub and HubSpot. Webhook Types:- Outgoing Webhooks: LatentGEO sends events to your endpoints
- Incoming Webhooks: LatentGEO receives events from external services
Outgoing Webhooks
Get notified when key events happen in LatentGEO.Configure a Webhook Endpoint
Handle Webhook Events
Your endpoint will receive POST requests with event data. See Webhook Payload Format below.
Available Event Types
Get all available webhook events:Complete Event List
| Event | Description | Use Case |
|---|---|---|
audit.created | New audit is created | Track audit initiation |
audit.started | Audit processing begins | Update UI with progress |
audit.completed | Audit finishes successfully | Trigger downstream workflows |
audit.failed | Audit fails with error | Send error alerts |
audit.progress | Progress milestones (25%, 50%, 75%) | Real-time progress updates |
report.generated | Audit report is generated | Notify stakeholders |
pdf.ready | PDF report is ready | Send download link |
pagespeed.completed | PageSpeed analysis completes | Display performance metrics |
geo.analysis_completed | GEO tools analysis completes | Show GEO score |
github.pr_created | GitHub PR is created | Notify development team |
github.sync_completed | GitHub sync completes | Update repository list |
competitor.analysis_completed | Competitor analysis completes | Show competitive insights |
Webhook Payload Format
All outgoing webhooks follow this structure:Webhook Headers
Every webhook request includes these headers:Webhook Authentication
Verifying Signatures
All webhook payloads include an HMAC-SHA256 signature in theX-Webhook-Signature header:
Example Implementations
Incoming Webhooks
LatentGEO can receive webhooks from GitHub and HubSpot to automate workflows.GitHub Incoming Webhooks
Endpoint:push: Code pushed to repositorypull_request: PR opened, closed, or mergedping: GitHub webhook test
X-GitHub-Event: Event typeX-Hub-Signature-256: HMAC-SHA256 signature
Configure in GitHub
- Go to your repository settings
- Navigate to Webhooks → Add webhook
- Set Payload URL:
https://api.latentgeo.com/api/webhooks/github/incoming - Set Content type:
application/json - Set Secret: Your
GITHUB_WEBHOOK_SECRET - Select events:
push,pull_request
Configure LatentGEO
Set the
GITHUB_WEBHOOK_SECRET environment variable on your LatentGEO instance to match the secret you configured in GitHub.Push Event Processing
When code is pushed to a repository:- LatentGEO checks if the repository is configured for
auto_audit - If enabled, an audit is automatically triggered
- The webhook event is logged in the database
Pull Request Event Processing
When a PR is opened, closed, or merged:- LatentGEO looks up the PR in the database
- Updates the PR status (
open,merged,closed) - Records timestamps (
merged_at,closed_at)
HubSpot Incoming Webhooks
Endpoint:contact.creation: New contact addedcontact.propertyChange: Contact property updateddeal.creation: New deal created
Configure in HubSpot
- Go to HubSpot Settings → Integrations → Webhooks
- Create a new webhook subscription
- Set Target URL:
https://api.latentgeo.com/api/webhooks/hubspot/incoming - Select event types
HubSpot webhooks are sent as arrays of events. LatentGEO processes each event individually and returns a summary.
URL Validation
LatentGEO validates outbound webhook URLs for security:Webhook Health Check
Monitor webhook service health:Best Practices
- Always verify signatures: Never skip signature validation in production
- Respond quickly: Return a 200 response immediately, process in background
- Handle retries: LatentGEO retries failed webhooks with exponential backoff
- Log webhook IDs: Use
webhook_idfor debugging and deduplication - Monitor delivery rates: Check your webhook endpoint’s success rate
- Use HTTPS: Required in production for security
- Idempotent handling: Process each
webhook_idonly once
Troubleshooting
Webhook Not Received
- Check your firewall allows LatentGEO’s IP range
- Verify the URL is publicly accessible
- Check SSL certificate is valid (for HTTPS)
- Review webhook delivery logs in LatentGEO
Signature Verification Fails
- Ensure you’re using the raw request body (not parsed JSON)
- Verify the secret matches what you configured
- Use
hmac.compare_digest()for comparison - Check for character encoding issues
Timeout Errors
- Your endpoint should respond within 5 seconds
- Process webhooks asynchronously
- Return 200 immediately, handle logic in background
Use Cases
Slack Notifications
Notify your team when audits complete:Automated Reporting
Generate weekly reports when PDFs are ready:CI/CD Integration
Trigger deployments when GitHub PRs are created:Next Steps
GitHub Integration
Set up GitHub OAuth and PR automation
HubSpot Integration
Connect HubSpot to apply SEO fixes