# 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>
* **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.

### 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')
project_id = os.getenv('PROJECT_ID')

ango_sdk = SDK(api_key)

task_id = "$TASK_ID"
response = ango_sdk.review_task(task_id=task_id, review_status=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')
project_id = os.getenv('PROJECT_ID')

ango_sdk = SDK(api_key)

task_id = "$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 %}
{% endtabs %}
