> ## Documentation Index
> Fetch the complete documentation index at: https://upstash.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# ACL GETUSER

> Get the user's details.

Use `ACL GETUSER` to inspect the resulting permissions of a single ACL user, broken out into structured fields instead of the raw rule string that [`ACL LIST`](/docs/redis/commands/server/acl-list) returns.

The reply describes the user's on/off and other flags, its passwords, the commands it can call as a single space-separated permission string, the key patterns it can access, and the channel patterns it can publish to or subscribe on. A username that does not exist returns a null reply rather than an error, which makes this command a convenient way to check whether a user exists before creating or modifying it.

## Syntax

```redis theme={"system"}
ACL GETUSER <username>
```

## Arguments

| Argument | Required | Repeatable | Description |
| - | - | - | - |
| `username` | Yes | No | ACL user to inspect. |

## Important points

* Returns null when the given username does not exist, instead of an error.
* The reply has five fields: `flags`, `passwords`, `commands`, `keys`, and `channels`. Standard Redis 7+ also returns a `selectors` field; this deployment does not support selectors, so client libraries that expect one will simply receive an empty or undefined value for it.

## 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.

| Protocol | Reply |
| - | - |
| RESP2 | Flat array of alternating field names and values, with nested arrays for `flags`, `passwords`, `keys`, and `channels`; or Null array |
| RESP3 | Map of five fields, with a Set for `flags` and Arrays for `passwords`, `keys`, and `channels`; or Null |

> [!NOTE]
>
> 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`.

> **Redis CLI**
>
> ```bash theme={"system"}
> ACL GETUSER app
> ```

> **@upstash/redis**
>
> > [!NOTE]
> >
> > This command is not supported yet in `@upstash/redis`.

> **upstash\_redis**
>
> > [!NOTE]
> >
> > This command is not supported yet in `upstash_redis`.

> **ioredis**
>
> ```ts theme={"system"}
> import Redis from "ioredis";
>
> const redis = new Redis(process.env.REDIS_URL!);
> const result = await redis.acl("GETUSER", "app");
> console.log(result);
> ```

> **node-redis**
>
> ```ts theme={"system"}
> import { createClient } from "redis";
>
> const client = await createClient({ url: process.env.REDIS_URL })
>   .on("error", console.error)
>   .connect();
> const result = await client.aclGetUser("app");
> console.log(result);
> // { flags: [...], passwords: [...], commands: '...', keys: [...], channels: [...], selectors: undefined }
> ```

> **redis-py**
>
> ```python theme={"system"}
> import os
> import redis
>
> client = redis.from_url(os.environ["REDIS_URL"])
> result = client.acl_getuser("app")
> print(result)
> ```

> **go-redis**
>
> > [!NOTE]
> >
> > go-redis has no typed `ACLGetUser` method; call `ACL GETUSER` through `Do`.
>
> ```go theme={"system"}
> package main
>
> import (
>     "context"
>     "fmt"
>     "os"
>
>     "github.com/redis/go-redis/v9"
> )
>
> func main() {
>     opts, err := redis.ParseURL(os.Getenv("REDIS_URL"))
>     if err != nil {
>         panic(err)
>     }
>     client := redis.NewClient(opts)
>     result, err := client.Do(context.Background(), "ACL", "GETUSER", "app").Result()
>     if err != nil {
>         panic(err)
>     }
>     fmt.Println(result)
> }
> ```

> **jedis**
>
> ```java theme={"system"}
> import java.net.URI;
>
> import redis.clients.jedis.Jedis;
>
> try (Jedis jedis = new Jedis(new URI(System.getenv("REDIS_URL")))) {
>   Object result = jedis.aclGetUser("app");
>   System.out.println(result);
> }
> ```

> **redis-rs**
>
> ```rust theme={"system"}
> use redis::TypedCommands;
>
> fn main() -> redis::RedisResult<()> {
>     let url = std::env::var("REDIS_URL").expect("REDIS_URL is not set");
>     let client = redis::Client::open(url)?;
>     let mut connection = client.get_connection()?;
>
>     let result = connection.acl_getuser("app")?;
>     println!("{result:?}");
>     Ok(())
> }
> ```


## Related topics

- [ACL USERS](/docs/redis/commands/server/acl-users.md)
- [ACL LIST](/docs/redis/commands/server/acl-list.md)
- [ACL SETUSER](/docs/redis/commands/server/acl-setuser.md)
- [ACL SAVE](/docs/redis/commands/server/acl-save.md)
- [ACL LOAD](/docs/redis/commands/server/acl-load.md)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.