# create\_issue

`imerit_ango.sdk.SDK.`

## create\_issue(task\_id, content, content\_mentions, error\_codes, object\_id, position, page, page\_end, data\_index, plane, 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](/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"`
* **content:** string
  * The textual content of the issue describing the detected problem or requested correction.
  * 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"}]`
* **error\_codes:** List\[dict]
  * List of predefined error categories associated with the issue.
  * Example: `[{"category": "Wrong", "name": "Class", "key": "Wrong+Class"}]`
* **object\_id:** string
  * The identifier of the annotation object associated with the issue. If provided, the issue is attached to this object.
* **position:** int, List\[int]
  * The location of the issue within the asset.
  * Supported formats:
    * Image/Video: \[x, y]
    * Text: character\_index
    * Audio: \[start\_time, end\_time]
  * Example: `[25, 15]`
* **page:** int
  * The page index where the issue should be created.&#x20;
  * Used with multi-page image, PDF and video assets.&#x20;
* **page\_end:** int
  * The ending page index for issues spanning multiple pages.
  * Used with multi-page image, PDF and video assets.&#x20;
* **data\_index:** int
  * The index of the DICOM slice where the issue should be created.
* **plane:** MedicalPlane
  * The medical imaging plane associated with the issue location.
  * Medical plane options:
    * <kbd>MedicalPlane.Axial</kbd>
    * <kbd>MedicalPlane.Sagittal</kbd>
    * <kbd>MedicalPlane.Coronal</kbd>&#x20;

```python
from imerit_ango.models.enums import MedicalPlane
```

* **pct\_details:** dict
  * Additional metadata used for specialized PCT workflows.

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

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

* Confirm that the created issue appears in the list.

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

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

Create an issue at a specified location and frame

{% 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."
frame = 10
position = [25, 15]

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

{% 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]",
    "page": 10
  }'
```

{% 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](/sdk/sdk-documentation/project-level-sdk-functions/get_issues.md), [delete\_issue](/sdk/sdk-documentation/project-level-sdk-functions/delete_issue.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/create_issue.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.
