Reference For: administrators, users, tenants, developers

API token errors

Causes and remedies for the error codes raised when an API token is created.

error.api_token.name

Text in the console
The API token needs a name of 1 to 64 characters.
Meaning for API clients
The API token name is empty or too long.
Code
INVALID_ARGUMENT, HTTP 400
ArgumentWhat it holds
fieldthe request field that holds the rejected value, here name.

Cause. The token name is empty after leading and trailing blanks are removed, is longer than 64 characters, or contains a control character.

Remedy.

  1. Give the token a name of 1 to 64 characters without control characters.
  2. Create the token again: kyvernon auth api-tokens create <name> for your own account, or kyvernon users api-tokens <username> create <name> for another account.

error.api_token.limit

Text in the console
This account already has {max} API tokens. Remove one before creating another.
Meaning for API clients
The user has max API tokens already.
Code
RESOURCE_EXHAUSTED, HTTP 429
ArgumentWhat it holds
maxthe number of API tokens one account may hold.

Cause. The account already holds the largest number of API tokens that one account may have (16).

Remedy.

  1. List the tokens of the account: kyvernon auth api-tokens list.
  2. Delete a token that is no longer used: kyvernon auth api-tokens delete <id>.
  3. Create the new token again.

error.api_token.ttl

Text in the console
The token lifetime must be at least one second and at most {max} seconds.
Meaning for API clients
The API token lifetime is zero or longer than the maximum of max seconds.
Code
INVALID_ARGUMENT, HTTP 400
ArgumentWhat it holds
fieldthe request field that holds the rejected value, here ttlSeconds.
maxthe longest lifetime in seconds.

Cause. The requested lifetime is zero, or longer than the maximum that the controller allows. The maximum is the setting api_token_max_ttl in the [identity.policy] section of the controller configuration (365 days by default).

Remedy.

  1. Request a lifetime of at least one second and at most the value shown in the message: kyvernon auth api-tokens create <name> --ttl <seconds>.
  2. Leave --ttl out to take the maximum of the controller.
  3. When a longer lifetime is needed, an administrator raises api_token_max_ttl. Pass on the message id error.api_token.ttl and the lifetime you need.

Version 0.1. Last changed: 2026-11-13