---
title: "Create an API key for the user that is currently authenticated."
method: POST
path: "/user/tokens/"
tags: ["user"]
---

# Create an API key for the user that is currently authenticated.

`POST /user/tokens/`

Create an API key for the user that is currently authenticated.

## Response `201`

Created an API key for the user that is currently authenticated.

- UserAuthenticationToken
  - `created` string, date-time — The time at which the API key was created.
  - `key` string — The unique API key used for authentication. This will be obfuscated on read-only HTTP methods.
  - `slug_perm` string — The slug_perm for token.

## Other responses

- `400` — User has already created an API key.
- `422` — Missing or invalid parameters (see detail).

---

[API](https://skmtc.dev/cloudsmith/apis/cloudsmith-api-v1.md) · [All operations](https://skmtc.dev/cloudsmith/apis/cloudsmith-api-v1/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/cloudsmith/cloudsmith-api-v1/revisions/4d7879df9b2f/schema)
