# create\_issue

`imerit_ango.sdk.SDK.`

## create\_issue(task\_id, content, content\_mentions, object\_id, position, error\_codes, pct\_details)

Create an issue for the specified task with the provided configuration parameters.

### Parameters

* **task\_id:** string
  * ID of the task where the issue will be created. 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"`
* **content:** string
  * The text content of the issue.
  * Example: `"The bounding box here should reach the edges."`
* **content\_mentions:** List\[dict]
  * List of users to mention in the issue content.
  * Example: `[{"userEmail":"onur@imerit.net"}]`
* **object\_id:** string
  * ID of the object the issue is related to. If provided, the issue is attached to this object.
* **position:** List\[int]
  * Position, in pixels, of where the issue should be placed on the image asset.
  * Example: `[25, 15]`
* **error\_codes:** List\[dict]
  * Error codes to associate with the issue.&#x20;
  * Example: `[{"category": "Wrong", "name": "Class", "key": "Wrong+Class"}]`
* **pct\_details:** dict
  * Optional PCT-specific metadata for the issue.

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

Create an issue on a task

{% 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>"
content = "There is an inconsistency in the annotation."

ango_sdk.create_issue(task_id=task_id, content=content)
```

{% endtab %}

{% tab title="curl" %}

```bash
curl -X POST "https://imeritapi.ango.ai/v2/issues" \
  -H "Content-Type: application/json" \
  -H "apikey: $ANGO_API_KEY" \
  -d '{
    "content": "There is an inconsistency in the annotation.",
    "labelTask": "<YOUR TASK ID>"
  }'
```

{% endtab %}
{% endtabs %}

Create an issue on a specific object

{% 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>"
content = "This object seems incorrectly labeled."
object_id = "<YOUR OBJECT ID>"

ango_sdk.create_issue(task_id=task_id, content=content, object_id=object_id)
```

{% endtab %}

{% tab title="curl" %}

```bash
curl -X POST "https://imeritapi.ango.ai/v2/issues" \
  -H "Content-Type: application/json" \
  -H "apikey: $ANGO_API_KEY" \
  -d '{
    "content": "This object seems incorrectly labeled.",
    "labelTask": "$TASK_ID",
    "objectId": "$OBJECT_ID"
  }'
```

{% endtab %}
{% endtabs %}

Create an issue at a specified location

{% 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>"
content = "Please review this area."
position = [25, 15]

ango_sdk.create_issue(task_id=task_id, content=content, position=position)
```

{% endtab %}

{% tab title="curl" %}

```bash
curl -X POST "https://imeritapi.ango.ai/v2/issues" \
  -H "Content-Type: application/json" \
  -H "apikey: $ANGO_API_KEY" \
  -d '{
    "content": "Please review this area.",
    "labelTask": "$TASK_ID",
    "position": "[25, 15]"
  }'
```

{% endtab %}
{% endtabs %}

Mention a user in the issue content

{% 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>"
content = "Can you take a look at this @user@imerit.net?"
content_mentions = [{"userEmail":"user@imerit.net"}]

ango_sdk.create_issue(task_id=task_id, content=content, content_mentions=content_mentions)
```

{% endtab %}

{% tab title="curl" %}

```bash
curl -X POST "https://imeritapi.ango.ai/v2/issues" \
  -H "Content-Type: application/json" \
  -H "apikey: $ANGO_API_KEY" \
  -d '{
    "content": "Can you take a look at this @user@imerit.net?",
    "contentMentions": [
      {
        "userEmail": "user@imerit.net"
      }
    ],
    "labelTask": "$TASK_ID"
  }'
```

{% endtab %}
{% endtabs %}

Create an issue on an object and attach an error code to it

{% 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>"
content = "Wrong class assigned to this object."
object_id = "<YOUR OBJECT ID>"
error_codes = [{"category": "Wrong", "name": "Class", "key": "Wrong+Class"}]

ango_sdk.create_issue(task_id=task_id, content=content, object_id=object_id, error_codes=error_codes)
```

{% endtab %}

{% tab title="curl" %}

```bash
curl -X POST "https://imeritapi.ango.ai/v2/issues" \
  -H "Content-Type: application/json" \
  -H "apikey: $ANGO_API_KEY" \
  -d '{
    "content": "Wrong class assigned to this object.",
    "errorCodes": [
      {
        "category": "Wrong",
        "key": "Wrong+Class",
        "name": "Class"
      }
    ],
    "labelTask": "$TASK_ID",
    "objectId": "$OBJECT_ID"
  }'
```

{% endtab %}
{% endtabs %}

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

[get\_issues](https://docs.imerit.net/sdk/sdk-documentation/project-level-sdk-functions/get_issues), [delete\_issue](https://docs.imerit.net/sdk/sdk-documentation/project-level-sdk-functions/delete_issue)
{% endhint %}
