---
title: "Token"
method: POST
path: "/v1/token"
tags: ["Authentication"]
---

# Token

`POST /v1/token`

## Request

- Base URL: `https://api.navigatr.app` (the document declares no server; this is the origin it was published from)
- URL: `https://api.navigatr.app/v1/token`
- Auth: none declared
- TypeScript: <https://skmtc.dev/navigatr/apis/navigatr-api/docs/v1/token/post.ts> (a function with typed inputs; its response is checked against the schema)

Get a token by logging in with your Keycloak credentials. `username` and `password` are required. See "Request body" below.
The `username` field can also be an e-mail address.

Returns **HTTP 200** containing bearer token:

    {
        "access_token": (str)
    }

Raises **HTTP 401** if username/password is incorrect.
Raises **HTTP 423** if the IP has exceeded the maximum number of login attempts.

## Request body `application/x-www-form-urlencoded`

- BodyAuthenticationToken
  - `grant_type` string, nullable
  - `username` string, required
  - `password` string, password, required
  - `scope` string
  - `client_id` string, nullable
  - `client_secret` string, password, nullable

## Response `200`

Successful Response

- KeycloakToken: Keycloak representation of a token object Attributes: access_token (str): An access token refresh_token (str): An a refresh token, default None id_token (str): An issued by the Authorization Server token id, default None
  - `access_token` string, required
  - `refresh_token` string, nullable
  - `id_token` string, nullable

## Other responses

- `401`: Unauthorized
- `422`: Validation Error
- `423`: Locked

## Changes

- **2026-08-06** `4039d06e340b`: 5 info
  - api operation id `Token_v1_token_post` removed and replaced with `authentication_token`
  - added the non-success response with the status `401`
  - added the non-success response with the status `423`
  - added the optional property `detail/items/ctx` to the response with the `422` status
  - …1 more
- **2025-11-20** `6eb631bcc695`: 3 breaking, 4 info
  - the `password` request property format changed from no format to `password`
  - response property `id_token` list-of-types was widened by adding types `null` to media type `application/json` of response `200`
  - response property `refresh_token` list-of-types was widened by adding types `null` to media type `application/json` of response `200`
  - request property `client_id` list-of-types was widened by adding types `null` to media type `application/x-www-form-urlencoded`
  - …3 more

[Operation history](https://skmtc.dev/navigatr/apis/navigatr-api/changes/v1/token/post.md)

---

[API](https://skmtc.dev/navigatr/apis/navigatr-api.md) - [All operations](https://skmtc.dev/navigatr/apis/navigatr-api/llms.txt) - [OpenAPI document](https://skmtc.dev/navigatr/apis/navigatr-api/revisions/efbd3c328549?raw)
