job_id; it does not mean the media is ready.
The production flow is:
Status values
completed and failed are terminal. Do not keep polling after either state.
Polling
PollGET /v1/job/{job_id}. This
request does not require an API key: the UUID is a private capability token.
- Use a bounded wait and a non-zero interval; never tight-loop.
- Persist
job_idbefore starting the wait. - A client timeout does not cancel the server task. Resume polling the same
job_idrather than submitting a replacement. - Move long waits to a background job instead of holding an interactive HTTP request open.
- Keep the UUID out of browser URLs, analytics, and public logs.
job_id.
Webhooks
Generation endpoints accept an optionalcallback URL. Use it when your
application already has a durable background or event-processing architecture.
- Return a successful response quickly and process media asynchronously.
- Expect duplicate, delayed, or missing delivery and deduplicate by
job_id. - Treat the callback as a notification, then fetch the canonical task with Get Task before persisting the final state.
- Keep polling as a recovery path for a callback that never reaches your system.
Retries and duplicate jobs
Legnext does not deduplicate submit requests by prompt. A repeated POST creates a new billable task.- Retry
429, transient5xx, network failures, and timeouts with capped exponential backoff and jitter. - Do not retry
400,401,402, or403unchanged. - If submit returned a
job_id, poll that task instead of resubmitting. - Use an application-level operation ID to prevent two workers from submitting the same user request.