---
title: "Create API token"
method: POST
path: "/iam/clients/{clientId}/tokens"
tags: ["API Tokens"]
deprecated: true
---

# Create API token

`POST /iam/clients/{clientId}/tokens`

> **Deprecated.**

**Deprecated:** This endpoint will be removed on **2026-07-17**.
Use [`POST /v2/clients/{clientId}/tokens`](#operation/iamCreateApiTokenV2) instead.

Create an API token in the current account.

## Path parameters

- `clientId` integer, required

## Request body

- Token2
  - `name` string, required — API token name.
  - `description` string — API token description.
  - `exp_date` string, nullable, required — Date when the API token becomes expired (ISO 8086/RFC 3339 format), UTC. If null, then the API token will never expire.
  - `client_user` object, required — API token role.
    - `role` Group
      - `id` integer — Group's ID: Possible values are: - 1 - Administrators* 2 - Users* 5 - Engineers* 3009 - Purge and Prefetch only (API+Web)* 3022 - Purge and Prefetch only (API)
      - `name` 'Users' | 'Administrators' | 'Engineers' | 'Purge and Prefetch only (API)' | 'Purge and Prefetch only (API+Web)' — Group's name.

## Response `200`

OK.

- CreateTokenResponse
  - `token` string — API token. Copy it, because you will not be able to get it again. We do not store tokens. All responsibility for token storage and usage is on the issuer.
  - `name` string, required — API token name.
  - `description` string — API token description.
  - `exp_date` string, nullable, required — Date when the API token becomes expired (ISO 8086/RFC 3339 format), UTC. If null, then the API token will never expire.
  - `client_user` object, required — API token role and issuer data.
    - `role` Group, required
      - `id` integer — Group's ID: Possible values are: - 1 - Administrators* 2 - Users* 5 - Engineers* 3009 - Purge and Prefetch only (API+Web)* 3022 - Purge and Prefetch only (API)
      - `name` 'Users' | 'Administrators' | 'Engineers' | 'Purge and Prefetch only (API)' | 'Purge and Prefetch only (API+Web)' — Group's name.
    - `deleted` boolean, required — Deletion flag. If true, then the API token was deleted.
    - `user_id` integer, required — User's ID who issued the API token.
    - `user_name` string, required — User's name who issued the API token.
    - `user_email` string, required — User's email who issued the API token.
    - `client_id` integer, required — Account's ID.
  - `id` integer, required — API token ID.
  - `deleted` boolean, required — Deletion flag. If true, then the API token was deleted.
  - `expired` boolean, required — Expiration flag. If true, then the API token has expired. When an API token expires it will be automatically deleted.
  - `created` string, required — Date when the API token was issued (ISO 8086/RFC 3339 format), UTC.
  - `last_usage` string, required — Date when the API token was last used (ISO 8086/RFC 3339 format), UTC.

## Other responses

- `400` — API token creation failed.

## Changes

- **2026-04-21** `eb97fe6d936e` — 1 info
  - endpoint deprecated
- **2026-04-21** `a02801156a6a` — 2 info
  - added `#/components/schemas/Token-2` to the `allOf[#/components/schemas/TokenResponse]/` response property `allOf` list for the response status `200`
  - removed `#/components/schemas/schemas-Token` from the `allOf[#/components/schemas/TokenResponse]/` response property `allOf` list for the response status `200`

[Change history](https://skmtc.dev/g-core/apis/gcore-openapi/changes/iam/clients/:clientId/tokens/post.md)

---

[API](https://skmtc.dev/g-core/apis/gcore-openapi.md) · [All operations](https://skmtc.dev/g-core/apis/gcore-openapi/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/g-core/gcore-openapi/revisions/09e652815095/schema)
