API Documentation

Submit content for moderation via our REST API

Base URL: https://moderantai.com

Authentication

All API requests require an API key. Include your API key in the request header:

X-API-Key: YOUR_API_KEY

Sign up to get your API keys and start moderating content.

Endpoints

POST /api/v1/moderate

Submit a text or image item for moderation.

Request Headers

X-API-Key Your API key required
Content-Type application/json required

Request Parameters

Parameter Type Description
queue string Queue slug to submit to (can be in request body or query parameter) *
item.content_type string Either "text" or "image" *
item.text_content string The text content to moderate (required if content_type is "text")
item.image file The image file to moderate (required if content_type is "image")
item.id string Custom identifier that you can use to match against your own system

Example: Submit Text

curl -X POST https://moderantai.com/api/v1/moderate \
  -H "X-API-Key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "queue": "customer-support",
    "item": {
      "content_type": "text",
      "text_content": "This is the content to moderate"
    }
  }'

Example: Submit Image

curl -X POST "https://moderantai.com/api/v1/moderate" \
  -H "X-API-Key: YOUR_API_KEY" \
  -F "queue=customer-support" \
  -F "item[content_type]=image" \
  -F "item[image]=@/path/to/image.jpg"

Response: Success (201 Created)

{
  "id": 123,
  "state": "unprocessed",
  "queue": "customer-support"
}

Response: Error (401 Unauthorized)

{
  "error": "Missing API key or queue parameter"
}

{
  "error": "Invalid API key"
}

{
  "error": "Queue not found or not accessible with this API key"
}

Response: Error (422 Unprocessable Entity)

{
  "errors": [
    "Content type can't be blank",
    "Text content can't be blank"
  ]
}

Item States

Items flow through the following states:

unprocessed

Initial state when item is submitted

flagged

Item has been flagged for human review

compliant

Item approved (webhook notification sent)

non_compliant

Item rejected (webhook notification sent)

Webhooks

Configure webhooks to receive notifications when items are processed (approved or rejected).

Webhook Payload

Generic webhooks receive a standardized payload with metadata and item details:

{
  "id": "550e8400-e29b-41d4-a716-446655440000",
  "event": "item.compliant",
  "timestamp": "2025-11-13T10:30:00.000Z",
  "payload": {
    "item_id": 123,
    "queue_name": "Your Queue Name",
    "state": "compliant",
    "content_type": "text",
    "text_content": "The moderated content",
    "processed_at": "2025-11-13T10:29:45.000Z",
    "violated_rules": []
  }
}

Webhook Structure

id string Unique UUID for this webhook event
event string Event type: "item.compliant", "item.non_compliant", or "item.flagged"
timestamp string ISO8601 timestamp when webhook was sent
payload object Item data and violation details

Sign up to configure webhooks for your moderation queue.

Note: Slack and Discord webhooks use platform-specific formats optimized for those services.

Rate Limits

Currently, there are no rate limits enforced. Please use the API responsibly.

Support

For API support or questions, please contact support@moderantai.com.