# review\_task

`imerit_ango.sdk.SDK.`

## review\_task(task\_id, review\_status, pct\_details)

Automatically review a task by updating its review status and adding review details.

### Parameters

* **task\_id:** string
  * The unique identifier for the task. You can find the task ID in [the user interface](https://docs.imerit.net/sdk/sdk-documentation#task-and-asset-ids) or retrieve it using the [get\_tasks](https://docs.imerit.net/sdk/sdk-documentation/project-level-sdk-functions/get_tasks) function.
* **review\_status:** ReviewStatus

  * The review outcome to be applied to the task.
  * **Options:**
    * <kbd>ReviewStatus.ACCEPTED</kbd>
    * <kbd>ReviewStatus.REJECTED</kbd>&#x20;

  ```python
  from imerit_ango.models.enums import ReviewStatus
  ```
* **pct\_details:** dict
  * Additional review details, primarily used for PCT review workflows.
  * Example:
    * `{"reason": "Missing annotations", "errorCodes": ["E001", "E002"]}`

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.

<details open>

<summary><strong>How to verify in Ango Hub?</strong></summary>

After successfully executing the `review_task` function, you can validate the changes directly in Ango Hub.

Navigate to: **Projects → \[Your Project] → Tasks**

* Filter the relevant tasks as needed.
* Open a task and access the Stage History section from the right sidebar.
* Confirm that the task has been reviewed and the correct status has been applied.

{% hint style="info" %}
Changes made via the SDK are reflected in Ango Hub in near real-time. If updates are not immediately visible, please refresh the page.
{% endhint %}

</details>

### Example

Accept a task in review stage:

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

```python
import os
from dotenv import load_dotenv
from imerit_ango.sdk import SDK
from imerit_ango.models.enums import ReviewStatus

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

ango_sdk = SDK(api_key)

task_id = "YOUR_TASK_ID"
response = ango_sdk.review_task(task_id=task_id, review_status=ReviewStatus.ACCEPTED)
```

{% endtab %}

{% tab title="curl" %}

```bash
curl -X POST "https://imeritapi.ango.ai/v2/review/YOUR_TASK_ID" \
  -H "Content-Type: application/json" \
  -H "apikey: $ANGO_API_KEY" \
  -d '{
    "reviewStatus": "Accepted"
  }'
```

{% endtab %}
{% endtabs %}

Reject a task and include additional review details (applicable to PCT projects only):

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

```python
import os
from dotenv import load_dotenv
from imerit_ango.sdk import SDK
from imerit_ango.models.enums import ReviewStatus

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

ango_sdk = SDK(api_key)

task_id = "YOUR_TASK_ID"
pct_details = {
    "reason": "Missing annotations",
    "errorCodes": ["E001", "E002"],
}

response = ango_sdk.review_task(
    task_id=task_id,
    review_status=ReviewStatus.REJECTED,
    pct_details=pct_details,
)
```

{% endtab %}

{% tab title="curl" %}

```bash
curl -X POST "https://imeritapi.ango.ai/v2/review/YOUR_TASK_ID" \
  -H "Content-Type: application/json" \
  -H "apikey: $ANGO_API_KEY" \
  -d '{
    "pctDetails": {
      "errorCodes": [
        "E001",
        "E002"
      ],
      "reason": "Missing annotations"
    },
    "reviewStatus": "Rejected"
  }'
```

{% endtab %}
{% endtabs %}


---

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