> For an agent: the map of this documentation is at https://escouade.io/en/mail/docs/llms.txt; every page exists in Markdown, at the same address with `.md` appended.

# The activity log

> The activity log says who did what, and when, in your space: your agent, you from your assistant, or the service itself. In the app, every object carries its own, and you ask the agent at the foot of that log.

## Who did what

Each line has an author, the `actor`:

| `kind` | Who | What the app shows |
|---|---|---|
| `agent` | An API key: an agent working with its own key. | The key's name. |
| `human` | An assistant's connection (Claude, ChatGPT…): a human and their assistant. | “Vous” (you) when it is the reading connection (`you` = `true`), otherwise its name. |
| `service` | Escouade Mail itself: receiving, sending, circuit breaker, administration. | “Subagent”. |

An assistant's connection acts on behalf of its human: what the assistant does through it, and what the human does in the view, carry the same author.

Each line also has a sentence in French (“Brouillon validé”, “Réponse reçue de …”, “Campagne mise en pause”). It never repeats what a third party wrote: neither the subject nor the body of an e-mail received, only an address.

## By day, or by object

`list_events` without an object returns the requested day (today by default, Paris time). With an object (an inbox, a thread, a message, a campaign, an audience, a contact or a domain), it returns everything that touches it, newest first. A key limited to some inboxes only sees the lines of its inboxes.

## A message's author, and the previous version

Every outgoing message carries `created_by`: the author who wrote it, in the same format. A draft that someone corrects keeps the version it replaces, in `previous`: its subject, its text, its HTML, the time and the author of the correction. Correcting the draft with those values means going back, and you can go back from going back. A campaign and a template likewise keep their previous version (see [Campaigns](https://escouade.io/en/mail/docs/campagnes.md#revenir)). A message that has been approved or cancelled no longer has a previous version.

## The tools

`workspace_snapshot` serves the app itself: it prepares in one go the first pages of the sections a connection can read, so that navigating the view does not read everything again. An agent does not need to call it.

### `list_events`

Reads the space's activity log: who did what, and when (your agent, you from your assistant, or the service). Access: `read`.

| Parameter | Type | Required | Description |
|---|---|---|---|
| `day` | text | no | A Paris day, YYYY-MM-DD. Absent: today, unless an object is given (then its whole history). |
| `inbox_id` | `inb_…` identifier | no | An inbox (inb_…). |
| `thread_id` | `thr_…` identifier | no | A thread (thr_…). |
| `message_id` | `msg_…` identifier | no | A message (msg_…). |
| `campaign_id` | `cmp_…` identifier | no | A campaign (cmp_…). |
| `audience_id` | `aud_…` identifier | no | An audience (aud_…). |
| `contact` | text | no | An address: its threads, its record, its blocks. |
| `domain` | text | no | A domain: its checks and its inboxes. |
| `cursor` | text | no | Cursor of the next page: the next_cursor value from the previous call. |
| `limit` | integer | no | The number of lines returned, from 1 to 200. 50 by default. |

[Full reference](https://escouade.io/en/mail/docs/reference/list_events.md)

### `workspace_snapshot`

Preloads the first pages of the sections allowed for this connection. Access: any key.

| Parameter | Type | Required | Description |
|---|---|---|---|
| `known_revision` | text | no | Opaque revision received earlier, optional. |

[Full reference](https://escouade.io/en/mail/docs/reference/workspace_snapshot.md)
