API Endpoints¶
Complete reference for all Helomatic API endpoints with request/response examples.
System Endpoints¶
Health Check¶
Check the API service health and availability.
System Status¶
Get detailed system status including component health.
{
"status": "operational",
"environment": "production",
"timestamp": "2025-08-22T18:19:58.088Z",
"version": "1.0.0",
"components": {
"database": {
"status": "operational",
"latency": 596,
"last_check": "2025-08-22T18:19:58.088Z"
},
"kv_storage": {
"status": "operational",
"latency": 55,
"last_check": "2025-08-22T18:19:58.088Z"
},
"rate_limiter": {
"status": "operational",
"last_check": "2025-08-22T18:19:58.088Z"
}
},
"security": {
"headers_enabled": true,
"cors_configured": true,
"rate_limiting": "active",
"ssl_enforced": true
}
}
Metrics¶
Retrieve Prometheus-style metrics for monitoring.
# HELP http_requests_total Total HTTP requests processed
# TYPE http_requests_total counter
http_requests_total{method="GET",status="200"} 1547
http_requests_total{method="POST",status="200"} 892
http_requests_total{method="POST",status="400"} 23
# HELP http_request_duration_seconds HTTP request latency
# TYPE http_request_duration_seconds histogram
http_request_duration_seconds_bucket{le="0.1"} 1205
http_request_duration_seconds_bucket{le="0.5"} 1456
http_request_duration_seconds_bucket{le="1.0"} 1502
Authentication Endpoints¶
User Registration¶
Register a new user account.
{
"success": true,
"data": {
"user": {
"id": "usr_1234567890",
"email": "user@example.com",
"name": "John Doe",
"company": "Example Corp",
"role": "user",
"verified": false,
"created_at": "2025-08-22T18:30:15.123Z"
},
"tokens": {
"access_token": "eyJhbGciOiJIUzI1NiIs...",
"refresh_token": "eyJhbGciOiJIUzI1NiIs...",
"expires_in": 3600,
"token_type": "Bearer"
}
},
"message": "Registration successful. Please verify your email."
}
User Login¶
Authenticate a user and receive access tokens.
{
"success": true,
"data": {
"user": {
"id": "usr_1234567890",
"email": "user@example.com",
"name": "John Doe",
"role": "user",
"last_login": "2025-08-22T18:35:20.456Z"
},
"tokens": {
"access_token": "eyJhbGciOiJIUzI1NiIs...",
"refresh_token": "eyJhbGciOiJIUzI1NiIs...",
"expires_in": 3600,
"token_type": "Bearer"
},
"session": {
"session_id": "sess_abcdef123456",
"expires_at": "2025-08-22T19:35:20.456Z"
}
},
"message": "Login successful"
}
Token Refresh¶
Refresh an expired access token using a refresh token.
Monitoring Endpoints¶
List Monitoring Sources¶
Get all monitoring sources for the authenticated user.
{
"success": true,
"data": {
"sources": [
{
"id": "mon_1234567890",
"name": "E-commerce Price Monitor",
"url": "https://example-store.com/products/widget",
"schedule": "hourly",
"status": "active",
"last_check": "2025-08-22T18:00:00.000Z",
"next_check": "2025-08-22T19:00:00.000Z",
"extractors": [
{
"type": "css",
"selector": ".price",
"name": "product_price",
"last_value": "$29.99"
}
],
"created_at": "2025-08-20T10:30:00.000Z"
}
],
"pagination": {
"page": 1,
"limit": 20,
"total": 1,
"has_more": false
}
}
}
Create Monitoring Source¶
Create a new monitoring source.
{
"name": "Competitor Price Tracker",
"url": "https://competitor.com/product/123",
"schedule": "daily",
"extractors": [
{
"type": "css",
"selector": ".price-current",
"name": "current_price",
"attribute": "data-price"
},
{
"type": "xpath",
"selector": "//span[@class='stock-status']/text()",
"name": "stock_status"
}
],
"webhookUrl": "https://your-app.com/webhook/price-changed",
"webhookEvents": ["data_changed", "error"],
"retryAttempts": 3,
"timeout": 30000,
"tags": ["ecommerce", "pricing", "competitor"]
}
{
"success": true,
"data": {
"source": {
"id": "mon_0987654321",
"name": "Competitor Price Tracker",
"url": "https://competitor.com/product/123",
"schedule": "daily",
"status": "active",
"extractors": [
{
"type": "css",
"selector": ".price-current",
"name": "current_price",
"attribute": "data-price"
}
],
"webhook_url": "https://your-app.com/webhook/price-changed",
"webhook_events": ["data_changed", "error"],
"created_at": "2025-08-22T18:40:00.000Z",
"next_check": "2025-08-23T18:40:00.000Z"
}
},
"message": "Monitoring source created successfully"
}
curl -X POST \
https://helomatic-api-prod.ernijs-ansons.workers.dev/api/monitoring/sources \
-H "Content-Type: application/json" \
-H "Authorization: Bearer <access_token>" \
-d '{
"name": "Competitor Price Tracker",
"url": "https://competitor.com/product/123",
"schedule": "daily",
"extractors": [
{
"type": "css",
"selector": ".price-current",
"name": "current_price"
}
]
}'
AI Integration Endpoints¶
Chat Completion¶
Send a message to AI and receive a response.
{
"messages": [
{
"role": "system",
"content": "You are a helpful business automation assistant."
},
{
"role": "user",
"content": "Help me create a workflow to automate customer onboarding."
}
],
"task": "automation",
"options": {
"temperature": 0.7,
"max_tokens": 1000,
"model": "gpt-4",
"stream": false
}
}
{
"success": true,
"data": {
"response": {
"role": "assistant",
"content": "I'll help you create an automated customer onboarding workflow. Here's a comprehensive approach:\n\n1. **Welcome Email Sequence**\n - Immediate welcome email with getting started guide\n - Day 2: Product overview and key features\n - Day 7: Success stories and best practices\n\n2. **Account Setup Automation**\n - Automatic profile creation\n - Default settings configuration\n - Integration setup prompts\n\n3. **Progress Tracking**\n - Onboarding completion milestones\n - Automated check-ins at 30, 60, 90 days\n - Usage analytics and recommendations\n\nWould you like me to detail any specific part of this workflow?"
},
"usage": {
"tokens_used": 247,
"model": "gpt-4",
"cost": 0.00741
},
"conversation_id": "conv_abc123def456"
}
}
Data Management Endpoints¶
Data Enrichment¶
Enrich data using AI-powered processing.
{
"success": true,
"data": {
"enriched_data": {
"company": "TechCorp Inc",
"email": "contact@techcorp.com",
"website": "techcorp.com",
"industry": "Software Development",
"employee_count": "50-200",
"founded": "2015",
"headquarters": "San Francisco, CA",
"revenue_range": "$10M-$50M",
"key_contacts": [
{
"name": "John Smith",
"role": "CEO",
"email": "john@techcorp.com"
},
{
"name": "Sarah Johnson",
"role": "CTO",
"email": "sarah@techcorp.com"
}
]
},
"confidence_scores": {
"industry": 0.95,
"employee_count": 0.82,
"revenue_range": 0.67,
"key_contacts": 0.89
},
"processing_time": 2.3,
"sources_used": ["linkedin", "crunchbase", "company_website"]
}
}
Error Handling Examples¶
Validation Error (400)¶
Rate Limit Error (429)¶
Authentication Error (401)¶
For implementation details, see Authentication or explore our OpenAPI Specification.