# assign\_task

`imerit_ango.sdk.SDK.`

## assign\_task(project\_id, task\_ids, stage\_filter, email)

Assign a list of tasks to a specific user.

### 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.
* **task\_ids:** List\[str]
  * A list of task IDs to be assigned. 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', '0000000bb0b00b0000bbbb0b']`
* **stage\_filter:** string
  * ID of the stage on which the assignee will work.
  * Example: `"206f2f63-ac2d-4458-92d8-b84fd7264db3"` or, in the case of the default labeling stage, `"Label"`.
* **email:** string
  * The email address of the project member who will be assigned to the task.
  * Example: <kbd>'<user1@example.com>'</kbd>

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.

{% hint style="warning" %}
Assigning a task to a new user replaces the current assignee for that task.
{% endhint %}

<details open>

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

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

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

* Filter the task using the Task ID or other relevant filters.
* Confirm that the tasks have been assigned to the correct project member.

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

task_id = '<YOUR TASK ID>'
email = 'user1@example.com'

ango_sdk.assign_task(
    project_id=project_id, 
    task_ids=[task_id], 
    stage_filter='Label', 
    email=email
)
```

{% endtab %}

{% tab title="curl" %}

```bash
curl -X POST "https://imeritapi.ango.ai/v2/task/assign" \
  -H "Content-Type: application/json" \
  -H "apikey: $ANGO_API_KEY" \
  -d '{
    "project": "$PROJECT_ID",
    "stage": "Label",
    "tasks": ["<YOUR TASK ID>"],
    "user": "<example@example.com>"
  }'
```

{% endtab %}
{% endtabs %}

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

[get\_tasks](/sdk/sdk-documentation/project-level-sdk-functions/get_tasks.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/assign_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.
