---
title: "Create a token"
method: POST
path: "/auth/token"
tags: ["Access tokens"]
---

# Create a token

`POST /auth/token`

## Request

- Base URL: `https://api.sandbox.monite.com/v1`
- URL: `https://api.sandbox.monite.com/v1/auth/token`
- Auth: none declared. Required headers: `x-monite-version`

Create a new access token based on client ID and client secret.

## Headers

- `x-monite-version` string, required

## Request body

- object
  - `client_id` string, uuid, required: Your partner [client ID](https://docs.monite.com/get-started/credentials#get-credentials) obtained from the "API Credentials" section of Monite Partner Portal. Note that the sandbox and production environment use different client IDs.
  - `client_secret` string, required: Your partner [client secret](https://docs.monite.com/get-started/credentials#get-credentials) obtained from the "API Credentials" section of Monite Partner Portal. Note that the sandbox and production environment use different client secrets.
  - `entity_user_id` string, uuid: ID of the entity user to generate the access token for. Used only if `grant_type` is `entity_user`.
  - `grant_type` 'client_credentials' | 'entity_user', required

## Response `200`

Successful Response

- AccessTokenResponse
  - `access_token` string, required: The access token. Send it in the `Authorization: Bearer ACCESS_TOKEN` header in subsequent API calls.
  - `expires_in` integer, required: The token expiration time, in seconds.
  - `token_type` string, required: Always "Bearer".

## Other responses

- `400`: Possible reasons: * The specified client ID, client secret, or entity user ID is not found. Make sure you're using credentials for the correct environment (sandbox or production). * `entity_user_id` is not provided for `grant_type` = `entity_user`.
- `422`: A required request field is missing, or some field value has an invalid format.
- `429`: API rate limit has been exceeded. Check the response headers for the rate limit information.

---

[API](https://skmtc.dev/monite/apis/monite-2.md) - [All operations](https://skmtc.dev/monite/apis/monite-2/llms.txt) - [OpenAPI document](https://skmtc.dev/monite/apis/monite-2/revisions/4299ccf95edb?raw)
