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

# Auth Token

`POST /v1/oauth2/token`

Obtain OAuth 2.0 access token. This endpoint follows the OAuth 2.0 industry-standard protocol for authorization.
It performs authorization and returns the access token and refresh token.

To use, pass the `grant_type` in the form data, which will be:
- `client_credentials` grant type to authenticate with `client_id` and `client_secret`.
- `refresh_token` grant type to refresh an existing token.

If using `client_credentials` grant type, please use HTTP Basic Auth to pass the credentials
(with the username being the `client_id` and the password being the `client_secret`).

The `client_id` and `client_secret` can be passed in the form data, but this is deprecated and
not recommended.


Possible Codes in Error Response (see [Errors](https://docs.volteras.com/api-reference/errors) for error response schema and meaning of codes):

- AUTHENTICATION_ERROR
- REQUEST_VALIDATION_ERROR
- SERVER_ERROR

## Response `200`

Successful Response

- APIAccessToken — Schema of the APIAccessToken, returned by the authentication or refresh token
  - `access_token` string, required — The access token used for authenticated requests.
  - `token_type` string, required — Type of the token.
  - `expires_in` integer, required — Integer with the seconds that the access token will be expired in.
  - `refresh_token` string, required — The token used to refresh the authentication and retrieve a new access token.

---

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