INTRODUCTION
PatternHooks is enterprise-grade webhook infrastructure that handles sending, receiving, and managing webhooks at any scale. This documentation will help you integrate webhooks into your application quickly and reliably.
WHAT IS PATTERNHOOKS?
PatternHooks provides the infrastructure layer for webhooks so you can focus on your core product. Instead of building and maintaining webhook delivery systems, retry logic, signature verification, and monitoring dashboards yourself, PatternHooks handles all of this for you.
Whether you're building a SaaS platform that needs to notify customers of events, or integrating with third-party services that send webhooks, PatternHooks ensures reliable, secure, and observable webhook delivery.
Key Benefits
- Guaranteed Delivery: Automatic retries with exponential backoff ensure your webhooks are delivered even when endpoints are temporarily unavailable.
- Security Built-in: Every webhook is cryptographically signed using HMAC-SHA256, allowing recipients to verify authenticity.
- Full Observability: Real-time dashboards show delivery status, latency metrics, and failure rates across all your webhooks.
- Developer Experience: SDKs for every major language, comprehensive documentation, and a CLI for local development.
- Scale Effortlessly: Handle millions of webhooks per day without infrastructure changes. We scale automatically.
CORE CONCEPTS
Understanding these four core concepts will help you get the most out of PatternHooks:
order.created, user.deleted). Endpoints subscribe to specific event types, so they only receive relevant webhooks. This reduces noise and processing overhead.HOW IT WORKS
Here's the typical flow when you send a webhook through PatternHooks:
- You send a message to our API with an event type and payload
- We identify all endpoints subscribed to that event type within the application
- We sign the payload with each endpoint's unique signing secret
- We deliver the webhook to each endpoint with appropriate headers
- If delivery fails, we automatically retry with exponential backoff
- You can monitor delivery status in real-time via dashboard or API
QUICK START
Get up and running in minutes. Here's how to send your first webhook:
1. Install the SDK
2. Initialize the Client
3. Create an Application
Applications typically represent one of your customers:
4. Add an Endpoint
This is where webhooks will be delivered:
5. Send Your First Webhook
Use eventId for idempotency. If you accidentally send the same event twice with the same eventId, we'll only deliver it once.
AUTHENTICATION
All API requests require authentication using a Bearer token in the Authorization header:
API Key Types
| Key Type | Prefix | Use Case | Permissions |
|---|---|---|---|
| Live Secret Key | sk_live_ | Production server-side | Full API access |
| Test Secret Key | sk_test_ | Development & testing | Full API access (test mode) |
| Restricted Key | rk_live_ | Limited access scenarios | Custom permissions |
Never expose secret keys in client-side code, public repositories, or logs. Use environment variables and secrets management tools. Rotate keys immediately if compromised.
Webhook Signatures
When we deliver webhooks to your endpoints, we include a signature header so you can verify authenticity:
Always verify signatures before processing webhooks. Our SDKs handle this automatically:
ERROR HANDLING
The API uses conventional HTTP response codes to indicate success or failure:
| Code | Meaning | Description |
|---|---|---|
200 | OK | Request succeeded |
201 | Created | Resource created successfully |
400 | Bad Request | Invalid request parameters |
401 | Unauthorized | Invalid or missing API key |
403 | Forbidden | API key lacks required permissions |
404 | Not Found | Resource doesn't exist |
409 | Conflict | Resource already exists (idempotency) |
422 | Unprocessable | Valid JSON but invalid data |
429 | Rate Limited | Too many requests |
500 | Server Error | Something went wrong on our end |
Error Response Format
Every response includes a requestId. Include this when contacting support to help us investigate issues quickly.
NEXT STEPS
Now that you understand the basics, explore these resources to go deeper: