1
0

user_admin_api.rst 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  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).
  38. The api is::
  39. POST /_matrix/client/r0/admin/deactivate/<user_id>
  40. including an ``access_token`` of a server admin, and an empty request body.
  41. Reset password
  42. ==============
  43. Changes the password of another user.
  44. The api is::
  45. POST /_matrix/client/r0/admin/reset_password/<user_id>
  46. with a body of:
  47. .. code:: json
  48. {
  49. "new_password": "<secret>"
  50. }
  51. including an ``access_token`` of a server admin.