Get async job status
const url = 'https://api.surveycoder.io/v2/jobs/job_1a2b3c4d5e6f7a8b9c0d1e2f';const options = {method: 'GET', headers: {'x-api-key': '<x-api-key>'}};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request GET \ --url https://api.surveycoder.io/v2/jobs/job_1a2b3c4d5e6f7a8b9c0d1e2f \ --header 'x-api-key: <x-api-key>'Poll an async job by ID. Returns progress percentage while processing, the full result on completion, or an error object on failure. Jobs auto-expire after 24 hours.
Authorizations
Section titled “Authorizations ”Parameters
Section titled “ Parameters ”Path Parameters
Section titled “Path Parameters ”Example
job_1a2b3c4d5e6f7a8b9c0d1e2fJob ID returned by an async endpoint (e.g. job_a1b2c3...).
Responses
Section titled “ Responses ”Job found
object
Full job object with optional result or error.
object
Unique job identifier.
Kind of background work.
Current job status.
Progress counters for the job.
object
Number of items processed so far.
Total number of items to process.
Completion percentage (0-100).
ISO 8601 timestamp when the job was created.
ISO 8601 timestamp of the last status update.
Present only when status is completed. Shape depends on
the job type. For one_call jobs, matches the data field
of CodeResponseSync.
object
Error details when a job fails.
object
Machine-readable error code.
Human-readable error message.
Example
{ "success": true, "data": { "id": "job_1a2b3c4d5e6f7a8b9c0d1e2f", "type": "codebook_generation", "status": "queued", "progress": { "processed": 120, "total": 500, "percentage": 24 }, "error": { "code": "CODING_FAILED", "message": "Codebook generation failed after 3 retries" } }}Missing or invalid API key.
Standard error envelope.
object
object
Machine-readable error code. See the error reference for the full list.
Human-readable explanation of what went wrong.
Echo of the X-Request-Id header, when provided.
Link to documentation for this specific error code.
Example
{ "success": false, "error": { "code": "UNAUTHORIZED", "message": "x-api-key header is required", "doc_url": "https://docs.surveycoder.io/errors/unauthorized" }}Resource not found.
Standard error envelope.
object
object
Machine-readable error code. See the error reference for the full list.
Human-readable explanation of what went wrong.
Echo of the X-Request-Id header, when provided.
Link to documentation for this specific error code.
Example
{ "success": false, "error": { "code": "NOT_FOUND", "message": "Project not found", "doc_url": "https://docs.surveycoder.io/errors/not-found" }}