Modsift API Documentation
Comprehensive API reference for content moderation endpoints
Authentication
API Key Authentication
Use API keys for server-to-server communication and programmatic access to the Modsift API. This is the recommended method for production applications and automated workflows.
Include your API key in the Authorization header:
Cognito Authentication
Use Cognito authentication for web application access through the Modsift dashboard. This method is used when users interact with the platform through the browser interface.
For web application access, endpoints are available with the _cognito_ suffix after user login (e.g., /api/v1/moderation/moderate_cognito_)
Core Concepts
Severity Levels
The severity scale represents how serious a policy violation is. Each policy evaluates content and assigns a severity level from none (no violation) to very_high (critical violation).
none → very_low → low → medium → high → very_highPolicy Types
Modsift currently supports managed policies, which are professionally designed and maintained detection rules for common moderation scenarios.
Managed Policies: Pre-built by the platform (e.g., "Harassment Detection", "Profanity Detection")
Thresholds
Thresholds control the sensitivity of each policy by defining the minimum severity level that will trigger a flag. For example, setting a threshold to "medium" means only violations rated medium or higher will be flagged.
Determine when a detected violation should trigger an action. Can be set per policy within each profile and falls back to default_threshold if not specified.
Profiles
Profiles allow you to create different moderation strategies for different contexts. For example, you might use a strict profile for public comments and a lenient profile for private messages.
Collections of policies with specific threshold configurations. Enable different moderation strategies for different use cases. Can be set as account default or specified per request.
Types & Enums
SeverityLevel
Represents how serious a policy violation is. Used in moderation responses to indicate the detected severity.
"none" | "very_low" | "low" | "medium" | "high" | "very_high"
ThresholdValue
Defines the minimum severity level that will trigger a flag. Content with severity at or above the threshold will be flagged.
"very_low" | "low" | "medium" | "high" | "very_high"
PolicyType
Indicates whether a policy is a pre-built managed policy or a user-defined custom policy.
"managed" | "custom"
AttachedPolicy Object
Represents a policy attached to a profile with its configuration.
Core Moderation
/v1/moderatePrimary moderation endpoint for analyzing content against configured policies
Request Body Parameters
| Name | Type | Required | Description | Default |
|---|---|---|---|---|
content | string | Yes | The text content to moderate | - |
profile | string | No | Profile name to use for moderation | User's default profile |
policy_overrides | object | No | Threshold overrides per policy. Object with policy names as keys and ThresholdValue as values | {} |
include_reasoning | boolean | No | Include reasoning in response (not yet implemented) | true |
Request Example
Response Fields
| Field | Type | Description |
|---|---|---|
request_id | string | Unique request identifier (format: req_{12_hex_chars}) |
timestamp | string | ISO 8601 timestamp of the request |
overall_flagged | boolean | True if any policy triggered a flag |
policies | object | Results per policy with name, policy_type, flagged, severity, threshold_used, reasoning, and relevant_excerpt |
metadata.total_units_used | number | API units consumed by this request |
Response Example
Profile Management
/v1/profilesCreate a new moderation profile with policies and thresholds
Request Body Parameters
| Name | Type | Required | Description | Default |
|---|---|---|---|---|
name | string | Yes | Profile name Validation: Alphanumeric, hyphens, underscores only. Cannot start with '__' | - |
description | string | No | Profile description | "" |
attached_policies | object | No | Policies to attach. Object with policy names as keys and AttachedPolicy objects as values | {} |
default_threshold | ThresholdValue | No | Default threshold for policies without explicit threshold | "medium" |
is_default | boolean | No | Set as account default profile | false |
Request Example
Response Fields
| Field | Type | Description |
|---|---|---|
name | string | Created profile name |
created_at | string | ISO 8601 timestamp of creation |
Response Example
/v1/profilesList all moderation profiles for the authenticated user
Request Example
Response Fields
| Field | Type | Description |
|---|---|---|
profiles | array | List of profile summaries |
total | number | Total number of profiles |
Response Example
/v1/profiles/{profile_id}Get detailed information about a specific profile
Path Parameters
| Name | Type | Required | Description | Default |
|---|---|---|---|---|
profile_id | string | Yes | Name of the profile to retrieve | - |
Request Example
Response Fields
| Field | Type | Description |
|---|---|---|
name | string | Profile name |
description | string | Profile description |
attached_policies | object | Attached policies with configurations |
default_threshold | ThresholdValue | Default threshold |
is_default | boolean | Whether this is the default profile |
created_at | string | Creation timestamp |
last_modified_at | string | Last modification timestamp |
Response Example
/v1/profiles/{profile_id}Update an existing profile's configuration
Path Parameters
| Name | Type | Required | Description | Default |
|---|---|---|---|---|
profile_id | string | Yes | Current profile name | - |
Request Body Parameters
| Name | Type | Required | Description | Default |
|---|---|---|---|---|
name | string | No | New profile name (for renaming) Validation: Alphanumeric, hyphens, underscores only. Cannot start with '__' | - |
description | string | No | Updated description | - |
default_threshold | ThresholdValue | No | New default threshold | - |
is_default | boolean | No | Set/unset as default | - |
attached_policies | object | No | Replace all attached policies | - |
Request Example
Response Fields
| Field | Type | Description |
|---|---|---|
name | string | Profile name (possibly new) |
updated_at | string | Update timestamp |
status | string | Always "updated" |
Response Example
/v1/profiles/{profile_id}Delete a moderation profile
Path Parameters
| Name | Type | Required | Description | Default |
|---|---|---|---|---|
profile_id | string | Yes | Profile to delete | - |
Request Example
Response Fields
| Field | Type | Description |
|---|---|---|
name | string | Deleted profile name |
status | string | Always "deleted" |
deleted_at | string | Deletion timestamp |
Response Example
/v1/profiles/{profile_id}/policiesAttach one or more policies to a profile
Path Parameters
| Name | Type | Required | Description | Default |
|---|---|---|---|---|
profile_id | string | Yes | Profile to attach policies to | - |
Request Body Parameters
| Name | Type | Required | Description | Default |
|---|---|---|---|---|
name | string | Yes | Policy name (in each policy object) | - |
policy_type | PolicyType | Yes | "managed" or "custom" (in each policy object) | - |
threshold | ThresholdValue | Yes | Threshold for this policy (in each policy object) | - |
Request Example
Response Fields
| Field | Type | Description |
|---|---|---|
name | string | Profile name |
attached_policies | array | List of attachment results with name, status, and attached_at |
message | string | Success message |
Response Example
/v1/profiles/{profile_id}/policies/{policy_name}Detach a policy from a profile
Path Parameters
| Name | Type | Required | Description | Default |
|---|---|---|---|---|
profile_id | string | Yes | Profile name | - |
policy_name | string | Yes | Policy to detach (must be attached) | - |
Request Example
Response Fields
| Field | Type | Description |
|---|---|---|
name | string | Profile name |
policy_name | string | Detached policy name |
status | string | Always "detached" |
detached_at | string | Detachment timestamp |
Response Example
/v1/profiles/{profile_id}/policies/{policy_name}Update the threshold for a specific policy within a profile
Path Parameters
| Name | Type | Required | Description | Default |
|---|---|---|---|---|
profile_id | string | Yes | Profile name | - |
policy_name | string | Yes | Policy to update (must be attached) | - |
Request Body Parameters
| Name | Type | Required | Description | Default |
|---|---|---|---|---|
threshold | ThresholdValue | Yes | New threshold value Validation: Must be: very_low, low, medium, high, or very_high | - |
Request Example
Response Fields
| Field | Type | Description |
|---|---|---|
name | string | Profile name |
policy_name | string | Updated policy name |
threshold | ThresholdValue | New threshold |
status | string | Always "updated" |
updated_at | string | Update timestamp |
Response Example
Managed Policies
/v1/policies/managedList all available pre-built managed policies
Query Parameters
| Name | Type | Required | Description | Default |
|---|---|---|---|---|
search | string | No | Search by name or description | - |
limit | integer | No | Max results to return | 20 |
offset | integer | No | Pagination offset | 0 |
Request Example
Response Fields
| Field | Type | Description |
|---|---|---|
policies | array | List of managed policy objects with name, description, rules, created_at, and last_updated |
total | number | Total matching policies |
pagination | object | Pagination info with limit, offset, and has_more |
Response Example
/v1/policies/managed/{policy_name}Get detailed information about a specific managed policy
Path Parameters
| Name | Type | Required | Description | Default |
|---|---|---|---|---|
policy_name | string | Yes | Managed policy name Validation: Must exist in available managed policies | - |
Request Example
Response Fields
| Field | Type | Description |
|---|---|---|
name | string | Policy name |
description | string | Policy description |
rules | array | Array of detection rules |
created_at | string | Creation timestamp |
last_updated | string | Last update timestamp |
Response Example