Sub-User Management

Update a sub-user

Update an existing sub-user's name, password, chatbot assignments, permissions or analytics dashboard sections. Only provided fields are updated; omitted fields remain unchanged.

Requires the SSO Login add-on (see plans) and a workspace API key; without the add-on, or with a chatbot-scoped key, the request gets a 403.

To remove a sub-user's password (disabling password login), send:

{
  "removePassword": true
}
put/sub-users/{subUserId}

Request

  • Base URL: https://api.chat-data.com/api/v2
  • URL: https://api.chat-data.com/api/v2/sub-users/{subUserId}
  • Auth: HTTP bearer

Path parameters

subUserIdstring required

The unique identifier of the sub-user to update.

Request body

namestring

Updated display name. HTML tags are stripped.

passwordstring

New password. It must meet the same complexity requirements as on creation. If both password and removePassword are sent, password wins and the new password is set.

removePasswordboolean

Set to true to remove the sub-user's password, disabling password login. Ignored when password is also sent.

chatbotIdsstring[]

Updated chatbot assignments; replaces the current list. All IDs must belong to chatbots in your workspace. Duplicates are automatically removed.

permissionsstring[]

Updated permissions; replaces the current list. Invalid values are removed, and at least one valid permission is required.

analyticsDashboardSectionsstring[]

Updated analytics dashboard sections; replaces the current list. Unknown section names are ignored.

Example request

{
  "name": "Jane Doe",
  "chatbotIds": [
    "6650f1c2a9e4b83d2c7a1f05"
  ],
  "permissions": [
    "full"
  ],
  "analyticsDashboardSections": [
    "Overview",
    "Chats"
  ]
}

Response

Sub-user updated successfully.

_idstring required

The unique identifier of the sub-user.

companystring required

The ID of the company this sub-user belongs to.

emailstring email required

The sub-user's email address.

namestring

The sub-user's display name.

avatarstring

URL of the sub-user's avatar image, or an empty string if none is set.

permissionsstring[] required

Permissions granted to this sub-user.

analyticsDashboardSectionsstring[]

Analytics dashboard sections visible to this sub-user.

hasPasswordboolean required

Whether the sub-user has a password configured (the actual password is never returned).

hasGoogleboolean required

Whether the sub-user has signed in with a linked Google account (the Google ID is never returned). It stays false when Google sign-in is only enabled.

createdAtstring date-time

Timestamp when the sub-user was created.

lastLoginAtstring date-time

Timestamp of the sub-user's last sign-in. Absent until they first sign in.

Example response

{
  "_id": "6650f1c2a9e4b83d2c7a1f9a",
  "company": "6650f1c2a9e4b83d2c7a1f3c",
  "email": "jane@chat-data.com",
  "name": "Jane Doe",
  "avatar": "https://example.blob.core.windows.net/chatfiles/6650f1c2a9e4b83d2c7a1f9a/avatar.png",
  "chatbotIds": [
    {
      "_id": "6650f1c2a9e4b83d2c7a1f05",
      "name": "Support Bot"
    },
    {
      "_id": "6650f1c2a9e4b83d2c7a1f06",
      "name": "Sales Assistant"
    }
  ],
  "permissions": [
    "read",
    "train"
  ],
  "analyticsDashboardSections": [
    "Overview",
    "Messages Timeline",
    "Chats"
  ],
  "hasPassword": true,
  "createdAt": "2026-10-14T09:30:00.000Z",
  "lastLoginAt": "2026-10-14T10:15:00.000Z"
}

Changes

No recorded changes to this operation across all 1 revision of this API.