For a detailed list of job types, see Job Types Reference.
Prerequisites
- SDK installed and configured (see SDK Quickstart)
- An API key with appropriate permissions
Understanding jobs
Operations like file uploads, dataset refreshes, and certain queries run asynchronously. When you start one of these operations, you receive a job ID that you can poll for status updates.Job states
| State | Description |
|---|---|
pending | Job is queued and waiting to start |
running | Job is currently executing |
completed | Job finished successfully |
failed | Job encountered an error |
Getting job status
Retrieve the status of a specific job:Listing jobs
List all jobs, optionally filtered by status:Polling for completion
A common pattern is to poll until a job completes:Exponential backoff
For long-running jobs, use exponential backoff to reduce API calls:Handling job results
Different job types return different results:NQL query jobs
Dataset refresh jobs
Error handling
Handle job failures gracefully:Batch job monitoring
Monitor multiple jobs concurrently:Best practices
| Practice | Description |
|---|---|
| Use exponential backoff | Reduce API calls for long-running jobs |
| Set reasonable timeouts | Prevent indefinite waiting |
| Log progress | Track job state changes for debugging |
| Handle all states | Account for pending, running, completed, and failed |
| Implement retries | Retry failed operations when appropriate |
Troubleshooting
| Issue | Cause | Solution |
|---|---|---|
| Job stays pending | Queue backlog or resource constraints | Wait longer or contact support |
| Job fails immediately | Invalid input or permissions | Check error details and fix input |
| Timeout waiting | Job taking longer than expected | Increase timeout or check job complexity |
| 404 on job ID | Job expired or invalid ID | Verify job ID and check retention |

