# Annotation Types

## Create Annotation Type

<mark style="color:green;">`POST`</mark> `https://api.annolab.ai/v1/annotation-type/create`

Create a new annotation type within your schema

#### Headers

| Name                                            | Type   | Description                                                                                                                                                        |
| ----------------------------------------------- | ------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| Authorization<mark style="color:red;">\*</mark> | string | <p>Where you put your api key. Creating a schema requires a key with "Write" permissions.<br><code>{"Authorization": "Api-Key XXXXXXX-XXXXXXX-XXXXXXX"}</code></p> |

#### Request Body

| Name                                                | Type    | Description                                                                                                                           |
| --------------------------------------------------- | ------- | ------------------------------------------------------------------------------------------------------------------------------------- |
| isRelation                                          | boolean | Whether the type being created is intended for use as an annotation relation type. Defaults to False                                  |
| color                                               | string  | <p>Hex code for the color of the annotation type <br><code>color: "#D00021B"</code> <br>if not provided it will be auto generated</p> |
| typeName<mark style="color:red;">\*</mark>          | string  | Name of the annotation type that will be created                                                                                      |
| projectIdentifier<mark style="color:red;">\*</mark> | string  | Identifier for the project that will contain the annotation type. Either the id or the unique name.                                   |
| category                                            | string  | Category grouping for the annotation type                                                                                             |
| isDocumentClassification                            | boolean | Boolean for whether the annotation type is a document  type classification                                                            |

{% tabs %}
{% tab title="201 Annotation type was created successfully" %}

```
{
    "schemaName": "NER",
    "schemaId": 7,
    "key": "place-name",
    "color": "#F882FD",
    "typeId": "51",
    "name": "Place Name"
}
```

{% endtab %}
{% endtabs %}

This code shows how to create a new annotation type

{% tabs %}
{% tab title="Python" %}

```python
import requests

ANNO_LAB_API_KEY = 'XXXXXXX-XXXXXXX-XXXXXXX-XXXXXXX'

annotationType = {
  'projectIdentifier': 'New NER Project',
  'category': 'NER',
  'typeName': 'Place Name' 
}

headers = {
  'Authorization': 'Api-Key '+ANNO_LAB_API_KEY,
}

url = 'https://api.annolab.ai/v1/annotation-type/create'

response = requests.post(url, headers=headers, json=annotationType)

print(response.json())
```

{% endtab %}
{% endtabs %}


---

# 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.annolab.ai/schemas-ontologies/annotation-types.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.
