Submit image moderation

Submit an image URL for moderation. The pipeline runs the always-on AI Adult General prohibition check (which folds in every enabled per-client custom category) plus the informational NSFW label when enabled. Pass a publicly reachable HTTP or HTTPS image. The classifiers fetch it directly. URLs that use another scheme, or that resolve to a private or internal network address, are rejected with 400 INVALID_REQUEST. Returns a job ID for polling or webhook delivery. Multipart requests allow at most eight non-file fields. Each field other than text must be at most 16,384 UTF-8 bytes. Oversized fields return 400; too many fields return 413.

POSThttps://api.omnifence.ai/api/v1/moderate/image

Requires the moderate:image scope. Requests without this scope receive a 403 FORBIDDEN response. See authentication.

Request#

Headers#

Name Type Required Description
Authorization string Yes Your API key as a Bearer token: Bearer YOUR_API_KEY.

The request fields are described in Image moderation.

Example request#

cURLShell
curl -X POST https://api.omnifence.ai/api/v1/moderate/image \
  -H "Authorization: Bearer $OMNIFENCE_API_KEY" \
  -F "image=https://example.com/photo.jpg" \
  -F "webhook_url=https://your-app.com/webhooks/omnifence"  # optional

Responses#

202 Accepted#

Field Type Always present Description
job_id string (uuid) Yes
status string Yes One of queued.
Example responseJSON
{
  "job_id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
  "status": "queued"
}

503 Service Unavailable#

Moderation intake is busy or a dependency is unavailable. Capacity rejections include Retry-After (seconds); retry with backoff and jitter. SUBMISSION_STATUS_UNKNOWN includes a job_id: poll it before submitting again because acceptance could not be confirmed.

Field Type Always present Description
error string Yes
message string Yes
statusCode integer Yes One of 503.
job_id string (uuid) No Recovery ID when the acceptance outcome is unknown.
Example responseJSON
{
  "error": "string",
  "message": "string",
  "statusCode": 503,
  "job_id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890"
}