Skip to main content
POST
Report agent activity

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Headers

X-Opal-Actor
string

The identity the reporting client claims this activity belongs to - an email or an Anthropic user id. Unverified: a Claude Code hook payload contains no user identity, so this has to be injected by whoever deploys the hook (via the http handler's headers map and allowedEnvVars interpolation), and whoever controls the machine controls the header. Used only when the API key itself does not identify a developer. Omitting it is valid.

Body

application/json

AgentActivityIngestRequest Object

Description

A batch of agent activity events.

Three body shapes are accepted: this envelope ({"events": [...]}), a bare JSON array of AgentActivityEvent, and a single AgentActivityEvent object. The last exists so a Claude Code hook can POST here directly, since a hook sends one bare payload per event and cannot wrap it.

events
object[]

Response

A per-batch accounting of what was accepted, stored, and attributed.

AgentActivityIngestResult Object

Description

What one ingest request actually did.

received and stored differ when a delivery was retried and deduplicated. attributed and unattributed sum to received rather than to stored, because attribution happens before deduplication. Unattributed events are kept, not dropped: activity Opal cannot tie to a governed agent is itself a governance finding.

received
integer
required

Events parsed out of the request body.

stored
integer
required

Rows actually written. Lower than received when a retried delivery was deduplicated on tool_use_id.

attributed
integer
required

Events that resolved to an agent in this organization.

unattributed
integer
required

Events that resolved to no agent, and are therefore visible only in the unattributed activity list. A persistently high value means the reporting clients are not sending an identity Opal can resolve.