The current API implementation supports CSV exports. PDF export currently returns 501 Not Implemented; Excel is documented here as the product schema to use when the workbook export is enabled.
Export Endpoint
Use GET /api/analytics/export.
| Query parameter | Values | Default |
|---|---|---|
format | csv, pdf | csv |
timeframe | today, week, month, quarter | week |
CSV responses are downloaded as analytics-{timeframe}-{YYYY-MM-DD}.csv.
Export Procedure
Use this procedure when preparing weekly support reviews, stakeholder reports, or handoff audits.
- Confirm the active organization or assistant context before exporting.
- Choose the reporting timeframe. Use
todayfor incident review,weekfor support standups,monthfor operating reviews, andquarterfor trend analysis. - Request
GET /api/analytics/export?format=csv&timeframe={timeframe}from an authenticated session. - Save the downloaded CSV with the generated filename and add the report purpose if storing it in a shared drive.
- Validate the generated timestamp, timeframe, and headline totals against the dashboard.
- Filter or redact customer-identifying data before sharing outside the support, product, or leadership audience approved for that report.
- Record follow-up actions separately from the export so the raw report remains reproducible.
Do not use exports as a substitute for transcript review when making operator coaching, refund, legal, security, or privacy decisions. Exports summarize metrics; they do not preserve the full support context.
CSV Schema
CSV is generated as a sectioned report, not a single normalized table.
| Section | Columns |
|---|---|
| Report header | Analytics Export Report; Generated: {ISO timestamp} |
| Overview | Metric, Value |
| Conversations over time | Date, Count |
| Messages over time | Date, Count |
| Response time over time | Date, Average Time (ms) |
| Top pages | Page, Interactions |
| User engagement by hour | Hour, Interactions |
| Peak hours | Hour, Activity |
| Popular templates | Template ID, Usage Count |
| Common errors | Error, Count |
| User journey | Step, Completion Rate |
PDF Schema
When PDF export is implemented, keep it aligned to the dashboard and CSV report:
| PDF section | Required fields |
|---|---|
| Cover | Report title, selected timeframe, generated timestamp, assistant or organization context. |
| Executive summary | Total conversations, total messages, active users, average response time, satisfaction or average rating. |
| Trends | Daily conversations and messages table or chart. |
| Performance | Average response time plus fast, medium, and slow response counts. |
| Sources | FAQ-source messages, document-source messages, direct responses, and raw source-match counts. |
| Engagement | Hourly message distribution. |
| Sentiment | Positive, neutral, negative counts and average satisfaction when sentiment data is included. |
| Appendix | Export parameters, date range, and known metric limits. |
Excel Workbook Schema
Excel exports should use one worksheet per analytical surface:
| Worksheet | Columns |
|---|---|
Overview | metric_key, metric_label, value, unit, calculation_note |
Conversation trends | date, conversations, messages |
Response metrics | avg_response_time_seconds, fast_responses, medium_responses, slow_responses |
Source usage | source_type, assistant_messages, raw_match_count, percentage_of_assistant_messages |
Popular topics | topic, count, trend |
Hourly engagement | time_slot, messages, users_placeholder |
Sentiment overview | total_conversations, average_satisfaction, positive, neutral, negative, average_response_time_seconds |
Sentiment topics | topic, count |
Sentiment categories | category, count, percentage |
Recent analyses | conversation_id, sentiment_label, sentiment_score, sentiment_confidence, topics, categories, satisfaction_score |
Use ISO-8601 timestamps for generated-at metadata and preserve numeric values as numbers, not formatted strings.