Analytics API
The Analytics API provides programmatic access to your workflow performance data, customer engagement metrics, and business intelligence. Use this API to build custom dashboards, generate reports, and integrate analytics into your own applications.Overview
The Analytics API allows you to:- Retrieve workflow performance metrics
- Access customer engagement data
- Get real-time analytics
- Export historical data
- Create custom reports
Authentication
All Analytics API requests require authentication. Include your API key in theAuthorization
header:
Workflow Analytics
Get Workflow Metrics
Retrieve comprehensive metrics for a specific workflow.Request
Parameters
Parameter | Type | Description |
---|---|---|
start_date | string | Start date for metrics (ISO 8601) |
end_date | string | End date for metrics (ISO 8601) |
granularity | string | Data granularity (hour , day , week , month ) |
metrics | array | Specific metrics to include |
group_by | array | Group data by fields |
Response
Get Workflow Performance
Get detailed performance metrics for a workflow.Request
Parameters
Parameter | Type | Description |
---|---|---|
start_date | string | Start date for metrics (ISO 8601) |
end_date | string | End date for metrics (ISO 8601) |
include_nodes | boolean | Include node-level metrics |
include_channels | boolean | Include channel breakdown |
Response
Customer Analytics
Get Customer Engagement
Retrieve customer engagement metrics.Request
Parameters
Parameter | Type | Description |
---|---|---|
start_date | string | Start date for metrics (ISO 8601) |
end_date | string | End date for metrics (ISO 8601) |
customer_segment | string | Filter by customer segment |
channel | string | Filter by communication channel |
Response
Get Customer Journey
Analyze customer journey patterns.Request
Parameters
Parameter | Type | Description |
---|---|---|
start_date | string | Start date for analysis (ISO 8601) |
end_date | string | End date for analysis (ISO 8601) |
journey_type | string | Type of journey to analyze |
include_dropoffs | boolean | Include drop-off analysis |
Response
Real-time Analytics
Get Real-time Metrics
Retrieve real-time analytics data.Request
Parameters
Parameter | Type | Description |
---|---|---|
workflow_id | string | Filter by specific workflow |
channel | string | Filter by communication channel |
include_system | boolean | Include system performance metrics |
Response
Custom Reports
Create Custom Report
Create a custom analytics report.Request
Request Body
Response
Get Report Status
Check the status of a custom report.Request
Response
Download Report
Download a completed report.Request
Response
The response will be the report file (CSV, JSON, or PDF depending on the format requested).Data Export
Export Analytics Data
Export analytics data in various formats.Request
Request Body
Response
Error Handling
Common Error Codes
Status Code | Error Code | Description |
---|---|---|
400 | INVALID_DATE_RANGE | Date range is invalid |
400 | INVALID_METRICS | Requested metrics are invalid |
404 | WORKFLOW_NOT_FOUND | Workflow does not exist |
422 | INVALID_GRANULARITY | Granularity parameter is invalid |
429 | RATE_LIMIT_EXCEEDED | Rate limit exceeded |
500 | REPORT_GENERATION_FAILED | Report generation failed |
Error Response Format
Rate Limiting
Analytics API endpoints are subject to rate limiting:- Real-time metrics: 1000 requests per hour
- Historical metrics: 100 requests per hour
- Custom reports: 50 requests per hour
- Data export: 20 requests per hour
Best Practices
Efficient Data Retrieval
Date Range Selection
Date Range Selection
- Use appropriate date ranges for your needs
- Avoid requesting data for very long periods
- Use granularity to reduce data volume
Metric Selection
Metric Selection
- Only request metrics you need
- Use filters to reduce data volume
- Cache frequently accessed data
Performance Optimization
Caching
Caching
- Cache analytics data when possible
- Use appropriate cache TTL values
- Implement cache invalidation strategies
Pagination
Pagination
- Use pagination for large datasets
- Set appropriate page sizes
- Implement efficient pagination logic