---
title: "Obtaining access_token and refresh_token tokens."
method: POST
path: "/rest/auth/token/"
tags: ["Authorization"]
---

# Obtaining access_token and refresh_token tokens.

`POST /rest/auth/token/`

This method allows you to get <code>access_token</code> and <code>refresh_token</code> through two scenarios:<br>
    <ul>
    <li> exchanging <code>authorization_code</code> for tokens</li>
    <li> exchange of <code>refresh_token</code> for tokens (token refresh operation)</li>
    </ul>

## Request body

- AuthorizationRequest
  - `grantType` 'authorization_code' | 'refresh_token', required — Authorization grant type
  - `token` string, required — Authorization code when grant type is <code>authorization_code</code> or Refresh token when grant type is <code>refresh_token</code>
  - `developerId` string, nullable — Developer UUID (optional)

## Response `201`

Credentials

- AuthorizationResponse
  - `accessToken` string — Access token
  - `accessTokenExpireAt` string, date-time — Access token expire date
  - `refreshToken` string — Refresh token
  - `refreshTokenExpireAt` string, date-time — Refresh token expire date

## Other responses

- `401` — Authorization failed
- `403` — Invalid authorization code
- `422` — Invalid Accept header value

---

[API](https://skmtc.dev/apilo/apis/apilo-rest-api.md) · [All operations](https://skmtc.dev/apilo/apis/apilo-rest-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/apilo/apilo-rest-api/revisions/a0f9dcdba6cc/schema)
