# 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

```python
assign_task(project_id: str, task_ids: List[str], stage_filter: str, email: str) 
```

* **project\_id:** string
  * The unique identifier for the project. You can find the project ID in [the user interface](https://docs.imerit.net/sdk/sdk-documentation/..#project-ids) or retrieve it using the [`list_projects`](https://docs.imerit.net/sdk/sdk-documentation/project-level-sdk-functions/list_projects) function.
* **task\_ids:** List\[str]
  * A list of task IDs to be assigned. Task IDs can be obtained [from the UI](https://docs.imerit.net/sdk/sdk-documentation/..#task-and-asset-ids), and from [get\_tasks](https://docs.imerit.net/sdk/sdk-documentation/..#get_tasks-project_id-page-limit-status).
  * 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 with which the user is to be assigned the task to register.
  * Example: `'user@example.com'`

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

{% 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 = '<example@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](https://docs.imerit.net/sdk/sdk-documentation/project-level-sdk-functions/get_tasks)
{% endhint %}
