---
title: "Create access token"
method: POST
path: "/access-tokens"
tags: ["access-tokens"]
deprecated: true
---

# Create access token

`POST /access-tokens`

> **Deprecated.**

Create a new access token. Deprecated; use an API key (E2B_API_KEY) instead.

## 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
- `410` — Gone
- `500` — Server error

## Changes

- **2026-08-20** `e01b3f5506fe` — 3 info
  - added the optional property `error_code` to the response with the `401` status
  - added the optional property `error_code` to the response with the `410` status
  - added the optional property `error_code` to the response with the `500` status
- **2026-07-24** `93ed246a4c10` — 3 info
  - the endpoint scheme security `Supabase1TokenAuth` was removed from the API
  - endpoint deprecated
  - added the non-success response with the status `410`
- **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

[Full 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/e01b3f5506fe/schema)
