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 parameterValuesDefault
formatcsv, pdfcsv
timeframetoday, week, month, quarterweek

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.

  1. Confirm the active organization or assistant context before exporting.
  2. Choose the reporting timeframe. Use today for incident review, week for support standups, month for operating reviews, and quarter for trend analysis.
  3. Request GET /api/analytics/export?format=csv&timeframe={timeframe} from an authenticated session.
  4. Save the downloaded CSV with the generated filename and add the report purpose if storing it in a shared drive.
  5. Validate the generated timestamp, timeframe, and headline totals against the dashboard.
  6. Filter or redact customer-identifying data before sharing outside the support, product, or leadership audience approved for that report.
  7. Record follow-up actions separately from the export so the raw report remains reproducible.

CSV Schema

CSV is generated as a sectioned report, not a single normalized table.

SectionColumns
Report headerAnalytics Export Report; Generated: {ISO timestamp}
OverviewMetric, Value
Conversations over timeDate, Count
Messages over timeDate, Count
Response time over timeDate, Average Time (ms)
Top pagesPage, Interactions
User engagement by hourHour, Interactions
Peak hoursHour, Activity
Popular templatesTemplate ID, Usage Count
Common errorsError, Count
User journeyStep, Completion Rate

PDF Schema

When PDF export is implemented, keep it aligned to the dashboard and CSV report:

PDF sectionRequired fields
CoverReport title, selected timeframe, generated timestamp, assistant or organization context.
Executive summaryTotal conversations, total messages, active users, average response time, satisfaction or average rating.
TrendsDaily conversations and messages table or chart.
PerformanceAverage response time plus fast, medium, and slow response counts.
SourcesFAQ-source messages, document-source messages, direct responses, and raw source-match counts.
EngagementHourly message distribution.
SentimentPositive, neutral, negative counts and average satisfaction when sentiment data is included.
AppendixExport parameters, date range, and known metric limits.

Excel Workbook Schema

Excel exports should use one worksheet per analytical surface:

WorksheetColumns
Overviewmetric_key, metric_label, value, unit, calculation_note
Conversation trendsdate, conversations, messages
Response metricsavg_response_time_seconds, fast_responses, medium_responses, slow_responses
Source usagesource_type, assistant_messages, raw_match_count, percentage_of_assistant_messages
Popular topicstopic, count, trend
Hourly engagementtime_slot, messages, users_placeholder
Sentiment overviewtotal_conversations, average_satisfaction, positive, neutral, negative, average_response_time_seconds
Sentiment topicstopic, count
Sentiment categoriescategory, count, percentage
Recent analysesconversation_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.