Skip to main content

Overview

Query jobs let you query and export data asynchronously. Create a job, poll it until processing finishes, and then retrieve the results one page at a time. Jobs run in seconds for small queries and minutes for large queries. You can use them for recurring syncs or one-time exports. For targeted lookups, the normal endpoints can be faster and offer higher rate limits.

How it works

The following walkthrough uses sequence enrollments as an example.
1

Create a query job

Create a job for the data you want to query. This request queries all sequence enrollments:
The response includes the job ID, current status, and expiration time:
2

Poll the job

Poll the job until it reaches a terminal status:
A finished job includes the number of result rows:
3

Retrieve the results

After the job reaches FINISHED, retrieve each page of results:

Examples

Query records

Export records from an object.

Query enrollments

Export sequence enrollments.

Query enrollment steps

Export enrollment steps.

Query tasks

Export tasks.

Usage guide

Job endpoints

Each resource follows the same job management pattern summarized here. The API reference pages describe the available filters and results for each resource.

Job statuses

A query job has one of the following statuses: Jobs and results are available until expires_at, which is 24 hours after job creation. Retrieve all required pages before that time.

List and cancel jobs

List query jobs by sending a GET request to a resource’s query-jobs path. List endpoints accept the following query parameters: Cancel an in-progress job by sending a POST request to its cancel endpoint:
Only IN_PROGRESS jobs can be canceled.

Retrieve results

Result pagination is page based. Rows use a stable ordering with a tie-breaker, so pages remain stable for a finished job.

JSON

JSON is the default response format:
Request a smaller page or use NDJSON if a JSON page is too large.

NDJSON

Use NDJSON to stream larger pages:
NDJSON responses return one JSON object per line. Pagination metadata is returned in response headers:
The maximum NDJSON page_size is 10000.

Rate limits

Rate limits are applied by operation type: Poll conservatively, page through results with bounded concurrency, and reuse a finished job instead of creating another snapshot. If you receive 429 Too Many Requests, wait before retrying and honor the Retry-After header.

Best practices

  • Request only the data you need. Use filters and focused field selections to keep queries small and fast.
  • Design for retries. Store the job_id and current status.
  • Process results idempotently. Use stable record IDs so retrying a page does not create duplicates.
  • Use NDJSON for large pages. NDJSON streams results and supports larger pages than JSON.
  • Retrieve results before expiration. Create a new job if its results have expired.