---
title: "Generate an access token"
method: POST
path: "/v1/tokens"
---

# Generate an access token

`POST /v1/tokens`

**Purpose**: The purpose of this API is to generate a new access token for the authentication of the user. Businesses can use this token to access Zenoti APIs.

**Note**: The access token is valid only for 24 hours, post which you must generate a new token by invoking the Refresh an access token API.

## Request body

- object
  - `account_name` string, required — Name of your business account as mentioned in the Zenoti URL. For example, if your Zenoti URL is www.spabliss.zenoti.com, then spabliss is your account name.
  - `user_name` string, required — Username of the employee
  - `password` string, required — This is the password of the employee.
  - `grant_type` string, required — Enter the text "password" in this field.
  - `app_id` string, required — Unique identifier of the application. App id lets us know if the logged in user is a "Guest" or an "Employee".
  - `app_secret` string, required — Unique secret code of the application.
  - `device_id` string, required — Unique identifier of the device from which the token is getting generated.

## Response `200`

200

- object
  - `credentials` object
    - `access_token` string
    - `access_token_expiry` string
    - `refresh_token` string
    - `refresh_token_expiry` string
    - `token_type` string
    - `token_id` string
    - `app_id` string
    - `user_type` string
  - `login_policy_evaluation` object
    - `allowlogin` boolean
    - `policyaction` integer
    - `policyactiondata` unknown
    - `userid` unknown
    - `passwordexpiryreminder` boolean
  - `error` unknown

## Other responses

- `400` — 400

---

[API](https://skmtc.net/zenoti/apis/zenoti-authentication.md) · [All operations](https://skmtc.net/zenoti/apis/zenoti-authentication/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/zenoti/zenoti-authentication/versions/e628f892391a/schema)
