---
title: "Get new access and refresh token"
method: POST
path: "/oauth/token"
tags: ["Authentication"]
---

# Get new access and refresh token

`POST /oauth/token`

To get tokens using your login credentials you will need to set 'grantType' to 'password' and send it together with the 'username' and 'password'. To get tokens using refresh token you will need to set 'grantType' to 'refresh_token' and sent it together with the 'refreshToken'.

## Request body

- object
  - `grantType` 'password' | 'refresh_token', required
  - `refreshToken` string
  - `username` string — Employee email address
  - `password` string

## Response `200`

Tokens are successfully created. Copy 'accessToken' and add it to 'Authorization' header in format 'Bearer accessToken'. Access token will expire in 15 minutes so use received 'refreshToken' to generate new tokens

- object
  - `token` TokenResponse — Token object
    - `tokenType` 'Bearer' — Token type. It is always Bearer.
    - `accessToken` string — Access token used for authorization. Copy it to 'Authorization' header in format 'Bearer accessToken'
    - `expiredIn` integer — Expiration time for access tokens in seconds, default is 900.
    - `refreshToken` string — Refresh token used for getting new access token. It will expire in 30 days.

## Other responses

- `400` — Error while getting tokens.
- `401` — Error while getting tokens.

---

[API](https://skmtc.net/quinyx/apis/quinyx-user-api.md) · [All operations](https://skmtc.net/quinyx/apis/quinyx-user-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/quinyx/quinyx-user-api/revisions/24b687a6e18c/schema)
