The Stellar API provides privacy-first data analytics and visualization capabilities. All endpoints are designed with privacy protection as a primary concern.
Development: http://localhost:3001/api/v1
Production: https://your-domain.com/api/v1
Stellar uses JWT-based authentication with privacy-enhanced features:
Authorization: Bearer <jwt_token>
X-Privacy-Level: high|maximum|standard|minimal
X-Consent: true|falsePOST /auth/registerRequest Body:
{
"email": "user@example.com",
"password": "secure_password",
"privacySettings": {
"level": "high",
"dataRetentionDays": 365,
"allowDataExport": true
}
}Response:
{
"userId": "uuid",
"token": "jwt_token",
"user": {
"id": "uuid",
"email": "user@example.com",
"privacyLevel": "high"
}
}POST /auth/loginRequest Body:
{
"email": "user@example.com",
"password": "secure_password"
}Response:
{
"token": "jwt_token",
"user": {
"id": "uuid",
"email": "user@example.com",
"privacyLevel": "high"
},
"expiresIn": "24h"
}POST /data/uploadHeaders:
Content-Type: multipart/form-dataX-Privacy-Level: high
Request Body:
file: <dataset_file>
privacyLevel: "high"
encryptionRequired: true
Response:
{
"datasetId": "uuid",
"status": "uploaded",
"encrypted": true,
"privacyScore": 0.85,
"recordsProcessed": 1000
}GET /dataQuery Parameters:
page: Page number (default: 1)limit: Items per page (default: 10)privacyLevel: Filter by privacy levelstatus: Filter by status
Response:
{
"datasets": [
{
"id": "uuid",
"name": "Customer Data",
"size": "2.4GB",
"records": 125000,
"encrypted": true,
"privacyLevel": "high",
"uploadedAt": "2024-01-15T10:00:00Z",
"status": "processed"
}
],
"pagination": {
"page": 1,
"limit": 10,
"total": 25,
"totalPages": 3
}
}GET /data/{datasetId}Response:
{
"id": "uuid",
"name": "Customer Data",
"description": "Customer behavior analysis dataset",
"schema": {
"fields": [
{
"name": "customer_id",
"type": "string",
"encrypted": true,
"sensitive": false
},
{
"name": "purchase_amount",
"type": "numerical",
"encrypted": true,
"sensitive": true
}
]
},
"privacyMetrics": {
"encryptionStrength": "AES-256",
"anonymizationLevel": "high",
"differentialPrivacyEpsilon": 1.0,
"reidentificationRisk": 0.02
}
}DELETE /data/{datasetId}Response:
{
"message": "Dataset deleted successfully",
"auditLog": {
"id": "uuid",
"action": "delete",
"timestamp": "2024-01-15T10:00:00Z"
}
}POST /analyticsRequest Body:
{
"name": "Customer Behavior Analysis",
"type": "descriptive",
"datasetId": "uuid",
"parameters": {
"fields": ["purchase_amount", "frequency"],
"privacyBudget": 1.0,
"minimumSampleSize": 50,
"aggregations": ["mean", "count", "std_dev"]
},
"privacySettings": {
"differentialPrivacyEpsilon": 0.5,
"noiseMechanism": "laplace",
"anonymizationLevel": "high"
}
}Response:
{
"analysisId": "uuid",
"status": "pending",
"estimatedDuration": "5-10 minutes",
"privacyBudgetReserved": 0.5,
"jobId": "job_uuid"
}GET /analyticsQuery Parameters:
status: Filter by statustype: Filter by analysis typedatasetId: Filter by dataset
Response:
{
"analyses": [
{
"id": "uuid",
"name": "Customer Behavior Analysis",
"type": "descriptive",
"status": "completed",
"createdAt": "2024-01-15T10:00:00Z",
"completedAt": "2024-01-15T10:05:00Z",
"privacyScore": 0.92,
"accuracy": 0.94
}
]
}GET /analytics/{analysisId}Response:
{
"id": "uuid",
"name": "Customer Behavior Analysis",
"status": "completed",
"results": {
"summary": {
"totalRecords": 1000,
"processedRecords": 950,
"privacyBudgetUsed": 0.45,
"executionTimeMs": 120000
},
"data": [
{
"field": "purchase_amount",
"metrics": {
"mean": 125.50,
"count": 950,
"stdDev": 45.25,
"privacyNoise": 2.1,
"confidence": 0.95
}
}
],
"visualizations": [
{
"type": "histogram",
"title": "Purchase Amount Distribution",
"config": {
"bins": 20,
"xAxis": "purchase_amount",
"yAxis": "frequency"
},
"privacyAnnotations": [
{
"type": "noise_level",
"message": "Data includes differential privacy noise (ε=0.5)",
"level": "info"
}
]
}
],
"privacyMetrics": {
"epsilonUsed": 0.45,
"remainingBudget": 0.55,
"anonymizationStrength": 0.92,
"dataUtilityScore": 0.88,
"reidentificationRisk": 0.01
}
}
}POST /analytics/{analysisId}/runRequest Body:
{
"privacyBudget": 0.5,
"parameters": {
"filters": [
{
"field": "purchase_amount",
"operator": "gt",
"value": 0
}
]
}
}Response:
{
"jobId": "uuid",
"status": "running",
"estimatedCompletion": "2024-01-15T10:10:00Z",
"privacyBudgetAllocated": 0.5
}GET /privacy/settingsResponse:
{
"level": "high",
"dataRetentionDays": 365,
"allowDataExport": true,
"allowSharing": false,
"differentialPrivacyEpsilon": 1.0,
"minimumParticipants": 5,
"anonymizationTechnique": "differential_privacy",
"privacyScore": 0.92
}PUT /privacy/settingsRequest Body:
{
"level": "maximum",
"dataRetentionDays": 180,
"allowDataExport": false,
"differentialPrivacyEpsilon": 0.5,
"minimumParticipants": 10
}Response:
{
"message": "Privacy settings updated successfully",
"privacyScore": 0.96,
"changesApplied": [
"privacy_level",
"data_retention",
"differential_privacy_epsilon"
]
}GET /privacy/auditQuery Parameters:
startDate: Filter by start dateendDate: Filter by end dateaction: Filter by action typeuserId: Filter by user
Response:
{
"logs": [
{
"id": "uuid",
"userId": "uuid",
"action": "data_access",
"resource": "dataset_uuid",
"privacyLevel": "high",
"dataAccessed": ["customer_id", "purchase_amount"],
"timestamp": "2024-01-15T10:00:00Z",
"ipAddress": "192.168.1.100",
"userAgent": "Mozilla/5.0...",
"success": true,
"privacyImpact": "low"
}
],
"pagination": {
"page": 1,
"limit": 50,
"total": 1000
}
}GET /privacy/consentResponse:
{
"consents": [
{
"id": "uuid",
"userId": "uuid",
"dataSchemaId": "uuid",
"purposes": ["analytics", "research"],
"granted": true,
"timestamp": "2024-01-15T10:00:00Z",
"expiresAt": "2025-01-15T10:00:00Z",
"version": 1,
"ipAddress": "192.168.1.100"
}
]
}POST /privacy/consentRequest Body:
{
"dataSchemaId": "uuid",
"purposes": ["analytics", "research", "marketing"],
"granted": true,
"version": 2
}Response:
{
"consentId": "uuid",
"message": "Consent updated successfully",
"version": 2,
"timestamp": "2024-01-15T10:00:00Z"
}Stellar API uses standard HTTP status codes and provides detailed error information:
{
"error": {
"message": "Privacy budget exceeded",
"code": "PRIVACY_BUDGET_EXCEEDED",
"statusCode": 429,
"timestamp": "2024-01-15T10:00:00Z",
"details": {
"remainingBudget": 0.1,
"requestedBudget": 0.5,
"suggestion": "Wait for budget renewal or reduce privacy requirements"
}
}
}| Code | Description | HTTP Status |
|---|---|---|
UNAUTHORIZED |
Invalid or missing authentication | 401 |
FORBIDDEN |
Insufficient permissions | 403 |
NOT_FOUND |
Resource not found | 404 |
VALIDATION_ERROR |
Invalid request data | 400 |
PRIVACY_BUDGET_EXCEEDED |
Privacy budget insufficient | 429 |
ENCRYPTION_ERROR |
Data encryption/decryption failed | 500 |
CONSENT_REQUIRED |
User consent not granted | 403 |
DATA_RETENTION_EXPIRED |
Data retention period exceeded | 410 |
API endpoints are rate-limited to ensure fair usage and privacy protection:
- Standard endpoints: 100 requests per 15 minutes
- Analytics endpoints: 10 requests per 15 minutes
- Data upload: 5 requests per hour
Rate limit headers are included in responses:
X-RateLimit-Limit: 100
X-RateLimit-Remaining: 95
X-RateLimit-Reset: 1642248000All API responses include privacy-related headers:
X-Privacy-Level: high
X-Data-Encrypted: true
X-Differential-Privacy: true
X-Privacy-Budget-Used: 0.45
X-Privacy-Budget-Remaining: 0.55Stellar supports webhooks for real-time notifications:
POST /webhooksRequest Body:
{
"url": "https://your-webhook-endpoint.com/stellar",
"events": ["analysis_completed", "data_uploaded", "privacy_alert"],
"secret": "webhook_secret",
"active": true
}{
"event": "analysis_completed",
"timestamp": "2024-01-15T10:00:00Z",
"data": {
"analysisId": "uuid",
"status": "completed",
"privacyScore": 0.92,
"resultsAvailable": true
}
}{
"event": "privacy_alert",
"timestamp": "2024-01-15T10:00:00Z",
"data": {
"type": "unusual_access_pattern",
"severity": "medium",
"userId": "uuid",
"description": "Multiple data access requests detected"
}
}import { StellarClient } from '@stellar/sdk';
const client = new StellarClient({
baseURL: 'http://localhost:3001/api/v1',
token: 'your_jwt_token',
privacyLevel: 'high'
});
// Upload data
const dataset = await client.data.upload(file, {
privacyLevel: 'high',
encryptionRequired: true
});
// Run analysis
const analysis = await client.analytics.create({
name: 'Customer Analysis',
type: 'descriptive',
datasetId: dataset.id,
privacyBudget: 1.0
});from stellar_sdk import StellarClient
client = StellarClient(
base_url='http://localhost:3001/api/v1',
token='your_jwt_token',
privacy_level='high'
)
# Upload data
dataset = client.data.upload(file, privacy_level='high')
# Run analysis
analysis = client.analytics.create(
name='Customer Analysis',
type='descriptive',
dataset_id=dataset.id,
privacy_budget=1.0
)Stellar provides a test environment at https://api-test.stellar-ecosystem.com with:
- Test data and datasets
- Simulated privacy operations
- Rate limit overrides
- Debug logging
Generate test API keys in the Stellar dashboard or use:
curl -X POST https://api-test.stellar-ecosystem.com/api/v1/auth/test-key \
-H "Authorization: Bearer your_admin_token"For API support:
- Documentation: https://docs.stellar-ecosystem.com
- API Status: https://status.stellar-ecosystem.com
- Support: api-support@stellar-ecosystem.com
- GitHub Issues: https://github.com/your-org/stellar/issues
- Initial API release
- Core privacy features
- X-Ray analytics endpoints
- Data management capabilities
- Enhanced differential privacy
- Advanced visualization types
- Real-time analytics streaming
- Improved SDK support