Reports API
Build, execute, schedule, share, and export custom reports. All endpoints require JWT authentication and the analytics:read permission.
For a user guide on creating and managing reports in the dashboard, see Reports.
Endpoints
CRUD
| Method | Path | Description |
|---|---|---|
GET | /v1/reports | List reports |
POST | /v1/reports | Create a report |
GET | /v1/reports/{id} | Get a report |
PUT | /v1/reports/{id} | Update a report |
DELETE | /v1/reports/{id} | Delete a report |
POST | /v1/reports/{id}/duplicate | Duplicate a report |
Data Retrieval
| Method | Path | Description |
|---|---|---|
GET | /v1/reports/{id}/data | Execute report and return data |
GET | /v1/reports/fields | Discover available metrics, dimensions, and filters |
POST | /v1/reports/query | Ad-hoc query (live preview, no save) |
Export
| Method | Path | Description |
|---|---|---|
GET | /v1/reports/{id}/export/csv | Export report as CSV |
GET | /v1/reports/{id}/export/pdf | Export report as printable HTML/PDF |
Sharing
| Method | Path | Description |
|---|---|---|
POST | /v1/reports/{id}/share | Create a shareable link |
DELETE | /v1/reports/{id}/share | Revoke a share link |
GET | /v1/reports/shared/{token} | View shared report (public, no auth) |
Scheduling
| Method | Path | Description |
|---|---|---|
POST | /v1/reports/{id}/schedule | Create a schedule |
GET | /v1/reports/{id}/schedule | Get schedule |
PUT | /v1/reports/{id}/schedule | Update schedule |
DELETE | /v1/reports/{id}/schedule | Delete schedule |
POST | /v1/reports/{id}/schedule/pause | Pause schedule |
POST | /v1/reports/{id}/schedule/resume | Resume schedule |
Pre-built Analysis
| Method | Path | Description |
|---|---|---|
POST | /v1/reports/funnel | Email or flow funnel analysis |
POST | /v1/reports/cohort | Cohort retention analysis |
POST | /v1/reports/compare-flows | Compare 2--4 flows side by side |
POST | /v1/reports/flow-groups | Flow performance grouped by tags |
Authentication
All endpoints (except /v1/reports/shared/{token}) require a JWT bearer token:
The authenticated user must have analytics:read permission. Missing permission returns:
List Reports
Query Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
tab | string | all | Filter: all, mine, shared, scheduled |
report_type | string | Filter by report type | |
visibility | string | Filter: private, workspace | |
created_by | string | Filter by creator's member ID | |
search | string | Search by name or description | |
sort_by | string | last_viewed_at | Sort: last_viewed_at, updated_at, name, created_at |
sort_dir | string | desc | Direction: asc, desc |
offset | integer | 0 | Pagination offset |
limit | integer | 50 | Items per page (1--100) |
Response
The first time you list reports, Synapse automatically creates pre-built report templates for your workspace. These have is_template: true and created_by: null.
Create a Report
Request Body
| Field | Type | Required | Description |
|---|---|---|---|
name | string | Yes | Report name (1--255 characters) |
description | string | No | Description |
report_type | string | No | One of: email_performance, flow_performance, contact_growth, deliverability, engagement, plan_usage, funnel_analysis, flow_comparison, flow_group_performance, custom (default) |
config | object | No | Report configuration (see below) |
visibility | string | No | private (default) or workspace |
Config Object
| Field | Type | Default | Description |
|---|---|---|---|
data_source | string | email_logs | Data source: email_logs, flows, flow_trips, contacts, events |
metrics | array | [] | Metrics to compute |
dimensions | array | [] | Dimensions to group by |
filters | array | [] | Filters to apply |
chart_type | string | line | Chart type: line, bar, area, pie, table |
comparison_enabled | boolean | false | Enable period-over-period comparison |
date_range_default | string | 30d | Default date range |
Response (201 Created)
Returns the full ReportResponse object (same shape as list items).
Get a Report
Returns the report metadata. Also updates last_viewed_at to the current time.
Execute Report (Get Data)
Query Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
date_range | string | Report's default | Preset: 1d, 7d, 30d, 90d, today, yesterday |
from_date | datetime | Explicit start (overrides preset) | |
to_date | datetime | Explicit end (overrides preset) | |
compare | boolean | false | Include comparison to previous period |
Response
Results are cached for 5 minutes. The same report with the same date range returns cached data within that window.
Update a Report
All fields are optional. Only the fields you include are updated.
Delete a Report
Returns 204 No Content on success. Also deletes any associated schedule and share link.
Duplicate a Report
Creates a copy with " (Copy)" appended to the name. The duplicate is always private visibility with no schedule or share link.
Returns 201 Created with the new report.
Field Discovery
Response
Ad-hoc Query
Execute a report configuration without saving it. Used for the report builder's live preview.
Request Body
| Field | Type | Default | Description |
|---|---|---|---|
config | object | Required | Same config object as POST /v1/reports |
date_range | string | 30d | Preset date range |
from_date | string | ISO 8601 start date | |
to_date | string | ISO 8601 end date | |
compare | boolean | false | Include comparison period |
Returns the same ReportDataResponse as GET /v1/reports/{id}/data.
CSV Export
Query Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
date_range | string | Report's default | Preset date range |
from_date | datetime | Explicit start date | |
to_date | datetime | Explicit end date |
Returns a text/csv streaming response with Content-Disposition: attachment header.
PDF Export
Returns an HTML page styled for printing. The page automatically triggers the browser's print dialog via JavaScript. Table data is limited to 100 rows.
Share a Report
Create Share Link
| Field | Type | Default | Description |
|---|---|---|---|
expires_in_days | integer | 7 | Link validity: 1--90 days |
Response
View Shared Report (Public)
No authentication required. Returns the same ReportDataResponse as the authenticated data endpoint.
Revoke Share Link
Returns 204 No Content.
Schedule a Report
Create Schedule
Request Body
| Field | Type | Required | Description |
|---|---|---|---|
frequency | string | Yes | daily, weekly, or monthly |
day_of_week | integer | Weekly only | 0 (Mon) -- 6 (Sun) |
day_of_month | integer | Monthly only | 1--28 |
hour | integer | No | Hour of day, 0--23 (default: 9) |
timezone | string | No | IANA timezone (default: UTC) |
date_range_type | string | No | previous_day, previous_7d (default), previous_30d, previous_month, mtd |
recipients | array | Yes | 1--10 recipients, each with email (required) and name (optional) |
format_options | object | No | chart_image, csv_attachment, kpi_only (all boolean, default false) |
Response (201 Created)
Each report can have only one schedule. Attempting to create a second schedule returns 409 Conflict. Use PUT to update the existing schedule instead.
Get Schedule
Update Schedule
All fields are optional. Only provided fields are updated. The next_send_at is recalculated automatically.
Delete Schedule
Returns 204 No Content.
Pause / Resume
Both return the updated ScheduleResponse. Pausing sets is_active: false. Resuming sets is_active: true and recalculates next_send_at.
Error Codes
| Status | Code | Description |
|---|---|---|
| 403 | Missing analytics:read permission | |
| 404 | Report or schedule not found | |
| 409 | Schedule already exists (use PUT to update) | |
| 410 | Shared link has expired | |
| 422 | Validation error (e.g., missing flow_id for flow funnel, missing day_of_week for weekly schedule) |