---
title: "Generate tokens to use Klara specific endpoint"
method: POST
path: "/core/latest/generic-token"
tags: ["Klara authentication generic"]
---

# Generate tokens to use Klara specific endpoint

`POST /core/latest/generic-token`

## Request

- Base URL: `https://api.klara.ch`
- URL: `https://api.klara.ch/core/latest/generic-token`
- Auth: none declared

Use this endpoint to get the access token for a specific user, and refresh token. <br />A grant_type of password is used for a Password grant, which requires username, password, access token, refresh token from scratch.<br />A grant_type of refresh_token is used for a Refresh token grant, which is used for acquiring the access token using refresh token.

## Response `200`

Token created

- PublicAPIToken: A public api token object. This object holds info of tokens that can be used to access KLARA Public API
  - `access_token` string: Token used to access KLARA Public API endpoints, should be place at Authorization header of request. Access token is valid only for one company tenant
  - `expires_in` integer: Amount of time in seconds left that the access token is valid for
  - `refresh_expires_in` integer: Amount of time in seconds left that the refresh token is valid for
  - `refreshToken` string: Token used to renew the access token
  - `token_type` string: Type of access token that should be included in the Authorziation header of each request

## Other responses

- `400`: Could not get token<br/><br/>Failures detected by a downstream service carry that service's own <code>code</code>, which this reference does not enumerate, so the <code>code</code> field may hold a value not documented here. Treat an unrecognised code as a generic failure of the status it arrives with, and do not branch on a code this reference does not list.
- `401`: Invalid credentials<br/><br/>Failures detected by a downstream service carry that service's own <code>code</code>, which this reference does not enumerate, so the <code>code</code> field may hold a value not documented here. Treat an unrecognised code as a generic failure of the status it arrives with, and do not branch on a code this reference does not list.
- `429`: API rate limit exceeded<br/><br/>Failures detected by a downstream service carry that service's own <code>code</code>, which this reference does not enumerate, so the <code>code</code> field may hold a value not documented here. Treat an unrecognised code as a generic failure of the status it arrives with, and do not branch on a code this reference does not list.
- `500`: Internal server error<br/><br/>Failures detected by a downstream service carry that service's own <code>code</code>, which this reference does not enumerate, so the <code>code</code> field may hold a value not documented here. Treat an unrecognised code as a generic failure of the status it arrives with, and do not branch on a code this reference does not list.

---

[API](https://skmtc.dev/klara/apis/klara-public-api.md) · [All operations](https://skmtc.dev/klara/apis/klara-public-api/llms.txt) · [OpenAPI document](https://skmtc.dev/klara/apis/klara-public-api/revisions/490b1a879fc2?raw)
