Skip to content

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.

{
"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).

POST /v1/playground/images

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.

Terminal window
curl -s -X POST https://api.ad80.dev/v1/playground/images \
-H "Authorization: Bearer $AD80_API_KEY" \
-F "file=@banner.png"

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.

GET /v1/playground/images

Scope read:creatives. Newest first: {"images": [ ... ], "nextCursor": "..."}, with cursor and limit (1 to 200, default 50).

GET /v1/playground/images/{id}

Scope read:creatives. One image, with result.description when available.

POST /v1/playground/images/{id}/retest

Scope write:policies. Classifies the image again against the app’s current policy. 202 with the image. The earlier result stays in your history.

GET /v1/playground/samples

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/..." } ] }
POST /v1/playground/samples/{id}/classify

Scope write:policies. Optional JSON body {"appId": "..."}. 202 with the same image object as an upload.