---
description: The authentication endpoint to login/out.
---

# Authentication

Authorization can be performed using a **session cookie** or an **API-key**.

## Login

<mark style="color:green;">`POST`</mark> `http://localhost:8080/auth/login`

Login using credentials or an API-key.

#### Query Parameters

| Name | Type    | Description                            |
| ---- | ------- | -------------------------------------- |
| json | Boolean | If the output should be in JSON format |

#### Headers

| Name    | Type   | Description  |
| ------- | ------ | ------------ |
| Api-Key | String | your API-key |

#### Request Body

| Name     | Type   | Description   |
| -------- | ------ | ------------- |
| username | String | Your username |
| password | String | Your password |

{% tabs %}
{% tab title="400: Bad Request Invalid Credentials or API-key." %}
```javascript
{
    // Response
}
```
{% endtab %}

{% tab title="200: OK Successful login." %}
```javascript
{
    // Response
}
```
{% endtab %}
{% endtabs %}

## Logout

<mark style="color:blue;">`GET`</mark>&#x20;

Logout

#### Query Parameters

| Name | Type    | Description                            |
| ---- | ------- | -------------------------------------- |
| json | Boolean | If the output should be in JSON format |

#### Headers

| Name    | Type   | Description   |
| ------- | ------ | ------------- |
| Api-Key | String | Your API-key. |
