API Overview
The DataPulse Analytics REST API provides programmatic access to our advanced analytics engine, customer intelligence platform, and machine learning models. All requests and responses use JSON format.
429 Too Many Requests.Base URL & Environments
All API requests must be made over HTTPS. Calls made over plain HTTP will fail.
Authentication
DataPulse uses API keys for authentication. You can manage your keys in the Developer Dashboard.
Authorization: Bearer dp_live_sk_8x92mK4vL1pQ7nR3zW5yJ2hG6fD0sA
Analytics Engine
Query aggregated metrics, run ad-hoc analytical queries, and retrieve real-time KPI summaries.
Retrieve KPI Summary
Fetches high-level business metrics aggregated over the specified time window. Supports multiple business verticals.
| Parameter | Type | Description |
|---|---|---|
| period | string | Time range: 7d, 30d, 90d, 1y |
| vertical | string | Business domain: retail, saaS, finance |
{
"data": {
"revenue": 2845000,
"active_users": 18420,
"conversion_rate": 0.042,
"churn_risk": "low",
"trend": "upward",
"period": "30d"
},
"meta": {
"generated_at": "2025-01-15T08:30:00Z",
"cache_hit": true
}
}
Run Ad-Hoc Query
Execute custom analytical queries against your dataset. Returns structured results with execution metadata.
| Parameter | Type | Description |
|---|---|---|
| sqlRequired | string | SQL-like query string (sandbox validated) |
| limit | integer | Max rows to return (default: 100, max: 10000) |
{
"sql": "SELECT region, SUM(revenue) FROM transactions GROUP BY region ORDER BY revenue DESC",
"limit": 50
}
Customer Data
Access unified customer profiles, behavioral segments, and lifetime value predictions.
Get Customer Profile
Retrieves the unified customer profile including engagement metrics, segments, and CLV prediction.
| Parameter | Type | Description |
|---|---|---|
| idRequired | string | Customer UUID or external ID |
{
"customer_id": "cust_92f8a3b1",
"segments": ["high_value", "early_adopter"],
"lifetime_value": 4820.50,
"last_interaction": "2025-01-14T16:22:00Z",
"churn_probability": 0.12
}
ML Predictions
Leverage pre-trained models for forecasting, anomaly detection, and predictive scoring.
Run Prediction
Submits feature data to a deployed model and returns prediction scores with confidence intervals.
| Parameter | Type | Description |
|---|---|---|
| model_idRequired | string | Deployed model identifier |
| featuresRequired | object | Key-value pairs of input features |
{
"prediction": "churn_likely",
"confidence": 0.87,
"reasons": ["declining_engagement", "support_ticket_spike"],
"model_version": "v3.2.1"
}
Report Generation
Programmatically generate, schedule, and export analytical reports.
Export Report
Generates a downloadable report in CSV, PDF, or Excel format based on query parameters or report templates.
{
"template_id": "tmpl_q3_performance",
"format": "pdf",
"include_charts": true,
"date_range": { "start": "2024-10-01", "end": "2024-12-31" }
}
Error Handling
DataPulse uses conventional HTTP response codes to indicate success or failure of requests.
| Code | Meaning | Resolution |
|---|---|---|
400 | Bad Request | Invalid syntax or missing required parameters |
401 | Unauthorized | Missing or invalid API key |
403 | Forbidden | Insufficient permissions for this endpoint |
404 | Not Found | Resource or endpoint does not exist |
429 | Too Many Requests | Rate limit exceeded. Retry after `Retry-After` header |
500 | Internal Error | Server-side issue. Contact support with trace ID |