Webhooks and Automations
Build custom integrations with real-time event notifications from define.wtf
Webhooks & Automations
Webhooks allow you to build custom integrations and automations around define.wtf. Subscribe to real-time events when acronyms are created, edited, voted on, or deleted, and trigger custom workflows in external systems.
What are Webhooks?
Webhooks are HTTP callbacks that define.wtf sends to your system whenever something happens. Instead of polling define.wtf for changes, define.wtf pushes notifications to you in real-time.
How it works:
- You register a webhook URL (your endpoint) in define.wtf
- Something happens in define.wtf (e.g., new definition created)
- define.wtf sends an HTTP POST to your webhook URL with event details
- Your system receives the event and responds with a 2xx status code
- You process the event (create Slack message, update database, trigger action, etc.)
Example flow:
New definition created in define.wtf
↓
define.wtf fires webhook
↓
POST https://example.com/webhooks/define
{
"event": "definition.created",
"definition": {...},
"timestamp": "2024-03-28T10:30:00Z"
}
↓
Your system receives event
↓
Your system creates Slack message: "#announcements: New acronym: OKR"Supported Events
define.wtf fires webhooks for all mutations (create, update, delete operations):
Acronym Events
| Event | When | Payload Includes |
|---|---|---|
acronym.created | New acronym added | Acronym details, term, description |
acronym.updated | Acronym edited (title/description) | Old and new values |
acronym.deleted | Acronym soft-deleted | Deletion timestamp, deleted_by user |
acronym.restored | Deleted acronym restored | Restoration timestamp |
acronym.locked | Admin locked acronym (prevents edits) | Lock timestamp, locked_by user |
acronym.unlocked | Admin unlocked acronym | Unlock timestamp |
acronym.deprecated | Acronym marked as deprecated | Deprecation reason |
Definition Events
| Event | When | Payload Includes |
|---|---|---|
definition.created | New definition added | Definition text, author, acronym_id |
definition.updated | Definition edited | Old and new text, edit timestamp |
definition.deleted | Definition deleted | Deletion timestamp, deleted_by user |
definition.set_primary | Admin set definition as primary | New primary definition |
Vote Events
| Event | When | Payload Includes |
|---|---|---|
vote.created | User upvoted definition | Voter, definition_id, vote_type (up/down) |
vote.deleted | User removed vote | Voter, definition_id |
Category Events
| Event | When | Payload Includes |
|---|---|---|
category.created | New category created | Category name, color, description |
category.updated | Category edited | Old and new values |
category.deleted | Category deleted | Deletion timestamp |
Collection Events
| Event | When | Payload Includes |
|---|---|---|
collection.created | New collection created | Collection name, acronyms |
collection.updated | Collection edited | Old and new values |
collection.deleted | Collection deleted | Deletion timestamp |
Tag Events
| Event | When | Payload Includes |
|---|---|---|
tag.created | New tag added | Tag name, usage count |
tag.deleted | Tag deleted | Deletion timestamp |
User Events
| Event | When | Payload Includes |
|---|---|---|
user.created | New user created (manual or SCIM) | User email, name, role |
user.updated | User profile updated | Old and new values |
user.deactivated | User deactivated | Deactivation timestamp |
user.authenticated | User logged in via SSO or email | Login method, IdP provider |
Webhook Payload Format
All webhooks use JSON format with this structure:
{
"event": "definition.created",
"timestamp": "2024-03-28T10:30:00Z",
"tenantId": "tenant-abc123",
"userId": "user-xyz789",
"data": {
"definition": {
"id": "def-123",
"text": "A goal-setting framework...",
"acronymId": "acr-456",
"author": "jane.doe@acme.com",
"votes": 5,
"createdAt": "2024-03-28T10:30:00Z"
}
}
}Standard fields:
| Field | Type | Description |
|---|---|---|
event | string | Event type (e.g., definition.created) |
timestamp | ISO 8601 | When the event occurred |
tenantId | string | Your workspace ID |
userId | string | User who triggered the event |
data | object | Event-specific details |
Setting Up Webhooks
Step 1: Prepare Your Endpoint
Create an HTTP endpoint (webhook URL) that:
- Accepts POST requests
- Can handle JSON payloads
- Returns HTTP 2xx status codes for success
- Verifies webhook signatures (recommended)
Example in Node.js (Express):
app.post('/webhooks/define', (req, res) => {
const event = req.body.event;
const data = req.body.data;
console.log(`Received event: ${event}`);
// Process the event
switch(event) {
case 'definition.created':
// Handle new definition
break;
case 'acronym.deleted':
// Handle deleted acronym
break;
}
// Acknowledge receipt
res.status(200).json({ success: true });
});Step 2: Register Webhook in define.wtf
- Navigate to Admin → Webhooks (or Settings → Webhooks depending on your version)
- Click Add Webhook
- Enter your webhook URL (e.g.,
https://example.com/webhooks/define) - Select which events to subscribe to (or select all)
- Click Create Webhook
Step 3: Test the Webhook
define.wtf provides a Test button:
- Go to Admin → Webhooks
- Find your webhook
- Click Send Test Event
- define.wtf sends a test payload to your endpoint
- Check your logs to verify receipt
Step 4: Monitor and Debug
After creating a webhook:
- Go to Admin → Webhooks
- Click your webhook to see delivery history
- View recent deliveries with timestamps, payloads, and response codes
- If deliveries are failing, check your endpoint logs
Verifying Webhook Secrets
Each webhook request includes a plaintext secret in the header for authentication:
Secret Verification
The webhook includes this header:
X-Webhook-Secret: your_webhook_secretVerification steps:
- Extract the secret from the
X-Webhook-Secretheader - Compare it to your stored webhook secret
- If they match, the request is from define.wtf
- If they don't match, reject the request (possible forgery)
Example in Node.js:
function verifyWebhook(req, storedSecret) {
const headerSecret = req.headers['x-webhook-secret'];
if (headerSecret !== storedSecret) {
throw new Error('Invalid webhook secret');
}
// Secret verified; process webhook
return true;
}Your webhook secret is shown when you create the webhook; store it securely and never commit it to version control.
Delivery Guarantee
define.wtf sends webhooks on a fire-and-forget basis:
- Timeout: 10 seconds per request
- Single attempt: Webhooks are sent once; no automatic retries
- Status codes: Any response is logged (success or failure)
- Logging: All deliveries are recorded for debugging
If your endpoint is unreachable or returns an error:
- Check your endpoint logs for errors
- Verify your endpoint is returning HTTP 2xx status codes
- Test your endpoint with the "Send Test Event" button in the webhook settings
- Re-send manually from the webhook delivery logs if needed
Common Use Cases
Use Case 1: Slack Notifications
Post new acronyms to a #announcements channel:
- Set up a webhook for
definition.createdevents - Your endpoint receives the event
- Format the definition as a Slack message
- Send to Slack via Incoming Webhook
- Your team sees: "#announcements: New: OKR — A goal-setting framework..."
Implementation: ~30 minutes with Zapier, or 1-2 hours with custom code.
Use Case 2: Activity Dashboard
Build a real-time dashboard of define.wtf activity:
- Set up webhooks for all events
- Your endpoint logs each event to a database
- Dashboard queries the database and displays:
- Most active today
- Most voted definitions
- Recent contributors
- Trending acronyms
Implementation: 2-4 hours with custom dashboard.
Use Case 3: Automated Data Sync
Keep your internal wiki or knowledge base in sync with define.wtf:
- Set up webhooks for
definition.createdanddefinition.updatedevents - Your endpoint receives events
- Your system updates the wiki/knowledge base
- Users always have the latest definitions
Implementation: 1-2 hours depending on target system.
Use Case 4: Approval Workflow
Send new definitions to your team for review before they're published:
- Set up webhook for
definition.created - Your endpoint stores the new definition in a pending queue
- Send email to approvers with review link
- Approvers approve/reject in your system
- On approval, publish to define.wtf via API
Implementation: 3-4 hours with custom workflow system.
Use Case 5: Compliance and Audit
Log all changes to a compliance system or SIEM:
- Set up webhooks for all mutation events
- Your endpoint sends events to your SIEM (Splunk, Datadog, etc.)
- Your SIEM creates searchable audit trail
- Security team can investigate changes and detect anomalies
Implementation: 1-2 hours with pre-built SIEM integrations.
Building Integrations with Zapier
Zapier is a no-code platform that can listen to define.wtf webhooks and trigger actions in hundreds of apps.
Step 1: Create a Zapier "Zap"
- Log into Zapier
- Click "Create Zap"
- Choose "Webhook" as the trigger
- Zapier provides a webhook URL
Step 2: Register Webhook in define.wtf
- Copy the Zapier webhook URL
- In define.wtf Admin → Webhooks, add the webhook
- Select events to subscribe to
- Save
Step 3: Test
- In define.wtf, create a new acronym
- Zapier receives the webhook event
- Configure the Zapier action (e.g., send Slack message)
- Test to verify it works
Step 4: Deploy
- Enable the Zap
- define.wtf events now trigger Zapier automations
- Monitor the Zapier activity log for issues
Example Zaps:
- "When definition created → Post to Slack"
- "When definition created → Add row to Google Sheet"
- "When definition created → Send email to admin"
- "When definition created → Create Monday.com task"
See Also
- Admin Guide: Webhooks — Setup and management
- REST API: Webhook Reference — Technical details
- Integrations: Overview — All integration options