# Create Location

## Create a new location

<mark style="color:green;">`POST`</mark> `https://api.xenia.team/v1/locations`

Create new location&#x20;

#### Headers

| Name                                            | Type      | Description   |
| ----------------------------------------------- | --------- | ------------- |
| Authorization<mark style="color:red;">\*</mark> | JWT Token | Access token  |

#### Request Body

| Name                                   | Type   | Description           |
| -------------------------------------- | ------ | --------------------- |
| name<mark style="color:red;">\*</mark> | string | The name of location  |
| description                            | string |                       |
| parentId                               | string | id of parent location |

{% tabs %}
{% tab title="200 Success" %}
{% code lineNumbers="true" fullWidth="true" %}
```json
{
    "id": "e77b6442-de60-401c-a173-0afc84a5747e",
    "name": "Main Branch",
    "description": "",
    "parentId": "",
    "createdAt": 1701743645
    "updatedAt": 2001743645
}
```
{% endcode %}
{% endtab %}

{% tab title="401 Permission denied" %}

{% endtab %}

{% tab title="400: Bad Request Validation failed" %}

{% endtab %}

{% tab title="500: Internal Server Error Something went wrong" %}

{% endtab %}
{% endtabs %}
