Skip to main content

Overview

This guide will help you set up Pixel Patrol and moderate your first piece of content in just a few minutes.

Prerequisites

Before you begin, you’ll need:
  • A Pixel Patrol account (Sign up here)
  • Your API credentials (found in your dashboard)
  • Node.js 16+ or any HTTP client

Step 1: Create Your First Site

Sites represent your applications or projects that need moderation.
1

Navigate to Sites

Go to the Sites page in your dashboard
2

Create a New Site

Click “Create Site” and fill in: - Name: Your application name - URL: Your application URL - Description: Brief description of your site
3

Save Your Site ID

After creation, copy your Site ID - you’ll need this for API calls

Step 2: Set Up Moderation Rules

Configure how content should be moderated for your site.
Use our pre-configured rule templates:
  1. Go to Rule GroupsCreate Rule Group
  2. Select a template (e.g., “Social Media Platform”)
  3. Adjust thresholds as needed
  4. Assign to your site

Step 3: Submit Your First Media

Now let’s submit content for moderation using the API.
curl -X POST https://api.pixelpatrol.net/functions/v1/submit-media \
  -H "Content-Type: application/json" \
  -d '{
    "api_key": "site_xxxxxxxxxxxxxxxxxxxx",
    "content_url": "https://example.com/image.jpg",
    "app_media_id": "user-upload-123",
    "metadata": {
      "user_id": "user123",
      "context": "profile_photo"
    }
  }'

Step 4: Check Moderation Results

You can check the moderation results in two ways:

Option 1: Polling

Check the status of your submitted media:
const checkStatus = async (mediaId) => {
  const response = await fetch(
    "https://api.pixelpatrol.net/functions/v1/get-media-status",
    {
      method: "POST",
      headers: {
        "Content-Type": "application/json",
      },
      body: JSON.stringify({
        api_key: "site_xxxxxxxxxxxxxxxxxxxx",
        media_id: mediaId,
      }),
    }
  );

  const result = await response.json();

  if (result.status === "completed") {
    console.log("Moderation result:", result.moderationResult);
    console.log("Action:", result.action); // 'approve', 'block', or 'review'
  }
};
Set up a webhook endpoint to receive real-time notifications:
  1. Go to your site settings
  2. Add your webhook URL
  3. Save the webhook secret for verification
// Example webhook handler
app.post("/webhook/moderation", (req, res) => {
  // Verify webhook signature
  const signature = req.headers["x-pixelpatrol-signature"];
  if (!verifyWebhookSignature(req.body, signature, WEBHOOK_SECRET)) {
    return res.status(401).send("Invalid signature");
  }

  const { mediaId, status, moderationResult, action } = req.body;

  // Handle the moderation result
  if (action === "block") {
    // Remove or hide the content
    blockContent(mediaId);
  } else if (action === "review") {
    // Flag for manual review
    flagForReview(mediaId);
  }

  res.status(200).send("OK");
});

Step 5: View Dashboard Analytics

Monitor your moderation activity in the dashboard:

Queue Page

View all submitted media and their moderation status

Media Details

Detailed view of individual media items with AI analysis

Site Analytics

Track moderation statistics and webhook performance

Usage Tracking

Monitor your API usage and limits

Next Steps

API Reference

Explore the complete API documentation

Integration Guides

Framework-specific integration tutorials

Advanced Features

Learn about AI providers, batch processing, and more

Best Practices

Optimize your moderation workflow

Support

Need help? We’re here for you: