Enterprise Content Moderation API

Enterprise-Grade Safety: Our API is designed for mission-critical applications with 99.9% uptime SLA, enterprise support, and real-time moderation at scale.

The Content Moderation API is a powerful, enterprise-grade solution designed to automatically detect and filter harmful content across text, images, videos, and audio with military-grade precision and sub-second response times.

Text Safety

Detect toxicity, hate speech, harassment, and spam across 100+ languages.

API Logic Flow & Decision Process

Intelligent Processing: Our API uses sophisticated decision trees and machine learning algorithms to determine the most appropriate moderation approach based on your parameters.

How the API Processes Your Request

Step 1: Parameter Validation
  • Required: content_type, moderate, api_key
  • Optional: threshold (default: 0.7), custom_instruction
  • If any required parameter is missing → 400 Bad Request
Step 2: Content Type Processing
  • text: Direct text analysis
  • text_custom_instruction: Uses your custom moderation rules
Step 3: Moderation Categories Decision
Scenario A: "standard" only

Uses 16 predefined categories: Finance, Health, Religion & Belief, Legal, Toxic, Insult, Public Safety, War & Conflict, Illicit Drugs, Profanity, Politics, Derogatory, Violent, Sexual, Death Harm & Tragedy, Firearms & Weapons

Scenario B: "standard" + custom words

Uses all 16 standard categories PLUS your custom moderation topics with custom words you defined (max 50 total)

Step 4: AI Analysis Process
  • Confidence Scoring: Determines confidence scores with respect to 16 standard moderation types
  • Text Parsing: Parses text to match words and phrases against 16 standard types and any additional custom ones added by user
  • Custom Instructions: Moderates text based on custom specific instructions which allows more granular control over moderation than by setting moderation types only. You can e.g. instruct our API to keep specific words even though they may belong to one of moderation types, or remove specific custom words even though they do not belong to one of moderation types
Step 5: Response Generation
  • moderation: Confidence scores for standard moderation types (JSON)
  • moderation_words: Specific phrases found matching your categories. Each matched phrase is represented in array as element [phrase, moderation type, start index of phrase in text, end index of phrase]
  • moderation_custom_instruction: Custom analysis result (if applicable)
  • status: 200 (success) or error code

Authentication

Secure Authentication: All API keys are encrypted at rest and in transit using AES-256 encryption with rotating keys.

API requests should be sent to the secure endpoint:

Base URL: https://www.contentmoderationapi.com/api/

A valid API key is required to access our enterprise API endpoints. API keys are available through our enterprise subscription plans. After obtaining a plan, log in to your dashboard to retrieve your unique API key.

Include your API key in all requests as a parameter:

api_key: your_api_key_here
Security Notice: Replace your_api_key_here with your actual API key. Keep your API key secure and never expose it in client-side code or public repositories.

Advanced Content Moderation

Submit a POST request with your content and specify which types of harmful content to detect. Our AI-powered engine analyzes content across multiple dimensions and returns detailed safety scores and classifications.

AI-Powered Detection: Our machine learning algorithms continuously improve detection accuracy, achieving 99.2% precision across all supported content types and languages.

Moderation Parameter Logic

Parameter Behavior: Understanding how the "moderate" parameter works is crucial for effective content moderation.

What happens with different "moderate" values?

Empty "moderate" Parameter
"moderate": ""

Result: API returns error

{ "error": "moderate parameter must be specified. Use 'standard' for default categories or provide comma-separated custom words (max 50)", "status": 400 }
"standard" Only
"moderate": "standard"

Result: Uses 16 predefined categories

  • Finance
  • Health
  • Religion & Belief
  • Legal
  • Toxic
  • Insult
  • Public Safety
  • War & Conflict
  • Illicit Drugs
  • Profanity
  • Politics
  • Derogatory
  • Violent
  • Sexual
  • Death, Harm & Tragedy
  • Firearms & Weapons
