# Getting Started

## Get your API keys

Your API requests are authenticated using API keys. Any request that doesn't include an API key will return an error.

You can generate an API key from your Dashboard at any time.

## Install the library

The best way to interact with our API is to use one of our official libraries:

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

```
# Install via NPM
npm install --save xenia
```

{% endtab %}

{% tab title="Python" %}

```
# Install via pip
pip install --upgrade xenia
```

{% endtab %}
{% endtabs %}

## Make your first request

To make your first request, send an authenticated request to the pets endpoint. This will create a `pet`, which is nice.

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

Take a look at how you might call this method using our official libraries, or via `curl`:

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

```
curl https://api.xenia.com/v1/locations  
    -u YOUR_API_KEY:  
    -d name='Hightstreet Branch'  
```

{% endtab %}

{% tab title="Node" %}

```javascript
// require the xenia module and set it up with your API key
const xenia = require('xenia')(YOUR_API_KEY);

const newLocation = await xenia.location.create({
    name: 'Hightstreet Branch',
})
```

{% endtab %}

{% tab title="Python" %}

```python
// Set your API key before making the request
xenia.api_key = YOUR_API_KEY

xenia.Location.create(
    name='Hightstreet Branch'
)
```

{% 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://developer.xenia.team/getting-started.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.
