---
title: "Creates a new static token for a user."
method: POST
path: "/users/{userId}/tokens"
tags: ["public", "TokenInfo"]
---

# Creates a new static token for a user.

`POST /users/{userId}/tokens`

This is only supported for users of type `service`.

## Path parameters

- `userId` string, required

## Request body

- TokenDefinitionRequest — Defines the token to be created.
  - `description` string — A description of the token. (Optional)
  - `expires_at` string — The time the token expires. If not set, the token will not expire. (Optional)
  - `id` string, required — Identifier of the token. Must be unique for the user.
  - `type` string, required — The type of the token. Can only be "static".

## Response `200`

The issued static token.

- TokenResponse — Token holds the token and its type.
  - `token` string, required
  - `type` string

## Other responses

- `400` — The request was invalid or the payload malformed.
- `403` — Calling user does not have permission to list tokens for this user.
- `409` — There is already a token with the given ID.

---

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