> ## Documentation Index
> Fetch the complete documentation index at: https://www.hirebase.org/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Get Task Status

> ​Retrieve the current status and result of a specific task.

Check the status, progress, and output of an asynchronous task by providing its unique task ID. Tasks may take anywhere from a few seconds to several hours to complete, depending on the size of the request.

## Endpoint

```bash theme={null}
GET  /v2/tasks/{task_id}
```

## Path Parameters

<ParamField path="task_id" type="string" required>
  The [UUID](/docs/api-reference/jobs/export-jobs) of the task to query
</ParamField>

## Response

<ResponseField name="id" type="string">
  Unique identifier of the task
</ResponseField>

<ResponseField name="type" type="string">
  Type of the task — currently one of `"export_job_data"` (job exports) or `"export_expired_jobs"` (expired-job exports)
</ResponseField>

<ResponseField name="state" type="string">
  Current state of the task. The API returns these values lowercase:

  * `queued` — task accepted and waiting to be processed.
  * `processing` — task is currently being executed by a worker.
  * `finished` — task finished successfully; `result` is populated.
  * `failed` — task execution failed; see the `error` field for details.
</ResponseField>

<ResponseField name="progress" type="number">
  Task progress as a float between 0.0 and 1.0
</ResponseField>

<ResponseField name="created_at" type="string">
  ISO timestamp of when the task was created
</ResponseField>

<ResponseField name="updated_at" type="string">
  ISO timestamp of the last task update
</ResponseField>

<ResponseField name="started_at" type="string">
  ISO timestamp of when the task began processing
</ResponseField>

<ResponseField name="completed_at" type="string">
  ISO timestamp of when the task finished processing
</ResponseField>

<ResponseField name="user_id" type="string">
  ID of the user who initiated the task
</ResponseField>

<ResponseField name="error" type="string">
  Error message if the task failed, otherwise `null`
</ResponseField>

<ResponseField name="worker_id" type="string">
  ID of the worker node that processed the task
</ResponseField>

<ResponseField name="priority" type="integer">
  Priority level of the task (higher means more urgent)
</ResponseField>

<ResponseField name="notify" type="boolean">
  Whether a completion email will be sent to the account address for this task (set via the `notify` parameter on the export request)
</ResponseField>

<ResponseField name="input" type="object">
  Parameters passed to the task

  <Expandable title="Example for Exporting Jobs">
    <ResponseField name="query" type="object">
      Search query used to filter jobs
    </ResponseField>

    <ResponseField name="format" type="string">
      Format for export (e.g., "json", "csv")
    </ResponseField>
  </Expandable>
</ResponseField>

<ResponseField name="result" type="object">
  Output result from the task

  <Expandable title="Example Output for Exporting Jobs">
    <ResponseField name="download_url" type="string">
      Signed URL to download the result
    </ResponseField>

    <ResponseField name="file_size" type="integer">
      Size of the generated file in bytes
    </ResponseField>

    <ResponseField name="record_count" type="integer">
      Number of records in the exported file
    </ResponseField>

    <ResponseField name="expiry_time" type="string">
      ISO timestamp when the download URL will expire
    </ResponseField>
  </Expandable>
</ResponseField>

## Example Request

<CodeGroup>
  ```bash cURL theme={null}
  curl -X GET "https://api.hirebase.org/v2/tasks/YOUR_TASK_ID" \
    -H "x-api-key: YOUR_API_KEY"
  ```
</CodeGroup>

## Example Response

<CodeGroup>
  ```json filename theme={null}
  {
      "id": "8107c787-16b9-4763-af74-e2c789a5169n",
      "type": "export_job_data",
      "state": "finished",
      "progress": 1.0,
      "created_at": "2025-06-13T06:10:07.605000",
      "updated_at": "2025-06-13T06:10:08.647000",
      "started_at": "2025-06-13T06:10:07.723000",
      "completed_at": "2025-06-13T06:10:08.647000",
      "user_id": "68876d278da1b42f2878be12",
      "error": null,
      "worker_id": "worker-81ghedc2-4",
      "priority": 0,
      "input": {
          "query": {
              "job_titles": [
                  "Site/Civil Engineer"
              ],
              "keywords": null,
              "location_group": null,
              "location_types": [
                  "In-Person"
              ],
              "geo_locations": [
                  {
                      "city": "Richmond",
                      "region": "Virginia",
                      "country": "United States"
                  }
              ],
              "experience": null,
              "yoe": {
                  "min": 1.0,
                  "max": 6.0
              },
              "include_yoe": null,
              "company_types": null,
              "company_name": "companyxyz",
              "date_posted": null,
              "days_ago": null,
              "month": null,
              "salary": null,
              "include_no_salary": null,
              "currency": null,
              "job_types": [
                  "Full Time"
              ],
              "job_category": null,
              "industry": [
                  "Design",
                  "Construction"
              ],
              "sub_industry": [
                  "Architecture",
                  "Building Construction"
              ],
              "visa": "false",
              "include_expired": null,
              "hide_seen_jobs": null,
              "user_id": null,
              "company_slug": null,
              "job_slug": null,
              "job_board": null,
              "sort_by": "relevance",
              "sort_order": "desc",
              "page": 1,
              "limit": 10
          },
          "format": "json"
      },
      "result": {
          "download_url": "https://sfo3.digitaloceanspaces.com/joby-uploads/user/32245d278da1b42f2878fa12/0ff6c9b7-138f-4c14-b0d6-95425b81d75d.json?AWSAccessKeyId=DO007W2A88HAEEP9W6VH&Signature=WP0LSTZZNKRoIukxxhzkiW%2Fh5uI%3D&Expires=1752387007",
          "file_size": 3455,
          "record_count": 10,
          "expiry_time": "2025-07-13T06:10:08.024758"
      }
  }
  ```
</CodeGroup>

## Error Responses

<AccordionGroup>
  <Accordion title="401 Unauthorized">
    Returns when the `API key` is missing, invalid, or incorrect.
  </Accordion>

  <Accordion title="403 Forbidden">
    `{"detail": "Not authorized to view this task"}` — the task exists but belongs to a different account. Tasks are only visible to the API key that created them.
  </Accordion>

  <Accordion title="404 Not Found">
    Returns when the provided `task_id` is not valid.
  </Accordion>

  <Accordion title="500 Internal Server Error">
    Returns when an unexpected error occurs on the server.

    * Occurs during unhandled server-side failures or bugs that prevent the request from being processed.
  </Accordion>
</AccordionGroup>
