From d87d0c45e657c000069cf17578c0437517acd333 Mon Sep 17 00:00:00 2001 From: Bob Date: Wed, 14 Oct 2026 09:13:32 +0000 Subject: [PATCH 1/3] docs(api): document bulk event delete endpoint Git-Session-Id: a58a3fc2-eb2f-4600-8574-4a4b70f6fbff --- src/api/rest.rst | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/src/api/rest.rst b/src/api/rest.rst index 6225093..5f2728f 100644 --- a/src/api/rest.rst +++ b/src/api/rest.rst @@ -108,7 +108,7 @@ Status codes: ``200``, ``404`` if the bucket does not exist. Events API ~~~~~~~~~~ -The events API provides read and append access to `Events <../buckets-and-events>` in a bucket. +The events API provides read, append and delete access to `Events <../buckets-and-events>` in a bucket. Get events ^^^^^^^^^^ @@ -161,6 +161,23 @@ Get / delete a single event ``GET`` returns ``404`` for an unknown id on the Python server but ``500`` on aw-server-rust. ``DELETE`` returns ``200`` even if no event with that id exists. +Delete many events +^^^^^^^^^^^^^^^^^^ + +.. code-block:: shell + + POST /api/0/buckets//events/delete + +Body: ``{"ids": [1, 2, 3]}``. Deletes the listed events in one request and returns the number +of events that existed and were deleted, as a bare JSON number. Unknown and duplicate ids are +ignored, and an empty list returns ``0``. At most 10,000 ids are accepted per request. + +Status codes: ``200``, ``404`` if the bucket does not exist, ``413`` for more than 10,000 ids, +``400`` (Python server) or ``422`` (aw-server-rust) for a body without an integer ``ids`` list. + +This endpoint is newer than the single-event ``DELETE``; servers released before it reject the request. +Client helpers: ``ActivityWatchClient.delete_events`` (aw-client) and ``AwClient::delete_events`` (aw-client-rust). + Heartbeat API ~~~~~~~~~~~~~ From 1636e0d4eaf97bc4cff74039d8984dcefc789956 Mon Sep 17 00:00:00 2001 From: Bob Date: Wed, 14 Oct 2026 09:16:51 +0000 Subject: [PATCH 2/3] docs(api): GET of a missing event is 404 on aw-server-rust since v0.14.0 Git-Session-Id: a58a3fc2-eb2f-4600-8574-4a4b70f6fbff --- src/api/rest.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/api/rest.rst b/src/api/rest.rst index 5f2728f..58802f9 100644 --- a/src/api/rest.rst +++ b/src/api/rest.rst @@ -158,7 +158,7 @@ Get / delete a single event GET /api/0/buckets//events/ DELETE /api/0/buckets//events/ -``GET`` returns ``404`` for an unknown id on the Python server but ``500`` on aw-server-rust. +``GET`` returns ``404`` for an unknown id (aw-server-rust before v0.14.0 returned ``500``). ``DELETE`` returns ``200`` even if no event with that id exists. Delete many events From 18701f810cb39a0217698567037c0392642ebb6c Mon Sep 17 00:00:00 2001 From: Bob Date: Wed, 14 Oct 2026 11:32:53 +0000 Subject: [PATCH 3/3] ci: add apt-get update before install to fix transient mirror 404s Git-Session-Id: a2106031-86a2-4f5c-b8dc-39b2cb86b17f --- .github/workflows/build.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 078facc..1294228 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -20,6 +20,7 @@ jobs: python-version: "3.13" - name: Install APT dependencies run: | + sudo apt-get update sudo apt-get install -y git build-essential apt-utils wget libfreetype6 libpng-dev libopenblas-dev gcc gfortran libsnappy-dev graphviz - name: Install dependencies run: |