Moderation

Test policy (dry run)

Test a moderation policy with mock scores without saving results

post/v1/check/dry-run

Request

Request body

contentstring required

The user-generated content to moderate. For text, send the raw string. For images, send a URL or base64 data URI. For video, send a URL.

policyIdstring required

ID of the moderation policy to evaluate against. Use "default" if you have not created a custom policy.

contentType'text' | 'image' | 'video'

Type of content. Determines which AI models are used for scoring.

requestIdstring

Idempotency key. If you send the same requestId twice, you get the cached result instead of a duplicate check.

metadataobject

Attach context like userId or source. Stored with the decision for audit purposes.

mockScoresobject

Mock category scores for testing

Example request

{
  "content": "This is a sample text to moderate",
  "policyId": "default",
  "requestId": "req_abc123",
  "metadata": {
    "userId": "user_123",
    "source": "chat"
  },
  "mockScores": {
    "hate_speech": 0.9,
    "violence": 0.3
  }
}

Response

Dry run result

dryRunboolean
evaluationobject

Policy evaluation result

Example response

{
  "dryRun": true
}

Changes

No recorded changes to this operation across all 1 revision of this API.