The Reports API provides endpoints for generating, managing, and exporting various types of reports from bot data and analytics.
This API is on the development roadmap. The endpoints documented below represent the planned interface design.
http://localhost:9000/api/v1/reports
Uses the standard botserver authentication mechanism with appropriate role-based permissions.
Method Endpoint Description
POST /api/v1/reports/generateGenerate a new report
GET /api/v1/reports/{report_id}/statusGet report generation status
GET /api/v1/reports/{report_id}Get report metadata
Method Endpoint Description
GET /api/v1/reportsList all reports
GET /api/v1/reports/{report_id}/downloadDownload report file
DELETE /api/v1/reports/{report_id}Delete a report
Method Endpoint Description
POST /api/v1/reports/scheduleCreate scheduled report
GET /api/v1/reports/scheduleList scheduled reports
PUT /api/v1/reports/schedule/{schedule_id}Update schedule
DELETE /api/v1/reports/schedule/{schedule_id}Delete schedule
Method Endpoint Description
GET /api/v1/reports/templatesList available templates
POST /api/v1/reports/templatesCreate custom template
GET /api/v1/reports/templates/{template_id}Get template details
Type Description
usageBot usage and activity metrics
conversationsConversation analysis and statistics
performanceSystem performance metrics
complianceCompliance and audit reports
customCustom report with user-defined metrics
Format Extension Description
PDF .pdfFormatted document with charts
CSV .csvRaw data export
Excel .xlsxSpreadsheet with multiple sheets
JSON .jsonMachine-readable format
HTML .htmlWeb-viewable format
report_config = NEW OBJECT
report_config.type = "usage"
report_config.start_date = "2025-01-01"
report_config.end_date = "2025-01-31"
report_config.format = "pdf"
report_config.include_charts = true
result = POST "/api/v1/reports/generate", report_config
TALK "Report ID: " + result.report_id
status = GET "/api/v1/reports/rpt-123/status"
IF status.state = "completed" THEN
TALK "Report ready for download"
url = GET "/api/v1/reports/rpt-123/download"
ELSE
TALK "Report generation: " + status.progress + "%"
END IF
schedule = NEW OBJECT
schedule.type = "conversations"
schedule.format = "pdf"
schedule.cron = "0 8 * * 1"
schedule.recipients = ["manager@company.com"]
schedule.timezone = "America/New_York"
result = POST "/api/v1/reports/schedule", schedule
TALK "Scheduled report: " + result.schedule_id
templates = GET "/api/v1/reports/templates"
FOR EACH template IN templates
TALK template.name + " - " + template.description
NEXT
report = NEW OBJECT
report.type = "custom"
report.title = "Monthly Executive Summary"
report.sections = NEW ARRAY
report.sections.ADD({"type": "usage_summary"})
report.sections.ADD({"type": "top_conversations"})
report.sections.ADD({"type": "satisfaction_scores"})
report.format = "pdf"
result = POST "/api/v1/reports/generate", report
Code Description
200 Success
201 Report created
202 Report generation started
400 Bad Request (invalid parameters)
401 Unauthorized
403 Forbidden
404 Report not found
500 Internal Server Error
Parameter Type Description
typeString Filter by report type
statusString Filter by status (pending, completed, failed)
created_afterDateTime Reports created after date
created_beforeDateTime Reports created before date
Parameter Type Description
limitInteger Number of results (default: 20, max: 100)
offsetInteger Pagination offset
sortString Sort field (created_at, name, type)
orderString Sort order (asc, desc)
Operation Required Role
Generate report report_creator or admin
View reports report_viewer or higher
Download reports report_viewer or higher
Delete reports report_admin or admin
Manage schedules report_admin or admin
Manage templates report_admin or admin