user_admin_api.rst 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  1. Query Account
  2. =============
  3. This API returns information about a specific user account.
  4. The api is::
  5. GET /_matrix/client/r0/admin/whois/<user_id>
  6. including an ``access_token`` of a server admin.
  7. It returns a JSON body like the following:
  8. .. code:: json
  9. {
  10. "user_id": "<user_id>",
  11. "devices": {
  12. "": {
  13. "sessions": [
  14. {
  15. "connections": [
  16. {
  17. "ip": "1.2.3.4",
  18. "last_seen": 1417222374433,
  19. "user_agent": "Mozilla/5.0 ..."
  20. },
  21. {
  22. "ip": "1.2.3.10",
  23. "last_seen": 1417222374500,
  24. "user_agent": "Dalvik/2.1.0 ..."
  25. }
  26. ]
  27. }
  28. ]
  29. }
  30. }
  31. }
  32. ``last_seen`` is measured in milliseconds since the Unix epoch.
  33. Deactivate Account
  34. ==================
  35. This API deactivates an account. It removes active access tokens, resets the
  36. password, and deletes third-party IDs (to prevent the user requesting a
  37. password reset). It can also mark the user as GDPR-erased (stopping their data
  38. from distributed further, and deleting it entirely if there are no other
  39. references to it).
  40. The api is::
  41. POST /_matrix/client/r0/admin/deactivate/<user_id>
  42. with a body of:
  43. .. code:: json
  44. {
  45. "erase": true
  46. }
  47. including an ``access_token`` of a server admin.
  48. The erase parameter is optional and defaults to 'false'.
  49. An empty body may be passed for backwards compatibility.
  50. Reset password
  51. ==============
  52. Changes the password of another user.
  53. The api is::
  54. POST /_matrix/client/r0/admin/reset_password/<user_id>
  55. with a body of:
  56. .. code:: json
  57. {
  58. "new_password": "<secret>"
  59. }
  60. including an ``access_token`` of a server admin.