Modify an existing API_TOKEN for a in the current .
Arguments
api_token_name
This specifies the name of the API_TOKEN to modify.
Examples
Refresh an existing API_TOKEN
This example shows an existing API token my_token getting renewed:
<no-db>/<no-store># LIST API_TOKENS;+----------+-------------------------------+-------------------------------+-------------------------------+|Name|LastUsed|CreatedAt|ExpiresAt|+==========+===============================+===============================+===============================+|my_token|2024-07-1120:38:32+0000UTC|2024-07-1120:37:17+0000UTC|2024-10-0920:37:17+0000UTC|+----------+-------------------------------+-------------------------------+-------------------------------+<no-db>/<no-store># ALTER API_TOKEN my_token RENEW TOKEN;+-----------+----------+----------+------------------------------------------+--------------------------------+|Type|Name|Command|Summary|Token|+===========+==========+==========+==========================================+================================+|api_token|my_token|ALTER|api_tokenmy_tokenwassuccessfully|<redacted_refreshed_api_token> |||||refreshed||+-----------+----------+----------+------------------------------------------+--------------------------------+
Note how the creation and expiration time of the API token changes and last used time resets after the ALTER statement successfully executes:
<no-db>/<no-store># LIST API_TOKENS;+----------+------------+-------------------------------+-------------------------------+|Name|LastUsed|CreatedAt|ExpiresAt|+==========+============+===============================+===============================+|my_token|<null> |2024-07-1120:38:50+0000UTC|2024-10-0920:38:50+0000UTC|+----------+------------+-------------------------------+-------------------------------+