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

# Get Users in Public Roles

> Use this endpoint to get the list of roles other than `user`, such as admin, livechat, and custom roles.

### Changelog
| Version      | Description |
| ---------------- | ------------|
|7.10.0            | Added       |

## OpenAPI

````json GET /api/v1/roles.getUsersInPublicRoles
{
  "openapi": "3.0.0",
  "info": {
    "version": "1.0.0",
    "title": "User Management"
  },
  "servers": [
    {
      "url": "https://apiexplorer.support.rocket.chat"
    }
  ],
  "tags": [
    {
      "name": "LDAP"
    },
    {
      "name": "Permissions"
    },
    {
      "name": "Roles"
    },
    {
      "name": "Users"
    }
  ],
  "paths": {
    "/api/v1/roles.getUsersInPublicRoles": {
      "get": {
        "summary": "Get Users in Public Roles",
        "tags": [
          "Roles"
        ],
        "responses": {
          "200": {
            "description": "OK",
            "headers": {},
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "users": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "_id": {
                            "type": "string"
                          },
                          "username": {
                            "type": "string"
                          },
                          "roles": {
                            "type": "array",
                            "items": {
                              "type": "string"
                            }
                          }
                        }
                      }
                    },
                    "success": {
                      "type": "boolean"
                    }
                  }
                },
                "examples": {
                  "Example 1": {
                    "value": {
                      "users": [
                        {
                          "_id": "kb2WBkjkut4YJpFQk",
                          "username": "agent2",
                          "roles": [
                            "livechat-agent"
                          ]
                        },
                        {
                          "_id": "Ahgf5k9Ca4YEdMjwX",
                          "username": "test.agent",
                          "roles": [
                            "admin",
                            "livechat-agent"
                          ]
                        }
                      ],
                      "success": "true"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/authorizationError"
          }
        },
        "operationId": "get-api-v1-roles.getUsersInPublicRoles",
        "description": "Use this endpoint to get the list of roles other than `user`, such as admin, livechat, and custom roles.\n\n### Changelog\n| Version      | Description |\n| ---------------- | ------------|\n|7.10.0            | Added       |",
        "parameters": [
          {
            "$ref": "#/components/parameters/Auth-Token"
          },
          {
            "$ref": "#/components/parameters/UserId"
          }
        ]
      }
    }
  },
  "components": {
    "responses": {
      "authorizationError": {
        "description": "Unauthorized",
        "content": {
          "application/json": {
            "schema": {
              "type": "object",
              "properties": {
                "status": {
                  "type": "string"
                },
                "message": {
                  "type": "string"
                }
              }
            },
            "examples": {
              "Authorization Error": {
                "value": {
                  "status": "error",
                  "message": "You must be logged in to do this."
                }
              }
            }
          }
        }
      }
    },
    "parameters": {
      "Auth-Token": {
        "name": "X-Auth-Token",
        "in": "header",
        "description": "The authenticated user token.",
        "required": "true",
        "schema": {
          "type": "string"
        },
        "example": "RScctEHSmLGZGywfIhWyRpyofhKOiMoUIpimhvheU3f"
      },
      "UserId": {
        "name": "X-User-Id",
        "in": "header",
        "description": "The authenticated user ID.",
        "required": "true",
        "schema": {
          "type": "string"
        },
        "example": "rbAXPnMktTFbNpwtJ"
      }
    }
  }
}
````

