moderation_engine_failed webhook describing what went wrong.
This event is additional. It does not replace
moderation_engine_approved or moderation_engine_blocked — you still receive the usual decision event for the same message.What happens to the message
A failure never changes how a message is handled. Your error-handling setting decides that, exactly as before — On OpenAI Error and On Custom API Error under Moderation → Settings → Advanced Settings.Block Message applies the rule’s configured action, which is not always a block.
If the rule’s action is to flag for review, a failure flags the message rather than
blocking it, and
outcome reads approved. The message is only blocked when the
rule’s action list includes blocking.The response contract
A 400 from your endpoint does not mean “this content is bad”. It means your endpoint did not answer, and your On Custom API Error setting takes over.Failure categories
Time limits are 2 seconds for Custom API and 5 seconds for OpenAI text moderation. OpenAI image moderation scales with the number of images — 5 seconds for the first, 3 seconds for each additional one, capped at 30 seconds.
Example payload
A Custom API endpoint that returned HTTP 500 while moderating an image.Fields
data
failures[]
failures[].context
Reading the payload correctly
One event per moderation pass
All failures from a single pass arrive in one event, infailures[] — not one event per failure. Two failing rules produce one event with two entries.
A message can still produce two events when it is moderated twice. An image with a caption goes through text moderation and then image moderation, and each pass reports separately. Use contentType to tell them apart.
Because Block Message stops evaluation at the first failure, failures[] holds what actually ran, not everything configured.
responseBody is opaque text
It is capped at 2 KB and may be cut mid-string, so it is not guaranteed to be valid JSON even when your endpoint returned JSON. responseBodyTruncated tells you when it was cut. Treat it as text for diagnostics — do not parse it.
When no event is sent
Only a failure of the engine itself produces this event. Problems on the CometChat side do not:Enabling the event
Enable it in the CometChat Dashboard under:Application → Webhooks → Create Webhook → Triggers → ModerationBasic Auth and retry-on-failure work exactly as they do for your other webhooks.