For AI agents: the complete documentation index is at llms.txt. Every page is also available as markdown by appending .md to its URL, or by sending an Accept: text/markdown request header.

ALTER USER DROP TOKEN reference

Enterprise:

RBAC provides fine-grained database permissions management.

ALTER USER ... DROP TOKEN removes a JSON Web Key or a REST API token from a user account.


Syntax​

ALTER USER userName DROP TOKEN TYPE
{ JWK | REST [token] };

Description​

  • ALTER USER username DROP TOKEN TYPE JWK removes the JSON Web Key from the user account.
  • ALTER USER username DROP TOKEN TYPE REST token removes that REST token from the user account.
  • ALTER USER username DROP TOKEN TYPE REST with no token removes all of the user's REST tokens.

Examples​

Remove the JSON Web Key
ALTER USER john DROP TOKEN TYPE JWK;
Remove REST API tokens
-- drop a single REST API token
ALTER USER john DROP TOKEN TYPE REST 'qt1cNK6s2t79f76GmTBN9k7XTWm5wwOtF7C0UBxiHGPn44';
-- drop all REST API tokens for the given user
ALTER USER john DROP TOKEN TYPE REST;

Verify with:

SHOW USER john;
auth_typeenabled
Passwordtrue
JWK Tokenfalse
REST Tokenfalse

See also​