Pagination & User Permissions in List Users API

Hi,
I am trying to build automations on top of Retools List Users API. However, the following two questions came up in the process:

  1. How does pagination work? I can see that next_token is returned in the response from the API, but what is the query parameter for using the next_token to get the next page?

  2. How can I get the permissions of the users? Is it in the metadata of the user schema?

Appreciate the help!

Hi @daniel-from-admyral, welcome to the forum! :wave:

Pagination:
We currently send all results for all responses except for Resources. The query param is next_token, but we do have to include __RETOOL_ENCRYPTED___(<token>). Here is an example:

Permissions:
Although the response of a GET request to /users or /users/user_id doesn't include permissions, there is a way to extract this information.

  1. Getting a list of User Groups will include their members:

  2. Getting Permissions for one group will include Apps, Resources, and Workflows that group has access to:

If we wanted to get Permissions for one user, we could use JS to filter the result from groups, selecting the ones that include a user by id or email. Then, make a request to get the Permissions for that group or groups.

Pro tip: you could create a Retool app with Rest API resources that make these requests and have a dashboard that displays this data. :sunglasses: