Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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: |
Expand Down
21 changes: 19 additions & 2 deletions src/api/rest.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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
^^^^^^^^^^
Expand Down Expand Up @@ -158,9 +158,26 @@ Get / delete a single event
GET /api/0/buckets/<bucket_id>/events/<event_id>
DELETE /api/0/buckets/<bucket_id>/events/<event_id>

``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
^^^^^^^^^^^^^^^^^^

.. code-block:: shell

POST /api/0/buckets/<bucket_id>/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
~~~~~~~~~~~~~

Expand Down
Loading