---
title: "Add an API token"
method: POST
path: "/user/{userID}/token"
tags: ["user"]
---

# Add an API token

`POST /user/{userID}/token`

## Request

- Base URL: `https://api.zerotier.com/api/v1`
- URL: `https://api.zerotier.com/api/v1/user/{userID}/token`
- Auth: HTTP token

## Path parameters

- `userID` string, required

## Request body

- APIToken
  - `tokenName` string: user specified token name
  - `token` string: API Token. Minimum 32 characters. This token is encrypted in the database and can not be retrieved once set

## Response `200`

API Token added

- APIToken
  - `tokenName` string: user specified token name
  - `token` string: API Token. Minimum 32 characters. This token is encrypted in the database and can not be retrieved once set

## Other responses

- `400`: Bad request
- `401`: Authorization required
- `403`: Access denied
- `404`: Item not found

---

[API](https://skmtc.dev/zerotier/apis/zerotier-legacy-central-api.md) - [All operations](https://skmtc.dev/zerotier/apis/zerotier-legacy-central-api/llms.txt) - [OpenAPI document](https://skmtc.dev/zerotier/apis/zerotier-legacy-central-api/revisions/80c9c5bfd0a4?raw)
