How to poll status and export results
live-status reports one overall job_state plus a state per language in translations. Export is per language: call it once for each target language, only after that language’s own state is Completed.
live-status response shapes differ by file type, but the poll/export logic below works for both:
job_state, translations[].state, and translations[].target_language_code are present in both shapes. See Overview for full field lists.
Check each language’s own state, not only top-level job_state.
A job can stay Running or PartiallyCompleted while some languages in translations[] are already Completed and ready to export. Gate your export loop on translations[].state, not job_state alone.
format is optional. When omitted, the export uses the uploaded file’s native format. PDF uploads may optionally set format to pdf, docx, html, txt, or epub. Microsoft Office uploads always export in the original format only.
Example
Replace YOUR_SARVAM_API_KEY with your key from Key Management. This example assumes you already created a job, uploaded the file, and called start — see the Overview quickstart.
The sample above covers polling through export. See the Overview for the complete five-step flow including create, upload, and start.