Skip to main content

Can I upload multiple files for one promotion?

Yes. The uploadIds field accepts an array of up to 10 upload IDs. Upload each file separately via the File API, then pass all IDs when creating the promotion.
{
  "uploadIds": ["upload-1-uuid", "upload-2-uuid", "upload-3-uuid"],
  "fileFormat": "pdf",
  ...
}
When a promotion has multiple files, each file is evaluated independently in parallel. The GET .../evaluation endpoint returns the result of the most recently completed evaluation. For full per-file results, use a webhook — you will receive one evaluation-completed event per file.

Can I re-evaluate the same version?

Yes. Each call to POST .../evaluate creates a new evaluation. When you poll with GET .../evaluation, you always receive the most recent result for that version. Previous evaluation results are retained internally for audit purposes.

Can I reuse an upload ID across promotions or versions?

Yes. Upload IDs are not consumed — the same upload can be referenced by multiple promotions or versions.

Do uploads expire?

No. Completed uploads are stored indefinitely. However, if you initiate an upload and never send any chunks, the upload session may eventually become unusable. Always complete uploads promptly after initiation.

Do I need webhooks, or can I just poll?

Either approach works:
  • Polling: Trigger evaluation, then poll GET .../evaluation every 5–10 seconds until status is succeeded or failed. Simple to implement but requires a polling loop.
  • Webhooks: Configure a webhook endpoint during onboarding. Adclear will POST the result to your endpoint when evaluation completes. No polling required, and you receive results as soon as they’re ready.
You can use both — poll as a fallback in case a webhook is delayed.

Can I delete or archive a promotion via the API?

No. The API does not currently support deleting or archiving promotions. Promotions are retained for compliance audit purposes.

Which fileFormat value should I use?

File TypefileFormat ValueNotes
PDF (.pdf)pdfMost common format
Images (.jpg, .png, .gif, .webp, .svg, .bmp, .tiff)imageSingle image per upload
Video (.mp4, .mov, .avi, .webm, .mkv, .wmv)video
Audio (.mp3, .wav, .aac, .ogg, .flac, .m4a)audio
Documents (.doc, .docx, .xls, .xlsx, .ppt, .pptx, .txt, .csv, .rtf)documentOffice files and plain text files
Inline text or HTML (no file upload)textUse content field instead of uploadIds
The fileFormat must match the type of file you uploaded. For example, if you uploaded a .pdf, use fileFormat: "pdf", not "document".

How do I generate types from the OpenAPI spec?

You can generate TypeScript types from the OpenAPI spec using tools like openapi-typescript:
npx openapi-typescript https://public-api.adclear.ai/v1/openapi.json -o adclear-api.d.ts
npx openapi-typescript https://files.adclear.ai/v1/openapi.json -o adclear-files.d.ts
Alternatively, explore the schemas interactively via the Swagger UI: