From e86461d48d44d28f80f9cb46b0cb21494da943ca Mon Sep 17 00:00:00 2001 From: Jordan Woods <13803242+jorwoods@users.noreply.github.com> Date: Tue, 31 Mar 2026 19:34:58 -0500 Subject: [PATCH 1/4] docs: add missing Users methods to api-ref.md Adds documentation for methods not previously documented: - add_all: bulk-adds users with per-item error collection - create_from_file: imports users from a CSV file Co-Authored-By: Claude Sonnet 4.6 --- docs/api-ref.md | 76 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 76 insertions(+) diff --git a/docs/api-ref.md b/docs/api-ref.md index 589cd2b5..573aa464 100644 --- a/docs/api-ref.md +++ b/docs/api-ref.md @@ -5358,6 +5358,82 @@ An updated `UserItem`. See [UserItem class](#useritem-class) +
+
+ +#### users.add_all + +```py +users.add_all(users) +``` + +Adds a list of users to the site. Unlike `bulk_add`, this method adds users one at a time and collects successes and failures rather than stopping on the first error. + +**Parameters** + +Name | Description +:--- | :--- +`users` | A list of `UserItem` objects to add to the site. + +**Returns** + +Returns a tuple of two lists: `(created, failed)`. The `created` list contains the successfully added `UserItem` objects. The `failed` list contains the `UserItem` objects that could not be added. + +**Version** + +Version 2.0 and later. See [REST API versions](https://help.tableau.com/current/api/rest_api/en-us/REST/rest_api_concepts_versions.htm). + +**Example** + +```py +users_to_add = [TSC.UserItem('user1'), TSC.UserItem('user2')] +created, failed = server.users.add_all(users_to_add) +print("Added {} users, {} failed.".format(len(created), len(failed))) +``` + +
+
+ +#### users.create_from_file + +```py +users.create_from_file(filepath) +``` + +Adds users from a CSV file to the site. The CSV file format matches the format used in the Tableau Server UI for bulk user import. + +The CSV file should have the following column format (header row optional): +`Username, Password, Display Name, License Level, Admin Level, Publishing Access` + +**Parameters** + +Name | Description +:--- | :--- +`filepath` | The path to a CSV file containing user information to import. + +**Exceptions** + +Error | Description +:--- | :--- +`ValueError` | Raises an exception if the file path does not point to a CSV file. + +**Returns** + +Returns a tuple of two lists: `(created, failed)`. The `created` list contains successfully added `UserItem` objects. The `failed` list contains tuples of `(UserItem, ServerResponseError)` for users that could not be added. + +**Version** + +Version 2.0 and later. See [REST API versions](https://help.tableau.com/current/api/rest_api/en-us/REST/rest_api_concepts_versions.htm). + +**Example** + +```py +created, failed = server.users.create_from_file('/path/to/users.csv') +print("Imported {} users. {} failed.".format(len(created), len(failed))) +for user, error in failed: + print("Failed to import {}: {}".format(user.name, error)) +``` +

From f3e21cdac8233afe5ee177aa2b036f47ff90e132 Mon Sep 17 00:00:00 2001 From: Jordan Woods <13803242+jorwoods@users.noreply.github.com> Date: Tue, 31 Mar 2026 21:01:23 -0500 Subject: [PATCH 2/4] docs: add users.filter to api-ref.md Co-Authored-By: Claude Sonnet 4.6 --- docs/api-ref.md | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/docs/api-ref.md b/docs/api-ref.md index 573aa464..1c7f6800 100644 --- a/docs/api-ref.md +++ b/docs/api-ref.md @@ -5437,6 +5437,40 @@ for user, error in failed:

+#### users.filter + +```py +users.filter(**kwargs) +``` + +Returns a list of users that match the specified filters. Fields and operators are passed as keyword arguments in the form `field_name=value` or `field_name__operator=value`. + +**Supported fields and operators** + +Field | Operators +:--- | :--- +`domain_name` | `eq`, `in` +`friendly_name` | `eq`, `in` +`is_local` | `eq` +`last_login` | `eq`, `gt`, `gte`, `lt`, `lte` +`luid` | `eq`, `in` +`name` | `eq`, `cieq`, `in` +`site_role` | `eq`, `in` + +**Returns** + +Returns a `QuerySet` of `UserItem` objects. + +**Example** + +```py +viewers = server.users.filter(site_role='Viewer') +for user in viewers: + print(user.name) +``` + +
+
--- From 93ffbd90527d3425a4b882518934d4a54a421384 Mon Sep 17 00:00:00 2001 From: Jordan Woods Date: Thu, 2 Apr 2026 08:00:56 -0500 Subject: [PATCH 3/4] Deprecate add_all method in API reference Mark the add_all method as deprecated and clarify its functionality. --- docs/api-ref.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/docs/api-ref.md b/docs/api-ref.md index 1c7f6800..d904028c 100644 --- a/docs/api-ref.md +++ b/docs/api-ref.md @@ -5367,7 +5367,9 @@ An updated `UserItem`. See [UserItem class](#useritem-class) users.add_all(users) ``` -Adds a list of users to the site. Unlike `bulk_add`, this method adds users one at a time and collects successes and failures rather than stopping on the first error. +**DEPRECATED** + +Adds a list of users to the site. Unlike `bulk_add`, this method adds users one at a time and collects successes and failures. **Parameters** From 7e08c785a1db20f9fb9c4317b764d895ef3afbb9 Mon Sep 17 00:00:00 2001 From: Jordan Woods Date: Thu, 2 Apr 2026 08:02:24 -0500 Subject: [PATCH 4/4] Deprecate users.create_from_file method Mark the user creation method from CSV as deprecated and provide details on the CSV format. --- docs/api-ref.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/docs/api-ref.md b/docs/api-ref.md index d904028c..7804d9cd 100644 --- a/docs/api-ref.md +++ b/docs/api-ref.md @@ -5402,6 +5402,8 @@ print("Added {} users, {} failed.".format(len(created), len(failed))) users.create_from_file(filepath) ``` +**DEPRECATED** + Adds users from a CSV file to the site. The CSV file format matches the format used in the Tableau Server UI for bulk user import. The CSV file should have the following column format (header row optional):