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