---
title: "Create a new Token"
method: POST
path: "/{username}/tokens"
tags: ["Tokens"]
---

# Create a new Token

`POST /{username}/tokens`

## Request

- Base URL: `https://io.adafruit.com/api/v2`
- URL: `https://io.adafruit.com/api/v2/{username}/tokens`
- Auth: one of:
  - API key in header `X-AIO-Key`
  - API key in header `X-AIO-Signature`
  - API key in query parameter `X-AIO-Key`

## Path parameters

- `username` string, required

## Request body

- object
  - `token` string

## Response `200`

New Token

- Token
  - `token` string

## Other responses

- `401`: Unauthorized
- `403`: Forbidden
- `404`: Not Found
- `500`: Server Error

## Changes

- **2016-09-08** (v2) `db91bfb03a83`: 1 info
  - added the non-success response with the status `401`

[Operation history](https://skmtc.dev/adafruit/apis/adafruit-io-rest-api/changes/:username/tokens/post.md)

---

[API](https://skmtc.dev/adafruit/apis/adafruit-io-rest-api.md) - [All operations](https://skmtc.dev/adafruit/apis/adafruit-io-rest-api/llms.txt) - [OpenAPI document](https://skmtc.dev/adafruit/apis/adafruit-io-rest-api/revisions/b16cd6123537?raw)
