---
title: "Generate new API token"
method: POST
path: "/auth/apitoken"
tags: ["Authorization"]
---

# Generate new API token

`POST /auth/apitoken`

Generate a new API token with given permissions and expiration time. 
The available permission list can be found via 'GET /auth/permissions' endpoint.

## Request body

- XiqGenerateApiTokenRequest
  - `expire_time` integer — The token expire time, format is the number of seconds from epoch of 1970-01-01T00:00:00Z. If null means no expiration, the minimum value is current time plus 300 seconds.
  - `description` string — The token description
  - `permissions` string[], required — The token permissions
  - `rate_limit` XiqRateLimitPolicy — The rate limit policy for the API token
    - `hour` integer, required — The sustained request quota per hour. Defines the baseline traffic capacity.
    - `second` integer — The maximum burst allowance per second. If omitted, no short-term throttling is applied.

## Response `200`

OK

- XiqGenerateApiTokenResponse
  - `access_token` string, required — The API access token
  - `create_time` string, date-time, required — The create timestamp
  - `expire_time` string, date-time — The expire timestamp, if null means no expiration
  - `creator_id` integer, required — The user ID who created the API token
  - `customer_id` integer, required — The customer ID who owns the API token
  - `description` string — The description for the API token
  - `permissions` string[], required — The permissions for the API token

---

[API](https://skmtc.net/extremecloudiq/apis/extremecloud-iq-api.md) · [All operations](https://skmtc.net/extremecloudiq/apis/extremecloud-iq-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/extremecloudiq/extremecloud-iq-api/versions/5ff7ab84e8e8/schema)
