is it possible to automatically generate a TAN list per user for several users?
I imagine the whole thing as follows:
I have a CSV file with several users that I can import. As soon as the CSV file has been imported, a TAN list (with X-TANs, e.g. 100) is automatically generated and saved for each user in this file.
As an admin in PrivacyIDEA, I can select the required users via multiple selection and then execute an action which creates and saves a separate TAN list for each of the selected users.
You can use the REST API to automate tasks as @rob showed, or you can use the library level.
On the privacyIDEA server itself you can use the privacyidea python modules to write python scripts, that go around the REST API and directly modify the system.
This way you can create users, generate tokens (privacyidea.lib.token:token_init()) and basically everything you want to do.
Please note, that defined event handlers are triggered by the REST API but not by library calls.
You can find example scripts here:
Here is an example, that creates users from a CSV, uses assign_token for existing tokens and init_token to create new tokens.