Overview
While every event has a primary resource (resource.type, resource.id, resource.name), many actions involve multiple resources. The targets field lets you attach additional resources to an event for cross-resource tracking.
Target Structure
Each target object has the following fields:The type of resource. Example:
folder, team, permission.The resource identifier. Example:
folder_3mK9pLq.Human-readable name. Example:
Engineering Team.Optional metadata specific to this target.
Example
A user shares a document with a team and moves it to a folder:Filtering by Target
Query events by target using thetarget_type and target_id query parameters:
targets array, regardless of the primary resource.
Use Cases
| Scenario | Primary Resource | Targets |
|---|---|---|
| File moved to folder | File | Source folder, destination folder |
| User added to team | User | Team, role |
| Permission granted | Permission | User, resource |
| Invoice payment applied | Invoice | Payment method, subscription |
| Merge request approved | Merge request | Repository, reviewer |
| Bulk action on records | Batch operation | Individual records affected |
SDK Usage
Hash Chain
Targets are included in the hash chain computation. They are sorted bytype then id before hashing to ensure deterministic results regardless of the order you provide them.