---
title: "# Getting access token for endpoints"
method: POST
path: "/v1/auth/token"
tags: ["Authentication"]
---

# # Getting access token for endpoints

`POST /v1/auth/token`

OAuth2 protocol is used to authorize Refresh/Access tokens.
To obtain the API, you should generate a refresh token and then request an access token using the /v1/auth/token endpoint.
The refresh token will be valid for 6 months, whereas the access token will be available for 2 hours.
After getting the access token, add Authorization: Bearer {accessToken} to the header to request access to the below endpoints.

## Request body

- object
  - `refresh_token` string

## Response `200`

AuthTokenResponse

- object
  - `expire_at` integer — When access token is expired at
  - `token` string — Access Token

## Other responses

- `401` — unauthorizedErrorSwagger is represents unauthorized error
- `422` — validationErrorSwagger is represents the erroneous cases
- `default` — genericErrorSwagger is represents the erroneous cases

---

[API](https://skmtc.net/picussecurity/apis/picus-rest-api.md) · [All operations](https://skmtc.net/picussecurity/apis/picus-rest-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/picussecurity/picus-rest-api/versions/cb0d02ee28f8/schema)