"standard" + Custom Words
"moderate": "standard,betting,gambling,crypto"

Result: Uses all 16 standard categories PLUS your custom words

  • All 16 standard categories
  • + betting
  • + gambling
  • + crypto

Note: Maximum 50 total categories allowed

Complete API Parameters

Parameter Type Required Possible Values Description
content string Required Any text or URL The text content to be analyzed for moderation.
content_type string Required text, text_custom_instruction Type of content to analyze. Supports text analysis and custom instruction moderation.
moderate string Required "standard" or comma-separated custom words Moderation categories. Use "standard" for 16 predefined categories, or specify custom words (max 50 total).
custom_instruction string Conditional Any instruction text Required when content_type is "text_custom_instruction". Your custom moderation instructions.
threshold float Optional 0.0 to 1.0 Confidence threshold for flagging content. Defaults to 0.7.
api_key string Required Your API key Your unique enterprise API key for authentication.

Enterprise SDKs & Code Examples

Production-ready code examples for seamless integration into your content platforms. All examples include error handling, retry logic, and security best practices.

Comprehensive Enterprise Example

The following example demonstrates our API analyzing potentially harmful content across multiple dimensions:

Text Moderation Request

curl -X POST -H 'Content-Type: application/x-www-form-urlencoded' \ -d 'content=This is some user-generated content to analyze for safety&content_type=text&moderate=standard,betting,gambling&api_key=your_api_key' \ 'https://www.contentmoderationapi.com/api/predict'

Python Integration

import http.client
import urllib.parse
import json
import logging

# Configure enterprise logging
logging.basicConfig(level=logging.INFO)
logger = logging.getLogger(__name__)

def moderate_content(content, content_type, moderation_types, api_key, threshold=0.7):
    """
    Enterprise-grade content moderation with error handling and logging
    """
    try:
        conn = http.client.HTTPSConnection("www.contentmoderationapi.com")
        
        payload = urllib.parse.urlencode({
            'content': content,
            'content_type': content_type,
            'moderate': ','.join(moderation_types),
            'threshold': threshold,
            'api_key': api_key
        })
        
        headers = {
            'Content-Type': 'application/x-www-form-urlencoded',
            'User-Agent': 'Enterprise-Content-Moderation/1.0'
        }
        
        conn.request("POST", "/api/predict", payload, headers)
        response = conn.getresponse()
        data = response.read().decode("utf-8")
        
        if response.status == 200:
            result = json.loads(data)
            logger.info(f"Content moderated - Status: {result.get('status', 'Unknown')}")
            return result
        else:
            logger.error(f"API request failed with status {response.status}")
            return None
            
    except Exception as e:
        logger.error(f"Content moderation failed: {str(e)}")
        return None
    finally:
        conn.close()

# Enterprise usage example
user_message = "Visit the best betting site for amazing odds and win big money now!"
moderation_types = ['standard', 'betting'] # Standard categories + betting
result = moderate_content(user_message, 'text', moderation_types, 'your_api_key')

if result:
    if result.get('status') == 200:
        print("✅ Content analyzed successfully")
        print("Moderation Confidence Scores:", result.get('moderation', 'N/A'))
        print("Specific phrases found matching your categories:", result.get('moderation_words', []))
        print("Each matched phrase is represented in array as element [phrase, moderation type, start index of phrase in text, end index of phrase]")
    else:
        print("⚠️ Content analysis failed")
        print("Error:", result.get('error', 'Unknown error'))
else:
    print("❌ Failed to connect to API")

Complete Response Examples

Successful Analysis Response

