Asynchronous jobs
Four features take longer than a single HTTP request should: image filters and
overlays, website screenshots, and Minecraft
renders. Rather than hold the connection open, Aegis queues the work
and answers immediately with a jobId you collect the result from.
Job types
The job object
Both endpoints answer with the same record:
status moves through:
result is typed unknown in the spec on purpose — its shape is decided by the
render worker rather than the API, so it differs per job type and is not
pinned to a schema. Read it defensively. payload is the original job
parameters, echoed back for traceability.
Music never uses jobs. A player is long-lived state you drive directly, not work that finishes — see Music.
Waiting instead of polling
GET /v1/jobs/{id}/wait holds the request open until the job reaches a final
state, so you spend one request instead of a polling loop.
timeout is in seconds, between 1 and 300, and defaults to 30.
A wait that times out returns 504 with the job still attached — the same
body as a success, just a different status. Check the status code, or catch
the AegisError the SDK raises for it, and the job may well have finished
moments later.
Polling directly
GET /v1/jobs/{id} is a plain read and never blocks. Poll it at a sensible
interval rather than in a tight loop:
Polling costs you a cheap class request each time, which is metered — see
rate limits. Prefer wait when you can.
Expiry
Job records are kept for 24 hours. After that, both endpoints answer 404 with
"Job not found", and a jobId is no longer collectable.
The rendered image itself is a separate artefact and outlives the job record.
Copy the result URL when the job completes if you need it later.