summary refs log tree commit diff
path: root/docs/admin_api
diff options
context:
space:
mode:
authorRichard van der Hoff <richard@matrix.org>2018-03-08 11:47:28 +0000
committerRichard van der Hoff <richard@matrix.org>2018-03-12 16:22:55 +0000
commite48c7aac4d827b66182adf80ab9804f42db186c9 (patch)
tree1363290a8c789ce70b7ac0e25dd31e6a5ecc2a53 /docs/admin_api
parentReturn an error when doing two purges on a room (diff)
downloadsynapse-e48c7aac4d827b66182adf80ab9804f42db186c9.tar.xz
Add transactional API to history purge
Make the purge request return quickly, and allow scripts to poll for updates.
Diffstat (limited to 'docs/admin_api')
-rw-r--r--docs/admin_api/purge_history_api.rst27
1 files changed, 27 insertions, 0 deletions
diff --git a/docs/admin_api/purge_history_api.rst b/docs/admin_api/purge_history_api.rst
index acf1bc5749..ea2922da5c 100644
--- a/docs/admin_api/purge_history_api.rst
+++ b/docs/admin_api/purge_history_api.rst
@@ -32,3 +32,30 @@ specified by including an event_id in the URI, or by setting a
 id is given, that event (and others at the same graph depth) will be retained.
 If ``purge_up_to_ts`` is given, it should be a timestamp since the unix epoch,
 in milliseconds.
+
+The API starts the purge running, and returns immediately with a JSON body with
+a purge id:
+
+.. code:: json
+
+    {
+        "purge_id": "<opaque id>"
+    }
+
+Purge status query
+------------------
+
+It is possible to poll for updates on recent purges with a second API;
+
+``GET /_matrix/client/r0/admin/purge_history_status/<purge_id>``
+
+(again, with a suitable ``access_token``). This API returns a JSON body like
+the following:
+
+.. code:: json
+
+    {
+        "status": "active"
+    }
+
+The status will be one of ``active``, ``complete``, or ``failed``.