Quickstart

Submit your first moderation request in under five minutes

This guide walks you through authenticating, submitting a moderation request, and checking the result.

The Omnifence agent skill works with any coding agent. It teaches the agent to find every place your app handles content and to wire the moderation calls for you.

Prerequisites#

  • A Omnifence account. Sign up at the dashboard. Your organization is provisioned automatically on first signup.
  • An API key. Create one from the API Keys page in the dashboard. The raw value is shown once at creation, so copy it immediately.
  • cURL or any HTTP client.

Steps#

1. Authenticate

Include your API key as a Bearer token in the Authorization header with every request.

Shell
export OMNIFENCE_API_KEY="your_api_key_here"

2. Submit an image moderation request

Send an image URL for moderation. The API returns a job ID immediately. Use POST /api/v1/moderate/text to moderate text instead, or POST /api/v1/moderate/video for a video URL, or POST /api/v1/moderate/audio for an audio clip.

Shell
curl -X POST https://api.omnifence.ai/api/v1/moderate/image \
  -H "Authorization: Bearer $OMNIFENCE_API_KEY" \
  -F "image=https://example.com/photo.jpg"
ResponseJSON
{
  "job_id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
  "status": "queued"
}

3. Check job status

Poll the job endpoint with the returned job_id.

Shell
curl https://api.omnifence.ai/api/v1/job/a1b2c3d4-e5f6-7890-abcd-ef1234567890 \
  -H "Authorization: Bearer $OMNIFENCE_API_KEY"
ResponseJSON
{
  "is_prohibited": false,
  "nsfw": false,
  "job_id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
  "type": "image",
  "status": "completed",
  "created_at": "2026-05-19T12:00:00.000Z",
  "completed_at": "2026-05-19T12:00:05.000Z"
}

A rejected job adds a reason that names the policy or custom category that tripped.

RejectedJSON
{
  "is_prohibited": true,
  "reason": "The image contains references to coffee and coffee beans (coffee).",
  "nsfw": false,
  "job_id": "0cc5a7aa-aeb5-4395-9fa0-324611ec34c3",
  "type": "image",
  "status": "completed",
  "created_at": "2026-08-10T16:40:41.352Z",
  "completed_at": "2026-08-10T16:40:44.146Z"
}

4. Set up a webhook (optional)

Instead of polling, register a webhook to receive results automatically.

Shell
curl -X POST https://api.omnifence.ai/api/v1/webhook/register \
  -H "Authorization: Bearer $OMNIFENCE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"url": "https://your-app.com/webhooks/omnifence"}'
ResponseJSON
{
  "message": "Webhook URL registered successfully",
  "url": "https://your-app.com/webhooks/omnifence"
}

When the job completes, the API POSTs the result to your URL. The payload carries the same decision fields as the job endpoint, plus a delivery_id for deduplication. It carries no type and no created_at.

Delivered payloadJSON
{
  "is_prohibited": true,
  "nsfw": false,
  "reason": "The image contains references to coffee and coffee beans (coffee).",
  "job_id": "8298ed3d-b2e9-409d-9084-bb481934476a",
  "status": "completed",
  "completed_at": "2026-08-10T16:42:49.655Z",
  "delivery_id": "wh_8298ed3d-b2e9-409d-9084-bb481934476a"
}

Every callback is signed with your account's signing secret, following the Standard Webhooks specification. Verify the signature before you act on a payload — find your secret in the dashboard under Account → Webhooks.

See webhooks for verification, the full field list and the retry behaviour.

Next steps#