Skip to main content
Use ACL to inspect and manage the users, rules, and permissions of the database’s access control list. SETUSER creates or updates a user and applies rules from left to right: rules enable or disable the user (on, off), set passwords (>password, <password), and grant or revoke access to commands (+get, -@admin) and to key patterns (~cache:*). GETUSER shows the resulting rules for one user, USERS and LIST enumerate users in short and full form, and DELUSER removes them. WHOAMI reports the user the current connection is authenticated as, CAT lists the command categories that can be used in rules, and GENPASS returns a cryptographically strong random password. LOG shows recent authentication and permission failures, which is where to look when a client is unexpectedly denied, and RESET on that subcommand clears it. LOAD and SAVE reload and persist the ACL file. Upstash adds two deployment-specific forms: RESTTOKEN returns the REST token of an existing user, given that user’s password, and GENTOKEN builds a token for a username and password pair, generating a strong password when none is given, so the token can be passed to SETUSER as the user’s password. Together they are how an ACL user is given access to the REST API alongside the TCP endpoint. Changes take effect immediately on new and existing connections, so a rule that narrows access can lock out a running application; check with GETUSER before applying it broadly.

Syntax

Arguments

Important points

  • This command can expose administrative information or make a broad destructive change. Restrict it to trusted code paths.
  • ACL is an administrative command. Changing users or rules can immediately revoke application access.
  • Upstash also supports the deployment-specific RESTTOKEN and GENTOKEN subcommands.

Response

The reply reports the result of the operation. Error replies have the same shape in RESP2 and RESP3 and are surfaced as exceptions by the SDKs below.
Client libraries often decode bulk strings, maps, sets, and numeric strings into language-native values. The table describes the Redis wire reply.

Examples

TCP examples use the TLS REDIS_URL from the Upstash console. REST examples use UPSTASH_REDIS_REST_URL and UPSTASH_REDIS_REST_TOKEN.
This command is not supported yet in @upstash/redis.
This command is not supported yet in upstash_redis.