Workspace events
A workspace’s events are the record of every change to the workspace: its projects, keys, members, invitations, delegations, and sending domains, each with who made the change and when. Every member reads them, so an agent that owns a workspace alone and has no email address learns what changed overnight, as a human owner learns it from Agentpost’s emails. They record what happened on the Platform; what happens inside a project’s services is in each service’s own data.
What they record
Each event is one change, as a type that says what happened and a data.kind that says to what:
data. |
Types | Change |
|---|---|---|
workspace |
activity.created, activity.updated, activity.removed |
The workspace was created, its name or metadata changed, or it was archived. |
project |
activity.created, activity.updated, activity.removed |
A project was created, renamed, or deleted. |
service |
activity.created |
A project adopted a service. |
key |
access.created, access.updated, access.removed |
A project key was issued, rotated, had its allowed origins or native app access changed, or was revoked, by a member or with its project when the project was deleted. |
workspace-key |
access.created, access.updated, access.removed |
A workspace key was issued, rotated, or revoked. |
invitation |
access.created, access.removed |
An invitation was sent, or revoked or expired before anyone accepted it. |
member |
access.created, access.updated, access.removed |
A principal joined, changed role, was suspended or reactivated, or left. |
resource-role |
access.created, access.removed |
A role on one resource was given, or removed or expired. |
delegation-request |
access.created, access.removed |
A principal asked another to let it act for it, or that request was denied, revoked, or expired before it was approved. |
delegation |
access.created, access.removed |
A principal let another act for it in the workspace, and that ended, revoked or expired. A delegation that names no workspace is in no workspace’s events. |
domain |
activity.created, activity.removed, activity.completed, activity.failed |
A project added or removed a sending domain, the domain verified or failed, or it left the workspace because it failed and another workspace added it. |
sender |
activity.completed, activity.failed |
A verified domain became a project’s sender, or could not. |
balance |
activity.limit-approached, activity.stopped, activity.limit-recovered |
The workspace’s credit has 14, 7, 3, or 1 days left, reached $0, or started its grace; its billable calls were stopped; or it works again. Amounts are in nanodollars. |
A sending domain that leaves one workspace for another is two events, one in each workspace, and neither names the other workspace. A request that was refused changed nothing, so it has no event. A principal’s own API keys and ways to sign in belong to the principal, not to any workspace it is in, so they are in no workspace’s events; Agentpost emails the principal when it gains a way to sign in or an API key.
Who acted
Every event says who made the change in actor:
- A principal, as
principal:<id>, when a member or any principal with access made the change with its own credential. - A delegate, as
principal:<id>, with its delegator inonBehalfOf, when it acted with a delegated token. Delegations explains acting for another principal. - Agentpost, as
service:apoaorservice:identityhound, when no principal asked for the change: a sending domain check, an invitation or delegation that expired, or the workspace that signup created.
Who may read them
Reading a workspace’s events takes apoa.event:view in that workspace. Owners, admins, and members hold it, and a delegate holds it when its delegation lists it. A caller with no part in the workspace gets not_found, as for a workspace that doesn’t exist, and a principal removed from the workspace gets it on its next read. A workspace key and a project’s keys are refused with forbidden: the events are for the workspace’s members, read with their own credentials. A new member reads the workspace’s events from before it joined.
What an event holds
An event holds its id, its sequence, its type, the time the change happened, a one-line summary, actor, onBehalfOf when a delegate acted, and data. data holds IDs, never a name, an email address, or a secret: a key’s ID, never the key or its prefix, and a principal’s ID, never its email address. The summary names the workspace, project, and sending domain as they were named when the change happened, and names a principal by its ID.
An event’s id is the same for the same fact, so reading the same change twice gives the same id. sequence is the order Agentpost recorded the events in, oldest first. A change to members, invitations, or delegations is recorded a moment after it happens, so an event’s time can be earlier than the one before it.
Reading them
Read the workspace’s events with GET /v1/workspaces/{workspaceId}/events and your own API key or session. Each read answers the events after the sequence you pass as after and a next, which is the after for your next read. A read with nothing new answers no events and the same next, so a principal that keeps its last next reads only what changed since.
Email notices
An email notice is one delivery of an event. When a key is issued or rotated, a publishable key’s origins or native app access change, or a sending domain verifies or fails, Agentpost emails the workspace’s owners, as Owners describes, and the same change is an event here.
Limits
Agentpost keeps a workspace’s events for good.
Where to act on it
- Read a workspace’s events reads them, with the page sizes it takes.
- Roles lists each role’s permissions.