---
title: "POST /v2/CreateAdminToken"
method: POST
path: "/v2/CreateAdminToken"
tags: ["Admin API token"]
---

# POST /v2/CreateAdminToken

`POST /v2/CreateAdminToken`

Creates a new admin API token

## Request body

- UpdateAdminTokenRequestBody
  - `expiration` string, date-time, nullable — Expiration time and date, formatted according to RFC 3339
  - `name` string, nullable — Name of the admin API token
  - `neverExpires` boolean — Set the admin token to never expire
  - `scope` string[], nullable — Scope of the admin API token, a list of admin endpoint names (such as `GetClusterStatus`, etc), or the special value `*` to allow all admin endpoints. **WARNING:** Granting a scope of `CreateAdminToken` or `UpdateAdminToken` trivially allows for privilege escalation, and is thus functionally equivalent to granting a scope of `*`.

## Response `200`

Admin token has been created

- CreateAdminTokenResponse
  - `created` string, date-time, nullable — Creation date
  - `expiration` string, date-time, nullable — Expiration time and date, formatted according to RFC 3339
  - `expired` boolean, required — Whether this admin token is expired already
  - `id` string, nullable — Identifier of the admin token (which is also a prefix of the full bearer token)
  - `name` string, required — Name of the admin API token
  - `scope` string[], required — Scope of the admin API token, a list of admin endpoint names (such as `GetClusterStatus`, etc), or the special value `*` to allow all admin endpoints
  - `secretToken` string, required — The secret bearer token. **CAUTION:** This token will be shown only ONCE, so this value MUST be remembered somewhere, or the token will be unusable.

## Other responses

- `500` — Internal server error

---

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