Two submission paths
POST /v1/collections/{collection_id}/trigger creates one batch containing every object in the source bucket. There is no server-side splitting. Use it for buckets up to a few thousand objects.
POST /v1/buckets/{bucket_id}/batches/bulk-submit splits the bucket into batches of chunk_size objects (default 1,000, maximum 50,000) and submits each one. Use it for everything larger.
Picking a chunk size
Each batch runs as its own job. A job scales its workers with object count (roughly one CPU worker per 500 objects), up to a per-job worker ceiling. A batch of 16,000–20,000 objects saturates one job’s parallelism. Larger batches do not run faster; they only raise the cost of a mid-run failure. Going too small hurts the other way. Every batch pays a cluster cold-start, and only a fixed number of batches run at once (see the tier table). 1,200 batches of 1,000 objects serialize into deep queue waves and spend a large share of wall-clock on startup.
Calibrate before you commit: run one small batch (1,000 objects) and one at your target size, compare objects/hour and credits from the Billing usage page, then extrapolate. Media mix changes cost more than batch size does.
Concurrency and queueing
Submission is accept-and-queue. Batches past your concurrency limit park asQUEUED and promote automatically as running batches finish: highest priority first, then oldest first (see Priority). You do not pace submissions yourself.
Submission returns
429 only when a queue is truly full. Each running job also has a 24-hour execution deadline.
Backfill and one-at-a-time uploads
Most media libraries need two flows at once: a backfill of the existing catalog, then new files as they are published.
Run both against the same bucket and collection. A continuous sync groups the files one poll finds into batches of up to
batch_size (default 50), so a 60-second poll turns a burst of uploads into a few small batches.
A backfill fills your concurrent-batch slots. A new upload that arrives while every slot is busy waits for a slot to free, even at a higher priority, because a running batch is never pre-empted. Submit the backfill in chunks small enough that slots free up often, or keep it to fewer batches than your concurrency limit.
Priority
Every batch gets a priority from 0 to 9 when it is submitted, and keeps it for its whole run. Queued batches start highest first, oldest first within one value.
Priority comes from your account tier and the path you submit on. There is no field to set it per batch. To keep a backfill behind new uploads, create the backfill batches with
POST /v1/buckets/{bucket_id}/batches (a new batch stays DRAFT unless you pass auto_submit), then submit them all with submit-all. They run at priority 2, so batches from your sync go ahead of them in the queue.
Warm capacity
A batch that starts on an idle cluster waits for workers to start first. For a steady flow of single uploads with a latency target, Mixpeek can keep a fixed amount of processing capacity running for your account, so a new file starts without that wait. Mixpeek sets this up for you; there is no API for it. Contact your Mixpeek account team with the expected uploads per hour and the processing time you need.Automatic recovery
The platform heals transient failures without your involvement:- Failed tasks retry 3 times with exponential backoff.
- A worker that dies mid-task has its work redelivered to another worker.
- Reapers sweep every 1–10 minutes for orphaned, stuck, or stalled batches. They re-drive recoverable ones (bounded retries) and mark the rest failed.
- Failures tagged safe-to-resubmit are resubmitted automatically every 30 minutes.
- Batches that failed on transient errors retry hourly, up to 3 times, with 1/2/4-hour backoff.
FAILED or COMPLETED_WITH_ERRORS and wait for you to fix the cause, then resubmit.
Monitoring a run
Watch progress through the API, not by polling logs:GET /v1/buckets/{bucket_id}/batches/{batch_id}: status, per-tier progress, heartbeat freshness,documents_written,failed_object_count, anderror_summary.GET .../batches/{batch_id}/failed-documents: every failed object with its error, for targeted retries.- Batch diagnostics: deeper triage when a batch misbehaves.
batch_failed, batch_stalled, and batch_error_rate. They evaluate every 5 minutes and notify in-app plus any webhook, Slack, or email channel you configure. Without them, a failed batch is visible only if you go looking for it.
A batch can finish as
COMPLETED_WITH_ERRORS. Treat that as a work list, not a
verdict: read failed-documents, fix the cause, resubmit, and the ledger skips
everything already done.
