1
0

account_validity.rst 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. Account validity API
  2. ====================
  3. This API allows a server administrator to manage the validity of an account. To
  4. use it, you must enable the account validity feature (under
  5. ``account_validity``) in Synapse's configuration.
  6. Renew account
  7. -------------
  8. This API extends the validity of an account by as much time as configured in the
  9. ``period`` parameter from the ``account_validity`` configuration.
  10. The API is::
  11. POST /_synapse/admin/v1/account_validity/validity
  12. with the following body:
  13. .. code:: json
  14. {
  15. "user_id": "<user ID for the account to renew>",
  16. "expiration_ts": 0,
  17. "enable_renewal_emails": true
  18. }
  19. ``expiration_ts`` is an optional parameter and overrides the expiration date,
  20. which otherwise defaults to now + validity period.
  21. ``enable_renewal_emails`` is also an optional parameter and enables/disables
  22. sending renewal emails to the user. Defaults to true.
  23. The API returns with the new expiration date for this account, as a timestamp in
  24. milliseconds since epoch:
  25. .. code:: json
  26. {
  27. "expiration_ts": 0
  28. }