Overview
Webhooks enable you to receive real-time notifications when important events occur in Explorium’s data ecosystem. This guide will walk you through setting up a webhook to receive push notifications for business and prospect events you’re interested in monitoring.Quick Start
- Register a webhook - Create a single webhook endpoint that will receive all event notifications
- Implement a secure receiver - Set up your handler to validate and process incoming events
- Test connectivity - Verify your webhook is configured correctly
- Enroll for events - Subscribe to specific events using the enrollment endpoints
- Process events - Receive and handle real-time events as they occur
Webhook Architecture
Each partner can register one webhook URL that serves as the destination for all event notifications. When you enroll businesses or prospects for event monitoring, all triggered events are sent to this webhook.To differentiate between various monitoring use cases, you can assign a unique enrollment_key when enrolling entities. This key is included in every event notification, allowing you to route and process events according to your internal systems.
Step 1: Register Your Webhook
Register a webhook URL where Explorium will send event notifications.Endpoint
- Method:
POST - URL:
https://api.explorium.ai/v1/webhooks
Request
JSON
Response
JSON
Optional Registration Parameters
In addition topartner_id and webhook_url, the registration endpoint accepts:
| Parameter | Type | Description |
|---|---|---|
headers | string[] | Custom HTTP headers Explorium sends with every event delivery, in "Header-Name: value" format. Use this to attach authentication (e.g. a bearer token) or any header your receiver requires. |
payload_format | string | Controls the shape of the delivered request body. json (default) sends the event object as-is. stringified_json wraps the event so it can be consumed by destinations that expect a single text field — see Using Webhooks with Claude Code Routines. |
Webhook Limitations
- You can register only one webhook URL per partner ID
- Registering a new webhook will override any previous webhook configuration and generate a new webhook secret
- All event notifications for a partner ID are sent to this single URL
Step 2: Implement Your Webhook Handler
Your webhook handler needs to:- Accept HTTP POST requests.
- Validate the signature to ensure event authenticity
- Process incoming event data based on the event type and enrollment key
Example Implementation (Python with FastAPI)
Python
Step 3: Test Webhook Connectivity
After implementing your webhook handler, verify it’s working correctly:Endpoint
- Method:
POST - URL:
https://api.explorium.ai/v1/webhooks/check_connectivity
Request
JSON
Response
JSON
- The system will send a test event to your webhook and return the response from your handler
Advanced Testing
Once your webhook is set, You can run more enhanced testing, that will allow you to:- Test with mock data for specific event types
- Validate your event handling logic with realistic event payloads
- Simulate various event scenarios for better integration testing
- event_name: event type to simulate (currently available types: new_office, closing_office, funding_round, new_investment, outages_and_security_breaches)
- number_of_events: the number of simulated events to receive.
Request:
JSON
Response:
JSON
- This will result in pushing 3 “funding_round” events to your webhook.
You can use the response to validate your event handling logic.
Step 4: Enroll for Events
Once your webhook is set up, you can enroll entities (businesses or prospects) for event monitoring.Business Enrollment Endpoint
Method:POSTURL:
https://api.explorium.ai/v1/businesses/events/enrollments
Example Request
JSON
Prospect Enrollment Endpoint
Method:POSTURL:
https://api.explorium.ai/v1/prospects/enrollments
Example Request
JSON
Key Enrollment Parameters:
enrollment_key: A custom identifier you provide to categorize this set of enrollments. You can use this to:- Group enrollments by customer/client ID
- Segment by monitoring campaign or use case
- Differentiate between different business processes
- This key will be included in each event notification, allowing you to route events appropriately
business_ids/prospect_ids: Business or prospect IDs to monitor (up to 20 per request)- While each request is limited to 20 IDs, there’s no limit on the total number of IDs you can enroll across multiple requests
- You can enroll thousands of entities by making multiple enrollment requests
Event Payload Structure
When an enrolled event is triggered, you’ll receive a payload like this:JSON
Key Fields:
enrollment_key: The identifier you provided during enrollmentevent_id: A unique identifier for this specific event event_name: The type of event that was triggered entity_type: Either “business” or “prospect” entity_id: The ID of the business or prospect that triggered the event data: Event-specific data (varies by event type)
Using Webhooks with Claude Code Routines
Claude Code routines can run automatically in response to an external HTTP request through an API trigger. You can point an Explorium webhook directly at a routine’s trigger URL so that every Explorium event fires the routine — and, with the rightpayload_format, the event data is delivered straight into the routine for processing. No relay or intermediate service is required.
How it works
A routine’s API trigger exposes a fire URL of the form:- Requires an
Authorization: Bearer <token>header (generated when you create the routine) and ananthropic-version: 2023-06-01header. - Injects the request body’s
textfield into the routine as its input, and ignores other top-level fields.
text field, Explorium’s default event object isn’t consumed by the routine on its own. Setting payload_format to stringified_json tells Explorium to deliver the event in a routine-compatible shape:
text value is the complete Explorium event object serialized as a JSON string, so the routine can parse it and act on the event.
Step 1 — Create the routine
In claude.ai → Code → Routines, create a routine and choose the API trigger (“Trigger from your own code by sending a POST request”). Copy:- the trigger’s fire URL, and
- the token generated for the trigger.
Step 2 — Register the webhook
Register the routine’s fire URL as your webhook, supplying the required headers andpayload_format: "stringified_json":
The
anthropic-version header is required — without it the routine endpoint rejects the delivery with a 400 error. Each event is delivered as a separate POST, so one routine run is triggered per event.Step 3 — Test it
Use the connectivity endpoint to push simulated events to your routine:"request_status": "success" response means the routine accepted the events. Open the routine’s sessions in claude.ai to see each event rendered and processed.
Managing Your Webhook
Get Webhook Details
Endpoint
Method: GETURL: https://api.explorium.ai/v1/webhooks/
Delete Your Webhook
Endpoint
Method: DELETEURL: https://api.explorium.ai/v1/webhooks/
Best Practices
- Use the enrollment_key effectively: Structure your enrollment keys to match your internal systems and use cases.
- Set up monitoring: Implement monitoring for your webhook endpoint to detect any delivery failures.
- Validate all signatures: Always verify the event signature to ensure authenticity before processing.
- Use proper Content-Type: Ensure your webhook handler accepts and responds with the application/json Content-Type.
Frequently Asked Questions
How many webhooks can I register per partner ID?
How many webhooks can I register per partner ID?
You can register only one webhook URL per partner ID. This URL will receive all event notifications.
Is there a limit to how many businesses or prospects I can enroll?
Is there a limit to how many businesses or prospects I can enroll?
While each enrollment request is limited to 20 IDs, there’s no limit on the total number of IDs you can enroll across multiple requests.
How do I differentiate between different monitoring use cases?
How do I differentiate between different monitoring use cases?
Use the enrollment_key parameter when enrolling entities. This key is included in every event notification, allowing you to route and process events according to your internal systems.
What happens if I register a new webhook?
What happens if I register a new webhook?
Registering a new webhook will override your previous webhook configuration and generate a new webhook secret. All event notifications will be sent to the new URL.
How can I test my webhook implementation?
How can I test my webhook implementation?
Use the /webhooks/check_connectivity endpoint to validate your webhook handler is properly receiving and processing events.
Can I trigger a Claude Code routine from a webhook?
Can I trigger a Claude Code routine from a webhook?
Yes. Point your webhook at the routine’s API-trigger fire URL, pass the routine’s
Authorization and anthropic-version: 2023-06-01 headers via the headers parameter, and set payload_format to stringified_json. See Using Webhooks with Claude Code Routines.