Action guide
Know who shared what, with whom, when
POST
/v1/events · document.sharedEmit a `document.shared` event whenever a user generates a share link, invites a recipient, or changes the visibility of a document.
When to emit
Inside the share endpoint, after the share row is created and before the invitation email is queued.
Example payload
await recalled.events.create({
action: "document.shared",
actor: { id: user.id, email: user.email },
organization: user.organizationId,
metadata: {
documentId: "value",
visibility: "value",
recipientCount: "value"
},
});Metadata to include
Keep metadata flat and consistent across your service so it plays well with search and CSV exports.
| Key | Purpose |
|---|---|
documentId | Your internal document id |
visibility | private, org_wide, link, public |
recipientCount | Number of distinct recipients |
expiresAt | When the share link expires, if any |
Suggested retention
Keep for at least 12 months, sharing is the most common vector for accidental data exposure.