Action guide

Know who shared what, with whom, when

POST/v1/events · document.shared

Emit 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.

KeyPurpose
documentIdYour internal document id
visibilityprivate, org_wide, link, public
recipientCountNumber of distinct recipients
expiresAtWhen the share link expires, if any
Suggested retention

Keep for at least 12 months, sharing is the most common vector for accidental data exposure.

Related actions