Docs › Best practices
Best practices
- Keep the key server-side, and pass only pre-signed URLs to browsers and apps.
- Store the
videoIdas soon as you create a video: it's how you resume, check status, or abort. - Retry safely. Send an
Idempotency-Keyheader withPOST /videos,POST /videos/{id}/complete, andPOST /videos/{id}/reprocess. Part uploads can be retried with fresh URLs. See Idempotency. - Use webhooks, not polling, to learn when videos finish (
video.ready,video.failed,captions.ready). If you must poll, check every 10–30 seconds and stop at a final status (SUCCEEDED,FAILED,TIMED_OUT,ABORTED). - Fetch download links when needed. They expire after 15 minutes, so don't cache them.
- Handle errors by the
errorcode, not by the message text.