Gain granular control over user actions with pre-hook events that allow you to intercept, validate, and modify user interactions before they’re processed. Perfect for implementing custom moderation rules, content filtering, and access control policies.

Overview

Pre-hook events enable you to create sophisticated moderation and control systems by intercepting user actions before they’re executed. This allows for:
Enterprise Feature: Pre-hook events are available for customers on the Max plan. Contact our sales team to upgrade your plan.

How It Works

Pre-hook events create a validation layer between user actions and their execution:

Response Types

Your webhook endpoint must respond with one of these actions:

Getting Started

1

Enable Pre-Hook Events

Configure pre-hook events through the Network Settings API.
2

Set Up Webhook Endpoint

Create an HTTPS endpoint to receive and process pre-hook events.
3

Configure Event Types

Specify which events you want to intercept and process.
4

Test & Monitor

Test your webhook with sample events and monitor response times.

Configuration

PUT /api/v3/network/settings/prehook

{
  "enabled": true,
  "callbackUrl": "https://your-app.com/webhooks/prehook",
  "defaultAction": "allow",
  "events": [
    "message.shouldCreate",
    "message.shouldUpdate",
    "post.shouldCreate"
  ]
}

Supported Events

Best Practices

Troubleshooting

Production Considerations: Always test pre-hook events thoroughly in a staging environment before deploying to production. Failed or slow webhook responses can impact user experience.