{ "status": 200, "moderation": "[{\"category\":\"Finance\",\"confidence\":0.87},{\"category\":\"Toxic\",\"confidence\":0.23},{\"category\":\"Health\",\"confidence\":0.12},{\"category\":\"Religion & Belief\",\"confidence\":0.05},{\"category\":\"Legal\",\"confidence\":0.34},{\"category\":\"Insult\",\"confidence\":0.19},{\"category\":\"Public Safety\",\"confidence\":0.08},{\"category\":\"War & Conflict\",\"confidence\":0.15},{\"category\":\"Illicit Drugs\",\"confidence\":0.03},{\"category\":\"Profanity\",\"confidence\":0.41},{\"category\":\"Politics\",\"confidence\":0.28},{\"category\":\"Derogatory\",\"confidence\":0.16},{\"category\":\"Violent\",\"confidence\":0.09},{\"category\":\"Sexual\",\"confidence\":0.07},{\"category\":\"Death, Harm & Tragedy\",\"confidence\":0.11},{\"category\":\"Firearms & Weapons\",\"confidence\":0.04}]", "moderation_words": [ ["money", "Finance", 45, 50], ["betting", "betting", 12, 19], ["win big", "gambling", 67, 73] ], "total_credits": 10000, "remaining_credits": 9987, "processing_time_ms": 234 }

Custom Instruction Response

When using content_type: "text_custom_instruction":

{ "status": 200, "moderation": "[{\"category\":\"Finance\",\"confidence\":0.45},{\"category\":\"Toxic\",\"confidence\":0.12},{\"category\":\"Health\",\"confidence\":0.08},{\"category\":\"Religion & Belief\",\"confidence\":0.03},{\"category\":\"Legal\",\"confidence\":0.22},{\"category\":\"Insult\",\"confidence\":0.05},{\"category\":\"Public Safety\",\"confidence\":0.04},{\"category\":\"War & Conflict\",\"confidence\":0.07},{\"category\":\"Illicit Drugs\",\"confidence\":0.01},{\"category\":\"Profanity\",\"confidence\":0.09},{\"category\":\"Politics\",\"confidence\":0.15},{\"category\":\"Derogatory\",\"confidence\":0.06},{\"category\":\"Violent\",\"confidence\":0.02},{\"category\":\"Sexual\",\"confidence\":0.03},{\"category\":\"Death, Harm & Tragedy\",\"confidence\":0.05},{\"category\":\"Firearms & Weapons\",\"confidence\":0.01}]", "moderation_words": [], "moderation_custom_instruction": "This content contains promotional language that may encourage financial risk-taking behavior. Consider adding disclaimer or warning labels.", "total_credits": 10000, "remaining_credits": 9986 }

Error Response Examples

Missing Required Parameter:

{ "error": "moderate parameter must be specified. Use 'standard' for default categories or provide comma-separated custom words (max 50)", "status": 400 }

Invalid Content Type:

{ "error": "content_type must be one of: text or text_custom_instruction", "status": 400 }

Enterprise Error Handling

Robust Error Handling: Our enterprise API provides detailed error responses with actionable guidance and 24/7 support escalation for critical issues.

All API responses include a status field. Status code 200 indicates successful processing. Our enterprise SLA guarantees comprehensive error reporting and rapid resolution.

HTTP Status Codes

Status Code Description Resolution
200 Success: Content successfully analyzed. ✅ Process the moderation results as needed.
400 Bad Request: Invalid content or parameters. 🔧 Verify content format and required parameters.
401 Unauthorized: Invalid or missing API key. 🔑 Check API key validity and permissions.
403 Quota Exceeded: Monthly request limit reached. 💳 Upgrade plan or purchase additional credits.
410 Content Load Error: URL could not be loaded or text too short. 📝 Verify URL accessibility or provide longer text.
411 Access Denied: Content blocked by security measures. 🔒 Content may be behind authentication or firewall.
429 Rate Limited: Too many requests per minute. ⏱️ Implement request throttling or increase rate limits.
500 Server Error: Internal processing error. 🆘 Contact enterprise support for immediate assistance.
24/7 Enterprise Support

Dedicated support team available around the clock for enterprise customers. Average response time: < 15 minutes for critical issues.

Contact Support
Status & Monitoring

Real-time API status dashboard with performance metrics, uptime monitoring, and proactive incident notifications.

View Status