Email an Activity Report
Queue the activity report and email it to the caller.
Gated on manage rather than read: this sends outbound mail on the org’s behalf and packages every rep’s numbers into files that leave the app. Viewing the Reports tab stays open to anyone with CRM read.
ActivityReportWorkflow on the Temporal CX_REPORTS_TASK_QUEUE and returns as soon as the workflow is accepted; the workflow does the fetch → render → email work asynchronously and lands the result in the caller’s inbox. Because the render dependencies are only installed in the render-worker image, this endpoint can 503 in any deployment where that workflow’s imports aren’t available — that’s an environment gap, not a request error.
token.sub → Logto user lookup) — there’s no to/email field you can set on the body. Accepting an arbitrary address here would turn this into a way to mail an org’s entire activity history to anyone, off-org. If the caller’s Logto profile has no email address, the request fails with 400 rather than silently dropping the send.date_from/date_to plus pre-rendered display labels before sending the request.
Auth
Requires a CRM manage scope (any*:manage, e.g. deals:manage) and an active organization on the token. Gated on manage rather than read because it mails every rep’s numbers out of the app; viewing the same data in the Reports tab only needs CRM read.
Response
202 Accepted — the workflow was queued; delivery itself happens asynchronously.
Errors
Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Body
The report window is sent as explicit bounds, never a relative phrase.
This endpoint does not interpret date vocabulary like "this week" — the
caller resolves it into literal date_from/date_to plus the display
labels it wants rendered, so the report reads exactly as the caller intended
rather than re-deriving the window from a second definition that could drift.
Inclusive start of the report window (ISO date/datetime). Must be an explicit bound; relative phrases are not interpreted.
Inclusive end of the report window (ISO date/datetime). Must be an explicit bound; relative phrases are not interpreted.
Long display label for the window, e.g. "Last 7 days · 4 - 10 Aug 2026", rendered in the generated report's header.
Shorter display label for the same window, rendered where the report layout is narrow.
Display label for the comparison period shown alongside the main window, if any.
Activity types to include (e.g. "call", "email"); omit or null for every type.
Logto user ids to scope the report to; omit or null for every rep.
Row-export attachment formats to generate; only "xlsx" and "csv" are honored, anything else is silently dropped.
Raw PostgREST filter expressions applied to the row-level export, mirroring whatever feed filters (search/source/linkage) the caller had applied.
Response
Successful Response
The response is of type Response Email Activity Report Reports Activity Email Post · object.