---
title: "Obtain/Refresh Tokens"
method: POST
path: "/oauth/authorizations"
tags: ["OAuth"]
---

# Obtain/Refresh Tokens

`POST /oauth/authorizations`

This endpoint is used to obtain a new access token using various OAuth 2.0 grant types or refresh an existing token.

## Request body

- object
  - `client_id` string, required — The unique identifier for the client application requesting the token.
  - `client_secret` string, required — The secret key associated with the client application, used for authentication.
  - `grant_type` 'authorization_code' | 'refresh_token', required — The OAuth 2.0 grant type. Possible values: 'authorization_code' or 'refresh_token'.
  - `code` string — The authorization code received from the authorization endpoint. Required if 'grant_type' is 'authorization_code'.
  - `refresh_token` string — The refresh token used to obtain a new access token. Required if 'grant_type' is 'refresh_token'.

## Response `200`

- object
  - `request_id` string, required — Unique identifier for the request.
  - `error_code` integer, required — Numeric error code representing the status of the response. A value of `200` indicates success. <br> See the [Error Codes](/reference/error-manual#error-codes) section for more information.
  - `error_msg` string, required — Message detailing the status of the response.
  - `data` object, required
    - `access_token` string, required — The newly issued access token to be used for authorized API requests.
    - `refresh_token` string, required — A token that can be used to obtain a new access token once the current one expires.
    - `expires_in` integer, required — The duration in seconds until the access token expires.

---

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