> For the complete documentation index, see [llms.txt](https://docs.datasaur.ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.datasaur.ai/api/get-data/check-job.md).

# Check job

Not all APIs are synchronous. Long-running processes are typically handled as jobs. To check whether a job has finished or to retrieve additional job information, use the following query.

* Query: [getJob](https://api-docs.datasaur.ai/#query-getJob)
* Input: `$jobId: string`

## Example request via cURL

```javascript
curl --location --request POST 'https://app.datasaur.ai/graphql' \
--header 'Authorization: Bearer <access_token>' \
--header 'Content-Type: application/json' \
--data-raw '{"operationName":"AutoLabelTokenBasedProjectMutation","variables":{"input":{"labelerEmail":"demo@datasaur.ai","options":{"numberOfFilesPerRequest":0,"serviceProvider":"CUSTOM"},"projectId":"HvdyIL2iwZn","targetAPI":{"endpoint":"https://custom-model.api.com/predict","secretKey":"secret"}}},"query":"mutation AutoLabelTokenBasedProjectMutation($input: AutoLabelTokenBasedProjectInput!) {  result: autoLabelTokenBasedProject(input: $input) {    id  status  progress  }}"}'
```

Below is a more readable version of the request body from cURL command above.

```javascript
{
    "operationName": "GetJobQuery",
    "variables": {
        "jobId": "AutoLabelQueue:dcbf6ed3-3841-46c1-8f6a-2affb53ac637"
    },
    "query": "query GetJobQuery($jobId: String!) {  result: getJob(jobId: $jobId) {    id  status  progress  }}"
}
```

* **operationName**: you can fill any alphanumeric string in as the operationName. `GetJobQuery` is fine as a default. Refer to [this page](https://graphql.org/learn/queries/#operation-name) to structure **operationName** properly.
* **query:** Copy it from the cURL example above.

## Example response

Here is the response when you execute the cURL command above.

```javascript
{
    "data": {
        "result": {
            "id": "AutoLabelQueue:dcbf6ed3-3841-46c1-8f6a-2affb53ac637",
            "status": "DELIVERED",
            "progress": 0
        }
    },
    "extensions": {}
}
```

If the status is already `DELIVERED`, then the job is finished.
