Webhooks Integration
Master Regular Expressions in Real-Time
Configure Your Endpoint
Connect RegExLab to your CI/CD pipeline or team communication channel by registering a secure HTTPS endpoint. Once active, our dispatchers will push JSON notifications the moment your automated validation suite registers a pattern mismatch or a new community snippet clears peer review.
Navigate to Project Settings > Integrations and paste your webhook URL. Enable signature verification by generating a 256-bit HMAC secret. We recommend configuring a 5-minute retry window with exponential backoff to gracefully handle transient network drops. Your receiver must return a 2xx status code within 3 seconds to confirm successful ingestion.
Supported Triggers
Filter incoming signals to match your engineering workflow. RegExLab dispatches granular event types so your infrastructure only processes alerts that directly impact deployment stability or documentation syncs.
regex.test.failed
Fires when a unit test suite encounters a catastrophic backtracking loop or a mismatch against the expected string. Includes the failing pattern, input sample, and the exact character offset where validation broke.
snippet.published
Triggers when a community-contributed regex passes moderation and goes live on the public registry. Ideal for syncing validated patterns into your internal linting rules or developer wikis.
pattern.optimized
Dispatched after the engine automatically rewrites a lookbehind assertion or flattens nested quantifiers for better throughput. Contains the original expression and the compiled AST diff.
Request Schema
Every webhook delivery follows a strict schema to simplify parsing in Node.js, Python, or Go receivers. The payload includes a trace ID, event identifier, and a nested data object containing regex-specific metadata.
Verify incoming requests by comparing the x-regexlab-signature header against your secret. All payloads are UTF-8 encoded and compressed with gzip when exceeding 14KB. Below is a sample structure for a failed test notification:
{
"id": "evt_9a8b7c6d5e4f",
"type": "regex.test.failed",
"timestamp": "2024-11-15T08:32:14Z",
"project_id": "proj_alpha_team",
"data": {
"pattern": "^(\\d{3})-\\d{4}$",
"input": "867-5309-extra",
"error_code": "MATCH_MISMATCH",
"offset": 10,
"engine_version": "v4.2.1"
}
}