---
title: "Session Token Authentication."
method: POST
path: "/auth/login"
tags: ["auth"]
---

# Session Token Authentication.

`POST /auth/login`

Login to the service and retrieve a session token for authentication.

## Request body

- AuthLogin — Request body for logging in.
  - `username` string, required
  - `password` string, password, required

## Response `200`

Success

## Other responses

- `400` — 400 Bad Request.
- `401` — 401 Unauthorised.
- `404` — 404 Not Found.
- `500` — 500 Unexpected Internal Server Error.

## Changes

- **2024-01-12** `9d667e94e36f` — 1 breaking, 1 warning, 1 info
  - added the new required request property `username`
  - removed the request property `email`
  - the `password` request property's minLength was decreased from `8` to `5`
- **2023-11-26** `b173cabb315f` — 2 breaking, 5 warning, 3 info
  - added the new required request property `email`
  - the `password` request property's minLength was increased from `5` to `8`
  - the optional response header `X-Api-Commit` removed for the status `200`
  - the optional response header `X-Api-Commit` removed for the status `400`
  - …6 more

[Change history](https://skmtc.dev/medama-io/apis/medama-analytics-api/changes/auth/login/post.md)

---

[API](https://skmtc.dev/medama-io/apis/medama-analytics-api.md) · [All operations](https://skmtc.dev/medama-io/apis/medama-analytics-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/medama-io/medama-analytics-api/revisions/7e58a00a419e/schema)
