> For the complete documentation index, see [llms.txt](https://developers.klasha.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://developers.klasha.com/~/revisions/UU3P5ANUZVJrY1nR5gP2/overview/token-generation.md).

# Token Generation

<mark style="color:green;">`POST`</mark> `{{env_url}}/auth/account/v2/login`

Passing your credentials to obtain a <mark style="color:red;">token</mark>.

#### Request body

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

#### Respond body

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

```json
{
    "message": "success",
    "error": null,
    "data": {
        "token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiYWRtaW4iOnRydWUsImlhdCI6MTUxNjIzOTAyMn0.KMUFsIDTnFmyG3nMiGM6H9FNFUROf3wh7SmqJp-QV30"
    }
}
```

{% endtab %}

{% tab title="400" %}

```json
{
    "message": "Invalid email or password.",
    "error": "wrong login details",
    "data": null
}
```

{% endtab %}
{% endtabs %}
