Skip to navigation

Create a moderation rule

This endpoint creates a moderation rule. A rule defines a named set of category conditions that determine what the moderation agent flags and which action it applies (cut, blur, beep, mute, or flag).

Each condition targets a detection category on an audio or video track. You can optionally specify a confidence threshold between 0 and 1. If you omit the threshold, the system uses the default value for that category.

How it works

  1. Send a POST request with a name and a non-empty conditions array.

  2. For each condition, specify a category, a type (audio or video), and optionally a threshold and an action.

  3. The response returns the ID of the created rule. Use this ID as ruleId when creating a moderation job.

A rule name must be unique. Each category can appear only once in a rule.

Example

A video platform creates a rule that flags nudity and graphic violence on the video track and mutes profanity on the audio track, then reuses it across every upload job.

Authentication

AuthorizationBasic

FastPix APIs are secured with Basic Authentication. Use your Access Token ID as the username and Secret Key as the password in the Authorization header of each API request.

  • Username: Access Token ID
  • Password: Secret Key

Activate your FastPix account to generate your API credentials. See the guide here

Request

This endpoint expects an object.
namestringRequired<=255 characters

A human-readable name for the rule. Must be unique within the workspace.

conditionslist of objectsRequired
One or more category conditions. A category can appear only once per rule.

Response

Moderation rule created successfully
successbooleanOptional
Shows the request status. Returns true for success and false for failure.
dataobjectOptional