# Get the status of a task

This service reports the status of a task.

A task is created when a service needs to perform a potentially long-running job. For instance, a task is created when you request to retry the push data [for failed trips](/enterprise/monitoring/request-to-retry-failed-trips.md) or [for failed crashes](/enterprise/monitoring/request-to-retry-failed-crashes.md).

When a task is created and awaits processing, its status is set to `PENDING`. Once processing begins, the status changes to `IN_PROGRESS`, and the `nbRemainingItems` field is updated as the task advances. Finally, when the task is completed, the status changes to `COMPLETED`, the `nbRemainingItems` field is set to 0, and the completion date is indicated in the `completedAt` field.

If the push trip service is paused while a task is in progress, its status is set to `CANCELED`.

{% hint style="info" %}
If you have your **enterprise API key**, you can try the API via this [**link**](https://drivequant.stoplight.io/docs/drivequant-public/5e79e30b6e2f9-get-the-current-status-of-a-task)**.**
{% endhint %}

{% openapi src="/files/QrSUgdcQKHBox7TTfgGW" path="/task/{taskId}" method="get" %}
[Enterprise.yaml](https://2525923625-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LXYIG5U3AO65YYFWJRK%2Fuploads%2FTTiLeuGg8U59w9k5PwxD%2FEnterprise.yaml?alt=media\&token=068f1889-59e6-4bc6-8b74-7a985dfce3cb)
{% endopenapi %}

### Response

The table below summarizes the response parameters.

<table><thead><tr><th width="220">Name</th><th width="118">Type</th><th>Description</th></tr></thead><tbody><tr><td><code>taskId</code></td><td><code>string</code></td><td>Unique identifier of the created task</td></tr><tr><td><code>createdAt</code></td><td><code>string</code></td><td>Date at which the task was created<br><em>Date format: <code>YYYY-MM-dd’T’HH:mm:ss.SSSZ</code></em></td></tr><tr><td><code>completedAt</code></td><td><code>string</code></td><td>Date at which the task was completed (if applicable)<br><em>Date format: <code>YYYY-MM-dd’T’HH:mm:ss.SSSZ</code></em></td></tr><tr><td><code>type</code></td><td><code>string</code></td><td>Type of task<br><em>Allowed values: <code>PUSH_FAILED_TRIPS</code>, <code>PUSH_FAILED_CRASHES</code></em></td></tr><tr><td><code>status</code></td><td><code>string</code></td><td>Status of the task<br><em>Allowed values: <code>PENDING</code>, <code>IN_PROGRESS</code>, <code>COMPLETED</code>, <code>CANCELED</code>, <code>FAILED</code></em></td></tr><tr><td><code>nbItems</code></td><td><code>integer</code></td><td>Total number of items to process</td></tr><tr><td><code>nbRemainingItems</code></td><td><code>integer</code></td><td>Number of items not yet processed</td></tr></tbody></table>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.drivequant.com/enterprise/monitoring/get-the-status-of-a-task.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
