Get synapse list of users


I am looking for a way to get a list of registered users on my synapse server.

I found two solutions:

  1. a first one, using sql queries ;
  2. a second one, using matrix-js-sdk

I am more interested in the first one, as it doesn’t need the installation of another package, however I don’t really know how to interrogate the database.

Is anyone know how to do it please?
Thank you.


For the first one, you need to be connected on your YunoHost server (as root)

sudo -u postgres psql -d matrix_synapse
SELECT name from users;


su --command=“psql matrix_synapse” postgres <<< “SELECT name from users”


Thanks, that’s what I was looking for.