---
title: "Create a new personal access token"
method: POST
path: "/v3/users/{userId}/access-tokens"
tags: ["Personal Access Tokens"]
---

# Create a new personal access token

`POST /v3/users/{userId}/access-tokens`

Create a new personal access token. A maximum of 10 personal access tokens can be created.

## Request body

- union
  - PersonalAccessTokenCreateRequestWithExpiresAt — **Deprecated:** Use `ttl_seconds` instead of `expires_at` to specify token expiration. Using a time-to-live value avoids clock skew issues when setting token expiration.
    - `name` string, required
    - `expires_at` string, date-time, required — An ISO-8601 timestamp representation of entity expiration date.
  - PersonalAccessTokenCreateRequestWithTTL
    - `name` string, required
    - `ttl_seconds` integer, required — The time to live in seconds for the personal access token.

## Response `201`

Response containing details of the created personal access token.

- PersonalAccessTokenCreateResponse — Details of the created personal access token.
  - `id` string, uuid, required — Contains a unique identifier used for this resource.
  - `user_id` string, uuid, required — Contains a unique identifier used for a user.
  - `name` string, required
  - `state` 'ACTIVE' | 'REVOKED' | 'EXPIRED', required — State of the personal access token.
  - `konnect_token` string, required — The Konnect token used to authenticate with Konnect.
  - `revoked_by` string, uuid, nullable — Contains a unique identifier used for the user that revoked this token.
  - `created_at` string, date-time, required — An ISO-8601 timestamp representation of entity creation date.
  - `updated_at` string, date-time — An ISO-8601 timestamp representation of entity update date.
  - `last_used_at` string, date-time, nullable — An ISO-8601 timestamp representation of entity last used date.
  - `expires_at` string, date-time, nullable, required — An ISO-8601 timestamp representation of entity expiration date.
  - `revoked_at` string, date-time, nullable — An ISO-8601 timestamp representation of entity revoked at date.

## Other responses

- `400` — Bad Request
- `401` — Unauthorized
- `403` — Forbidden
- `404` — Not Found
- `409` — Conflict

---

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