---
title: "POST /access-tokens"
method: POST
path: "/access-tokens"
tags: ["access-tokens"]
---

# POST /access-tokens

`POST /access-tokens`

Create a new access token

## Request body

- NewAccessToken
  - `name` string, required — Name of the access token

## Response `201`

Access token created successfully

- CreatedAccessToken
  - `id` string, uuid, required — Identifier of the access token
  - `name` string, required — Name of the access token
  - `token` string, required — The fully created access token
  - `mask` IdentifierMaskingDetails, required
    - `prefix` string, required — Prefix that identifies the token or key type
    - `valueLength` integer, required — Length of the token or key
    - `maskedValuePrefix` string, required — Prefix used in masked version of the token or key
    - `maskedValueSuffix` string, required — Suffix used in masked version of the token or key
  - `createdAt` string, date-time, required — Timestamp of access token creation

## Other responses

- `401` — Authentication error
- `500` — Server error

## Changes

- **2026-05-27** `e13ef89d456c` — 1 info
  - the endpoint scheme security `AuthProviderBearerAuth` was added to the API
- **2025-07-18** `c1fe6498cb2f` — 1 breaking, 1 info
  - removed the required property `tokenMask` from the response with the `201` status
  - added the required property `mask` to the response with the `201` status
- **2025-03-21** `ca973917d2e1` — 1 info
  - endpoint added
- **2023-11-15** `897ba2f1c7b6` — 1 breaking
  - api path removed without deprecation

[Change history](https://skmtc.dev/e2b-dev/apis/e2b-api/changes/access-tokens/post.md)

---

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