# update\_tasks\_priority

`imerit_ango.sdk.SDK.`

## update\_tasks\_priority(project\_id, priority, filters)

Update the priority values of selected tasks within your project.

### Parameters

* **project\_id:** string
  * The unique identifier for the project. You can find the project ID in [the user interface](/sdk/sdk-documentation.md#project-ids) or retrieve it using the [`list_projects`](/sdk/sdk-documentation/project-level-sdk-functions/list_projects.md) function.
* **priority:** int
  * The new priority value assigned to the selected tasks.
  * **Note:** The priority value must be between -1000 and 1000. Higher values indicate higher priority.
* **filters:** dict, *default None*
  * A dictionary of filters to specify the tasks to requeue.
    * **taskIds:** List\[str]
      * List of task IDs used to directly update specific tasks.
    * **externalIds:** List\[str]
      * List of external IDs used to directly update specific assets.
    * **assetIds:** List\[str]
      * List of asset IDs used to directly update specific assets.
    * **batches:** List\[str]
      * List of batch IDs used to filter tasks belonging to specific batches.
    * **fromStageIds:** List\[str]
      * List of workflow stage IDs used to filter tasks currently located in specific stages.

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 `update_tasks_priority` function, you can validate the changes directly in Ango Hub.

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

* Ensure that the "Priority" column is enabled from the Columns dropdown.
* Filter the relevant tasks as needed.
* Verify that the priority values are correctly assigned to each task.

{% 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

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

ango_sdk = SDK(api_key)

sdk_response = ango_sdk.update_tasks_priority(
    project_id=project_id,
    priority=15,
    filters={"externalIds": ["image-1.jpg", "image-2.jpg"]}
)
```

{% endtab %}

{% tab title="curl" %}

```bash
curl -X POST "https://imeritapi.ango.ai/v2/project/$PROJECT_ID/updatePriority" \
  -H "Content-Type: application/json" \
  -H "apikey: $ANGO_API_KEY" \
  -d '{
    "filters": {
      "externalIds": ["image-1.jpg", "image-2.jpg"]
    },
    "priority": 15
  }'
```

{% endtab %}
{% endtabs %}

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

[get\_tasks](/sdk/sdk-documentation/project-level-sdk-functions/get_tasks.md), [get\_assets](/sdk/sdk-documentation/project-level-sdk-functions/get_assets.md)
{% endhint %}


---

# 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/update_tasks_priority.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.
