{
  "schema_version": 2,
  "id": "operate/rs/references/rest-api/requests/users",
  "title": "Users requests",
  "url": "https://redis.io/docs/latest/operate/rs/references/rest-api/requests/users/",
  "summary": "User requests",
  "tags": [
    "docs",
    "operate",
    "rs"
  ],
  "last_updated": "2026-10-05T16:11:44+01:00",
  "children": [
    {
      "id": "operate/rs/references/rest-api/requests/users/authorize",
      "summary": "Users authorization requests",
      "title": "Authorize user requests",
      "url": "https://redis.io/docs/latest/operate/rs/references/rest-api/requests/users/authorize/"
    },
    {
      "id": "operate/rs/references/rest-api/requests/users/password",
      "summary": "User password requests",
      "title": "User password requests",
      "url": "https://redis.io/docs/latest/operate/rs/references/rest-api/requests/users/password/"
    },
    {
      "id": "operate/rs/references/rest-api/requests/users/refresh_jwt",
      "summary": "Refresh JW token requests",
      "title": "Refresh JWT requests",
      "url": "https://redis.io/docs/latest/operate/rs/references/rest-api/requests/users/refresh_jwt/"
    }
  ],
  "page_type": "content",
  "content_hash": "548d1a2c3bb1b9d6b64bd66b985d563550254833642a7aae2bb66be75d25be50",
  "sections": [
    {
      "id": "overview",
      "title": "Overview",
      "role": "overview",
      "text": "| Method | Path | Description |\n|--------|------|-------------|\n| [GET](#get-all-users) | `/v1/users` | Get all users |\n| [GET](#get-user) | `/v1/users/{uid}` | Get a single user |\n| [PUT](#put-user) | `/v1/users/{uid}` | Update a user's configuration |\n| [POST](#post-user) | `/v1/users` | Create a new user |\n| [DELETE](#delete-user) | `/v1/users/{uid}` | Delete a user |"
    },
    {
      "id": "get-all-users",
      "title": "Get all users",
      "role": "content",
      "text": "[code example]\n\nGet a list of all users."
    },
    {
      "id": "permissions",
      "title": "Permissions",
      "role": "security",
      "text": "| Permission name | Roles |\n|-----------------|-------|\n| [view_all_users_info](https://redis.io/docs/latest/operate/rs/references/rest-api/permissions#view_all_users_info) | admin<br />user_manager |"
    },
    {
      "id": "get-all-request",
      "title": "Request",
      "role": "content",
      "text": "#### Example HTTP request\n\n[code example]\n\n#### Headers\n\n| Key | Value | Description |\n|-----|-------|-------------|\n| Host | cnm.cluster.fqdn | Domain name |\n| Accept | application/json | Accepted media type |"
    },
    {
      "id": "get-all-response",
      "title": "Response",
      "role": "returns",
      "text": "Returns a JSON array of [user objects](https://redis.io/docs/latest/operate/rs/references/rest-api/objects/user).\n\n#### Example JSON body\n\n[code example]"
    },
    {
      "id": "get-all-status-codes",
      "title": "Status codes",
      "role": "content",
      "text": "| Code | Description |\n|------|-------------|\n| [200 OK](http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.2.1) | No error |"
    },
    {
      "id": "get-user",
      "title": "Get user",
      "role": "content",
      "text": "[code example]\n\nGet a single user's details."
    },
    {
      "id": "permissions-1",
      "title": "Permissions",
      "role": "security",
      "text": "| Permission name | Roles |\n|-----------------|-------|\n| [view_user_info](https://redis.io/docs/latest/operate/rs/references/rest-api/permissions#view_user_info) | admin<br />user_manager |"
    },
    {
      "id": "get-request",
      "title": "Request",
      "role": "content",
      "text": "#### Example HTTP request\n\n[code example]\n\n#### Headers\n\n| Key | Value | Description |\n|-----|-------|-------------|\n| Host | cnm.cluster.fqdn | Domain name |\n| Accept | application/json | Accepted media type |\n\n#### URL parameters\n\n| Field | Type | Description |\n|-------|------|-------------|\n| uid | integer | The user's unique ID |"
    },
    {
      "id": "get-response",
      "title": "Response",
      "role": "returns",
      "text": "Returns a [user object](https://redis.io/docs/latest/operate/rs/references/rest-api/objects/user) that contains the details for the specified user ID.\n\n#### Example JSON body\n\n[code example]"
    },
    {
      "id": "get-status-codes",
      "title": "Status codes",
      "role": "content",
      "text": "| Code | Description |\n|------|-------------|\n| [200 OK](http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.2.1) | Success. |\n| [403 Forbidden](http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.4.4) | Operation is forbidden. |\n| [404 Not Found](http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.4.5) | User does not exist. |"
    },
    {
      "id": "put-user",
      "title": "Update user",
      "role": "content",
      "text": "[code example]\n\nUpdate an existing user's configuration."
    },
    {
      "id": "permissions-2",
      "title": "Permissions",
      "role": "security",
      "text": "| Permission name | Roles |\n|-----------------|-------|\n| [update_user](https://redis.io/docs/latest/operate/rs/references/rest-api/permissions#update_user) | admin<br />user_manager |\n\nAny user can change their own name, password, or alert preferences."
    },
    {
      "id": "put-request",
      "title": "Request",
      "role": "content",
      "text": "#### Example HTTP request\n\n[code example]\n\n#### Example JSON body\n\n[code example]\n\n#### Headers\n\n| Key | Value | Description |\n|-----|-------|-------------|\n| Host | cnm.cluster.fqdn | Domain name |\n| Accept | application/json | Accepted media type |\n\n#### Query parameters\n\n| Field   | Type | Description |\n|---------|------|---------------|\n| dry_run |  | Validate the updated [user object](https://redis.io/docs/latest/operate/rs/references/rest-api/objects/user) but don't apply the update. |\n\n#### URL parameters\n\n| Field | Type | Description |\n|-------|------|-------------|\n| uid | integer | The user's unique ID |\n\n\n#### Request body\n\nInclude a [user object](https://redis.io/docs/latest/operate/rs/references/rest-api/objects/user) with updated fields in the request body."
    },
    {
      "id": "put-response",
      "title": "Response",
      "role": "returns",
      "text": "Returns the updated [user object](https://redis.io/docs/latest/operate/rs/references/rest-api/objects/user).\n\n#### Example JSON body\n\n[code example]\n\n> [!NOTE]\n> For [RBAC-enabled clusters](https://redis.io/docs/latest/operate/rs/security/access-control), the returned user details include `role_uids` instead of `role`."
    },
    {
      "id": "put-error-codes",
      "title": "Error codes",
      "role": "errors",
      "text": "When errors are reported, the server may return a JSON object with    `error_code` and `message` field that provide additional information.    The following are possible `error_code` values:\n\n| Code | Description |\n|------|-------------|\n| password_not_complex | The given password is not complex enough (Only works when the password_complexity feature is enabled).|\n| new_password_same_as_current | The given new password is identical to the old password.|\n| email_already_exists | The given email is already taken.|\n| change_last_admin_role_not_allowed | At least one user with admin role should exist.|"
    },
    {
      "id": "put-status-codes",
      "title": "Status codes",
      "role": "content",
      "text": "| Code | Description |\n|------|-------------|\n| [200 OK](http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.2.1) | Success, the user is updated. |\n| [400 Bad Request](http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.4.1) | Bad or missing configuration parameters. |\n| [404 Not Found](http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.4.5) | Attempting to change a non-existing user. |\n| [406 Not Acceptable](http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.4.7) | The requested configuration is invalid. |"
    },
    {
      "id": "post-user",
      "title": "Create user",
      "role": "content",
      "text": "[code example]\n\nCreate a new user."
    },
    {
      "id": "permissions-3",
      "title": "Permissions",
      "role": "security",
      "text": "| Permission name | Roles |\n|-----------------|-------|\n| [create_new_user](https://redis.io/docs/latest/operate/rs/references/rest-api/permissions#create_new_user) | admin<br />user_manager |"
    },
    {
      "id": "post-request",
      "title": "Request",
      "role": "content",
      "text": "#### Example HTTP request\n\n[code example]\n\n#### Headers\n\n| Key | Value | Description |\n|-----|-------|-------------|\n| Host | cnm.cluster.fqdn | Domain name |\n| Accept | application/json | Accepted media type |\n\n#### Query parameters\n\n| Field   | Type | Description |\n|---------|------|---------------|\n| dry_run |  | Validate the new [user object](https://redis.io/docs/latest/operate/rs/references/rest-api/objects/user) but don't apply the update. |\n\n#### Body\n\nInclude a single [user object](https://redis.io/docs/latest/operate/rs/references/rest-api/objects/user) in the request body. The user object must have an email, password, and role.\n\n> [!NOTE]\n> For [RBAC-enabled clusters](https://redis.io/docs/latest/operate/rs/security/access-control), use `role_uids` instead of `role` in the request body.\n\n`email_alerts` can be configured either as:\n\n- `true` - user will receive alerts for all databases configured in `bdbs_email_alerts`. The user will receive alerts for all databases by default if `bdbs_email_alerts` is not configured. `bdbs_email_alerts` can be a list of database UIDs or `[‘all’]` meaning all databases.\n\n- `false` - user will not receive alerts for any databases\n\n##### Example JSON body\n\n[code example]"
    },
    {
      "id": "post-response",
      "title": "Response",
      "role": "returns",
      "text": "Returns the newly created [user object](https://redis.io/docs/latest/operate/rs/references/rest-api/objects/user).\n\n#### Example JSON body\n\n[code example]"
    },
    {
      "id": "post-error-codes",
      "title": "Error codes",
      "role": "errors",
      "text": "When errors are reported, the server may return a JSON object with `error_code` and `message` field that provide additional information.\n\nThe following are possible `error_code` values:\n\n| Code | Description |\n|------|-------------|\n| password_not_complex | The given password is not complex enough (Only works when the password_complexity feature is enabled).|\n| email_already_exists | The given email is already taken.|\n| name_already_exists | The given name is already taken.|"
    },
    {
      "id": "post-status-codes",
      "title": "Status codes",
      "role": "content",
      "text": "| Code | Description |\n|------|-------------|\n| [200 OK](http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.2.1) | Success, user is created. |\n| [400 Bad Request](http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.4.1) | Bad or missing configuration parameters. |\n| [409 Conflict](http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.4.10) | User with the same email already exists. |"
    },
    {
      "id": "examples",
      "title": "Examples",
      "role": "example",
      "text": "#### cURL\n\n[code example]\n\n#### Python\n\n[code example]"
    },
    {
      "id": "delete-user",
      "title": "Delete user",
      "role": "content",
      "text": "[code example]\n\nDelete a user."
    },
    {
      "id": "permissions-4",
      "title": "Permissions",
      "role": "security",
      "text": "| Permission name | Roles |\n|-----------------|-------|\n| [delete_user](https://redis.io/docs/latest/operate/rs/references/rest-api/permissions#delete_user) | admin<br />user_manager |"
    },
    {
      "id": "delete-request",
      "title": "Request",
      "role": "content",
      "text": "#### Example HTTP request\n\n[code example]\n\n#### Headers\n\n| Key | Value | Description |\n|-----|-------|-------------|\n| Host | cnm.cluster.fqdn | Domain name |\n| Accept | application/json | Accepted media type |\n\n#### URL parameters\n\n| Field | Type | Description |\n|-------|------|-------------|\n| uid | integer | The user's unique ID |"
    },
    {
      "id": "delete-response",
      "title": "Response",
      "role": "returns",
      "text": "Returns a status code to indicate the success or failure of the user deletion."
    },
    {
      "id": "delete-status-codes",
      "title": "Status codes",
      "role": "content",
      "text": "| Code | Description |\n|------|-------------|\n| [200 OK](http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.2.1) | Success, the user is deleted. |\n| [406 Not Acceptable](http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.4.7) | The request is not acceptable. |"
    }
  ],
  "examples": [
    {
      "id": "get-all-users-ex0",
      "language": "sh",
      "code": "GET /v1/users",
      "section_id": "get-all-users"
    },
    {
      "id": "get-all-request-ex0",
      "language": "sh",
      "code": "GET /v1/users",
      "section_id": "get-all-request"
    },
    {
      "id": "get-all-response-ex0",
      "language": "json",
      "code": "[\n    {\n        \"uid\": 1,\n        \"password_issue_date\": \"2017-03-02T09:43:34Z\",\n        \"email\": \"user@example.com\",\n        \"name\": \"John Doe\",\n        \"email_alerts\": true,\n        \"bdbs_email_alerts\": [\"1\",\"2\"],\n        \"role\": \"admin\",\n        \"auth_method\": \"regular\",\n        \"status\": \"active\"\n    },\n    {\n        \"uid\": 2,\n        \"password_issue_date\": \"2017-03-02T09:43:34Z\",\n        \"email\": \"user2@example.com\",\n        \"name\": \"Jane Poe\",\n        \"email_alerts\": true,\n        \"role\": \"db_viewer\",\n        \"auth_method\": \"regular\",\n        \"status\": \"active\"\n    }\n]",
      "section_id": "get-all-response"
    },
    {
      "id": "get-user-ex0",
      "language": "sh",
      "code": "GET /v1/users/{int: uid}",
      "section_id": "get-user"
    },
    {
      "id": "get-request-ex0",
      "language": "sh",
      "code": "GET /v1/users/1",
      "section_id": "get-request"
    },
    {
      "id": "get-response-ex0",
      "language": "json",
      "code": "{\n    \"uid\": 1,\n    \"password_issue_date\": \"2017-03-07T15:11:08Z\",\n    \"role\": \"db_viewer\",\n    \"email_alerts\": true,\n    \"bdbs_email_alerts\": [\"1\",\"2\"],\n    \"email\": \"user@example.com\",\n    \"name\": \"John Doe\",\n    \"auth_method\": \"regular\",\n    \"status\": \"active\"\n}",
      "section_id": "get-response"
    },
    {
      "id": "put-user-ex0",
      "language": "sh",
      "code": "PUT /v1/users/{int: uid}",
      "section_id": "put-user"
    },
    {
      "id": "put-request-ex0",
      "language": "sh",
      "code": "PUT /v1/users/1",
      "section_id": "put-request"
    },
    {
      "id": "put-request-ex1",
      "language": "json",
      "code": "{\n     \"email_alerts\": false,\n     \"role_uids\": [ 2, 4 ]\n}",
      "section_id": "put-request"
    },
    {
      "id": "put-response-ex0",
      "language": "json",
      "code": "{\n     \"uid\": 1,\n     \"password_issue_date\": \"2017-03-07T15:11:08Z\",\n     \"email\": \"user@example.com\",\n     \"name\": \"Jane Poe\",\n     \"email_alerts\": false,\n     \"role\": \"db_viewer\",\n     \"role_uids\": [ 2, 4 ],\n     \"auth_method\": \"regular\"\n}",
      "section_id": "put-response"
    },
    {
      "id": "post-user-ex0",
      "language": "sh",
      "code": "POST /v1/users",
      "section_id": "post-user"
    },
    {
      "id": "post-request-ex0",
      "language": "sh",
      "code": "POST /v1/users",
      "section_id": "post-request"
    },
    {
      "id": "post-request-ex1",
      "language": "json",
      "code": "{\n     \"email\": \"newuser@example.com\",\n     \"password\": \"my-password\",\n     \"name\": \"Pat Doe\",\n     \"email_alerts\": true,\n     \"bdbs_email_alerts\": [\"1\",\"2\"],\n     \"role_uids\": [ 3, 4 ],\n     \"auth_method\": \"regular\"\n}",
      "section_id": "post-request"
    },
    {
      "id": "post-response-ex0",
      "language": "json",
      "code": "{\n     \"uid\": 1,\n     \"password_issue_date\": \"2017-03-07T15:11:08Z\",\n     \"email\": \"newuser@example.com\",\n     \"name\": \"Pat Doe\",\n     \"email_alerts\": true,\n     \"bdbs_email_alerts\": [\"1\",\"2\"],\n     \"role\": \"db_viewer\",\n     \"role_uids\": [ 3, 4 ],\n     \"auth_method\": \"regular\"\n}",
      "section_id": "post-response"
    },
    {
      "id": "examples-ex0",
      "language": "sh",
      "code": "$ curl -k -X POST -u '[username]:[password]' \\\n       -H 'Content-Type: application/json' \\\n       -d '{ \"email\": \"newuser@example.com\", \\\n           \"password\": \"my-password\", \\\n           \"name\": \"Pat Doe\", \\\n           \"email_alerts\": true, \\\n           \"bdbs_email_alerts\": [\"1\",\"2\"], \\\n           \"role_uids\": [ 3, 4 ], \\\n           \"auth_method\": \"regular\" }' \\\n       'https://[host][:port]/v1/users'",
      "section_id": "examples"
    },
    {
      "id": "examples-ex1",
      "language": "python",
      "code": "import requests\nimport json\n\nurl = \"https://[host][:port]/v1/users\"\nauth = (\"[username]\", \"[password]\")\n\npayload = json.dumps({\n  \"email\": \"newuser@example.com\",\n  \"password\": \"my-password\",\n  \"name\": \"Pat Doe\",\n  \"email_alerts\": True,\n  \"bdbs_email_alerts\": [\n    \"1\",\n    \"2\"\n  ],\n  \"role_uids\": [\n    3,\n    4\n  ],\n  \"auth_method\": \"regular\"\n})\n\nheaders = {\n  'Content-Type': 'application/json'\n}\n\nresponse = requests.request(\"POST\", url, auth=auth, headers=headers, data=payload, verify=False)\n\nprint(response.text)",
      "section_id": "examples"
    },
    {
      "id": "delete-user-ex0",
      "language": "sh",
      "code": "DELETE /v1/users/{int: uid}",
      "section_id": "delete-user"
    },
    {
      "id": "delete-request-ex0",
      "language": "sh",
      "code": "DELETE /v1/users/1",
      "section_id": "delete-request"
    }
  ]
}
