Skip to main content

How to Set Up Deferral Webhooks for External Notifications

Set up webhook notifications to receive instant alerts in Slack, Zapier, or your own systems when the AI Assistant defers a message to a human coach.

Written by Xenios Charalambous
Updated over a month ago

When the AI Assistant defers a message to a human coach, you can receive an instant webhook notification to any external system — such as Slack, Zapier, Make, or your own custom application.


How to Enable Webhooks

  1. Click SettingsGeneral Settings

  2. Scroll to the Webhook Notifications section

  3. Toggle the webhook ON

  4. Enter your Webhook URL — the endpoint that will receive notifications

  5. Optionally enter a Webhook Secret for secure signature verification

  6. Click Save Webhook Settings


When Does the Webhook Fire?

A webhook is sent every time the AI Assistant detects that a client's message matches one of your configured Defer to Human Coach topics. Instead of the AI responding, the message is deferred and a notification is immediately sent to your webhook URL.


What Data Is Sent?

The webhook sends a POST request with a JSON payload containing:

Client Information

  • Client ID, Trainerize ID, first name, last name, and email

Message Details

  • Message ID, full message content, thread ID, and when it was received

Deferral Details

  • The topic that triggered the deferral (e.g., meal plan changes, injury advice, medical advice)

  • A human-readable reason for the deferral

Assigned Coach (if available)

  • Coach's Trainerize ID, name, email, and role


Request Headers

Every webhook request includes these headers:

  • Content-Type: application/json

  • User-Agent: FitMetrics-AI-Assistant-Webhook/1.0

  • X-FitMetrics-Event: message_deferred

  • X-FitMetrics-Delivery: Unique delivery ID for tracking

  • X-FitMetrics-Signature: HMAC-SHA256 signature (only if a webhook secret is configured)


Securing Your Webhook

If you provide a Webhook Secret, every request will include an X-FitMetrics-Signature header. This is an HMAC-SHA256 hash of the request body, formatted as:

sha256=<hex_encoded_signature>

To verify the webhook is genuinely from FitMetrics, compute the HMAC-SHA256 of the raw request body using your secret and compare it to the signature in the header.


Technical Details

  • Method: POST

  • Retries: Up to 3 attempts

  • Timeout: 30 seconds per attempt

All webhook deliveries are logged in your account for troubleshooting.


Use Cases

  • Slack notifications — Get alerted in a Slack channel when a client needs human attention

  • Zapier / Make workflows — Trigger automations in external tools when messages are deferred

  • Custom dashboards — Feed deferral data into your own monitoring or CRM system

  • Escalation workflows — Route urgent client messages to the right coach automatically

Did this answer your question?