---
title: "Create a PAT"
method: POST
path: "/user/personal-access-tokens"
tags: ["user-personal-access-tokens"]
---

# Create a PAT

`POST /user/personal-access-tokens`

Create a new personal access token for the authenticated user.

Use personal access tokens for server-to-server or CLI integrations where interactive user login is not practical.

Important behavior:

- A user can have up to 5 personal access tokens.
- Token names must be unique per user.
- `expires` is optional, but if provided it must be at least 24 hours in the future.
- Treat the token value as a secret and store it securely.

How to use the token with API requests:

```http
Authorization: ApiKey <personal-access-token>
```

Example request flow:

1. Create token via this endpoint.
2. Save the token value in your secret store.
3. Send it as an API key on subsequent API calls.
4. Rotate and revoke tokens regularly as part of your security process.

## Request body

- CreatePersonalAccessToken — Payload used to create a new personal access token.
  - `name` string, required — The personal access token name. Must be unique for the authenticated user.
  - `expires` string, date-time — Optional ISO timestamp indicating when the token should expire. Omit to create a non-expiring token.

## Response `201`

Personal access token created

- PersonalAccessToken — Personal access token information returned to the client.
  - `name` string, required — The personal access token name
  - `value` string, required — The personal access token value. This is only available immediately after creation.
  - `createdAt` string, date-time, required — ISO timestamp indicating when the token was created
  - `expires` string, date-time — ISO timestamp indicating when the token expires

## Other responses

- `409` — Personal access token limit reached or duplicate name

---

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