> For the complete documentation index, see [llms.txt](https://docs.imerit.net/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.imerit.net/sdk/sdk-documentation/project-level-sdk-functions/get_task_history.md).

# get\_task\_history

`imerit_ango.sdk.SDK.`

## get\_task\_history(task\_history\_id, task\_id)

Get the stage history of a task.

### Parameters

* **task\_history\_id:** string, optional, *default None*
  * The unique identifier of the task history item.
  * Example: `'0000000aa0a00a0000aaaa0a'`
* **task\_id:** string, optional, default None
  * The unique identifier of the task whose history will be retrieved. Task IDs can be obtained [from the UI](/sdk/sdk-documentation.md#task-and-asset-ids), and from the [`get_tasks`](/sdk/sdk-documentation/project-level-sdk-functions/get_tasks.md) function.
  * Example: `'0000000aa0a00a0000aaaa0a'`

{% hint style="info" %}
Either **task\_history\_id** or **task\_id** must be provided when calling the `get_task_history` function.
{% endhint %}

Returns:

* **output:** dict
  * A dictionary containing the result of the operation.
  * Including a `status` field indicating whether the request was successful and a `data` field containing the response payload with updated resources produced by the operation.

### Example

Get the task history of a specific task.

{% tabs %}
{% tab title="python" %}

```python
import os
from dotenv import load_dotenv
from imerit_ango.sdk import SDK

load_dotenv('variables.env')
api_key = os.getenv('API_KEY')

ango_sdk = SDK(api_key)

task_id = "<YOUR TASK ID>"
sdk_response = ango_sdk.get_task_history(task_id=task_id)
```

{% endtab %}

{% tab title="curl" %}

```bash
curl -X GET "https://imeritapi.ango.ai/v2/task/$TASK_ID/history" \
  -H "Content-Type: application/json" \
  -H "apikey: $ANGO_API_KEY"
```

{% endtab %}
{% endtabs %}

<details>

<summary>Sample Output</summary>

```json
{
    "status": "success",
    "data": {
        "taskHistory": [
            {
                "id": "TASK_HISTORY_ID",
                "labelTaskId": "TASK_ID",
                "answer": {
                    "tools": [...],
                    "classifications": [...],
                    "relations": [...]
                },
                "createdAt": "2026-01-01T00:00:00.000Z",
                "project": "PROJECT_ID",
                "organization": "ORGANIZATION_ID",
                "asset": {
                    "id": "ASSET_ID",
                    "data": "DATA_URL",
                    "dataset": [],
                    "overlay": [],
                    "createdAt": "2026-01-01T00:00:00.000Z",
                    "createdBy": "user@imerit.net",
                    "editorType": "ango",
                    "project": "PROJECT_ID",
                    "organization": "ORGANIZATION_ID",
                    "externalId": "image.jpg",
                    "deleted": false,
                    "metadata": {
                        "width": 800,
                        "height": 600
                    },
                    "attachments": [],
                    "batches": [],
                    "isPrivate": true,
                    "storage": null,
                    "head": "DATA_URL",
                    "isPreLabeled": false,
                    "uploadStatus": "READY",
                    "_id": "ASSET_ID",
                    "labelTasks": [
                        "6a01a9c0c45ca18605830126"
                    ]
                },
                "deleted": false,
                "stage": "Label",
                "assignee": "user@imerit.net",
                "consensusDetailed": [],
                "consensusIteration": 0,
                "rework": false,
                "benchmarkDetailed": [],
                "duration": 20000,
                "idleDuration": 0,
                "blurDuration": 0,
                "updatedAt": "2026-01-00T00:00:00.000Z",
                "updatedBy": "user@imerit.net",
                "batches": [],
                "type": "default",
                "isSkipped": false,
                "_id": "TASK_HISTORY_ID"
            }
        ],
        "total": 1
    }
}
```

</details>

{% hint style="info" %}
**See also**

[get\_task](/sdk/sdk-documentation/project-level-sdk-functions/get_task.md)
{% endhint %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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.imerit.net/sdk/sdk-documentation/project-level-sdk-functions/get_task_history.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.
