---
title: "Retrieve a data query job"
method: GET
path: "/query/jobs/{job-id}"
tags: ["Data Queries"]
---

# Retrieve a data query job

`GET /query/jobs/{job-id}`

Retrieves a [data query](https://docs.zuora.com?resourceId=platform-data-query-overview) job. You can use this operation to track the status of the query job and obtain the URL of the query results.

If you are an administrator, you can retrieve every query job in your tenant. 

If you are a non-admin user and try to retrieve a query job that you are not the owner of, you will get a 403 response indicating that you are forbidden from viewing this job. As a non-admin user, you can only retrieve your own query job.

## Path parameters

- `job-id` string, uuid, required

## Headers

- `Accept-Encoding` string
- `Content-Encoding` string
- `Zuora-Entity-Ids` string
- `Zuora-Org-Ids` string
- `Zuora-Track-Id` string

## Response `200`

OK

- GetDataQueryJobResponse
  - `data` DataQueryJob — A data query job.
    - `createdBy` string, uuid — The query job creator's Id.
    - `id` string, uuid — Internal identifier of the query job.
    - `query` string — The query that was submitted.
    - `remainingRetries` integer — The number of times that Zuora will retry the query if Zuora is unable to perform the query.
    - `sourceData` string — Indicates the source that data queries run against: * `LIVE` represents the live transactional databases at Zuora (Data Query Live). * `WAREHOUSE` represents Zuora Warehouse, which has better performance and fewer limitations than the live transactional database. For more information, see <a href="https://docs.zuora.com?resourceId=platform-zuora-warehouse-overview" target="_blank">Zuora Warehouse</a>.
    - `updatedOn` string, date-time — Date and time when the query job was last updated, in ISO 8601 format.
    - `useIndexJoin` boolean — Indicates whether to use Index Join. See <a href="https://docs.zuora.com?resourceId=platform-data-query-practices" target="_blank">Index Join</a> for more information.
    - `dataFile` string, URL — The URL of the query results. Only applicable if the value of the `queryStatus` field is `completed`.
    - `outputRows` integer — The number of rows the query results. Only applicable if the value of the `queryStatus` field is `completed`.
    - `processingTime` integer — Processing time of the query job, in milliseconds. Only applicable if the value of the `queryStatus` field is `completed`.
    - `queryStatus` 'submitted' | 'accepted' | 'in_progress' | 'completed' | 'failed' | 'cancelled' — Status of the query job. * `submitted` - query submitted to query service for processing * `accepted` - query accepted by the query service * `in_progress` - query executed by the query service * `completed` - query execution completed by the query service * `failed` - query unable to be processed by the query service * `cancelled` - query cancelled by the user If the value of this field is `completed`, the `dataFile` field contains the location of the query results. If the value of this field is `accepted` or `in_progress`, you can use [Cancel a data query job](#operation/DELETE_DataQueryJob) to prevent Zuora from performing the query. Zuora then sets the status of the query job to `cancelled`.

## Other responses

- `403` — Forbidden
- `404` — Not Found

---

[API](https://skmtc.dev/zuora/apis/api-reference.md) · [All operations](https://skmtc.dev/zuora/apis/api-reference/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/zuora/api-reference/revisions/d11e237f3e54/schema)
