---
title: "Generate a custom token for a user"
method: POST
path: "/token/generate/"
tags: ["Accounts", "public"]
---

# Generate a custom token for a user

`POST /token/generate/`

Generate a custom token for a user that can be used to authenticate.

Requires "*" permission on the organization and its children, and the "allowUserTokenManagement" flag to be enabled on the organization.

## Headers

- `x-m2-organization-id` string, required

## Request body

- GenerateCustomTokenRequestSchema — The request body for generating a custom token
  - `userId` string, required — The user ID to generate a custom token for

## Response `200`

The response to generating a custom token

- object — The response to generating a custom token
  - `token` string, required — The generated custom token

---

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