Playground
The Policy Playground API classifies images you provide. It works on every plan. Each upload, sample classification and re-test uses one manual classification; a classification that fails is given back. The app needs a policy first (400 “write a policy for this app first”).
By default the Playground uses your organization’s Playground app (playgroundAppId from
GET /v1/plan). Pass appId to classify against another app’s policy.
The image object
Section titled “The image object”{ "id": "5012", "creativeId": "ad80px1:...", "appId": "ad80.playground", "width": 1080, "height": 1920, "imageUrl": "https://api.ad80.dev/v1/images/12/ad80px1:...?exp=...&sig=...", "imageUrlExpiresAt": "2026-10-28T14:00:00Z", "createdAt": "2026-10-28T13:49:02Z", "sampleId": null, "classifications": 2, "job": { "id": "88123", "state": "done", "error": null }, "result": { "decision": "violates", "violatedRules": ["no-gambling"], "scores": [{ "ruleId": "no-gambling", "score": 0.88, "violates": true }], "description": "A slot machine with coins and the text ...", "explanation": "no-gambling: slot machine and casino chips", "policyVersion": 2, "scoredAt": "2026-10-28T13:49:20Z" }, "remaining": 185}job.state is queued, running, done or failed; result is set when done. decision is violates or
ok. remaining is the manual classifications left this period (null = no fixed limit).
Upload an image
Section titled “Upload an image”Scope write:policies. multipart/form-data with the part file (PNG, JPEG or WebP; the type is detected from the
bytes) and optionally appId. Answers 202 with the image; the classification runs in the background, so poll
GET /v1/playground/images/{id} until job.state is done or failed.
curl -s -X POST https://api.ad80.dev/v1/playground/images \ -H "Authorization: Bearer $AD80_API_KEY" \ -F "file=@banner.png"import os, time, requests
API = "https://api.ad80.dev"H = {"Authorization": f"Bearer {os.environ['AD80_API_KEY']}"}
with open("banner.png", "rb") as f: img = requests.post(f"{API}/v1/playground/images", headers=H, files={"file": f}, timeout=60).json()
while img["job"]["state"] in ("queued", "running"): time.sleep(2) img = requests.get(f"{API}/v1/playground/images/{img['id']}", headers=H, timeout=30).json()
print(img["job"]["state"], img.get("result"))import { readFile } from 'node:fs/promises';
const API = 'https://api.ad80.dev';const headers = { Authorization: `Bearer ${process.env.AD80_API_KEY}` };
const form = new FormData();form.append('file', new Blob([await readFile('banner.png')], { type: 'image/png' }), 'banner.png');let img = await (await fetch(`${API}/v1/playground/images`, { method: 'POST', headers, body: form })).json();
while (img.job.state === 'queued' || img.job.state === 'running') { await new Promise((r) => setTimeout(r, 2000)); img = await (await fetch(`${API}/v1/playground/images/${img.id}`, { headers })).json();}console.log(img.job.state, img.result);Errors: 400 (no file, empty file, no policy), 403 entitlement (allowance used up), 413 (too large), 415 (not PNG, JPEG or WebP), 422 (an image
that cannot be used, for example too many pixels; the message says which limit). The size and pixel limits are
configuration.
Uploading a byte-identical image again keeps its id but is a new classification.
List results
Section titled “List results”Scope read:creatives. Newest first: {"images": [ ... ], "nextCursor": "..."}, with cursor and limit (1 to
200, default 50).
Get one result
Section titled “Get one result”Scope read:creatives. One image, with result.description when available.
Re-test with the current policy
Section titled “Re-test with the current policy”Scope write:policies. Classifies the image again against the app’s current policy. 202 with the image. The earlier
result stays in your history.
Sample creatives
Section titled “Sample creatives”Scope read:creatives. Curated sample creatives with made-up brands:
{ "samples": [ { "id": "casino-banner", "title": "...", "description": null, "width": 320, "height": 50, "imageUrl": "https://api.ad80.dev/v1/images/0/..." } ] }Scope write:policies. Optional JSON body {"appId": "..."}. 202 with the same image object as an upload.