API Reference

Complete reference for the Vaimanasoft Analytics Platform API v4. Base URL: https://vaimanasoft.com/api/v4

Overview

The Vaimanasoft API is organized into four endpoint groups:

GroupAuth MethodPurpose
SDKX-SDK-Key headerDevice registration, event tracking from mobile apps
AuthNone / JWTUser login, registration, token refresh
DashboardJWT BearerAnalytics queries, device management
AI / Billing / NotificationsJWT BearerAI insights, Stripe billing, push notifications

All requests and responses use Content-Type: application/json.

Authentication

SDK Authentication

Mobile SDK endpoints authenticate via the X-SDK-Key header. Each app has a unique SDK key found in your dashboard settings.

GET /api/v4/devices/register
X-SDK-Key: your-app-sdk-key-here

JWT Authentication

Dashboard and management endpoints require a JWT Bearer token obtained from the /auth/login endpoint.

GET /api/v4/dashboard/overview?app_id=1
Authorization: Bearer eyJhbGciOiJIUzI1NiI...

Tokens expire after 24 hours. Use /auth/refresh to get a new token before expiry.

Error Handling

Errors return appropriate HTTP status codes with a JSON body:

{
  "error": "Human-readable error message"
}
StatusMeaning
400Bad request — missing or invalid parameters
401Unauthorized — invalid or expired token
403Forbidden — insufficient permissions
404Not found — endpoint or resource doesn't exist
429Rate limited — too many requests
500Internal error — report if persistent

Rate Limits

Rate limits are applied per client (SDK key, user ID, or IP address):

TierLimitWindowApplies To
SDK200 requests1 minuteDevice registration, events, flags
API100 requests1 minuteDashboard endpoints
Auth10 requests5 minutesLogin, register
Export5 requests1 hourCSV data exports

Rate limit headers included in every response:

X-RateLimit-Limit: 100
X-RateLimit-Remaining: 87
X-RateLimit-Reset: 1711027260

When rate limited, the server returns HTTP 429 with a Retry-After header.

Register Device

POST /devices/register SDK Key

Register or update a device. Returns the device record with assigned segment.

Request Body

FieldTypeRequiredDescription
android_idstringYesUnique Android device ID
brandstringNoDevice manufacturer
modelstringNoDevice model name
android_versionstringNoOS version
app_versionstringNoApp version code
fcm_tokenstringNoFirebase Cloud Messaging token
countrystringNoISO 3166-1 alpha-2 country code
install_typestringNoorganic or store

Response (200)

{
  "success": true,
  "device": {
    "id": 42,
    "android_id": "abc123",
    "user_segment": "active",
    "created_at": "2026-03-01 12:00:00"
  }
}

Update FCM Token

POST /devices/update-token SDK Key

Update a device's FCM push notification token.

FieldTypeRequired
android_idstringYes
fcm_tokenstringYes

Batch Events

POST /events/batch SDK Key

Submit a batch of events (up to 50 per request). Events are processed transactionally.

{
  "events": [
    {
      "android_id": "abc123",
      "event_type": "ad_watched",
      "event_data": {"ad_network": "admob", "reward": 10},
      "created_at": "2026-03-20 14:30:00"
    },
    {
      "android_id": "abc123",
      "event_type": "page_view",
      "event_data": {"page": "settings"}
    }
  ]
}
Supported event types: session_start, session_end, page_view, ad_watched, purchase, feature_used, usage_time, app_update, country_change, error, custom, share, rating, notification_clicked, search, login, signup, achievement, level_up

SDK Auto-Register

POST /sdk/auto-register

Auto-register app + device on first launch. Uses X-API-Key (org key) instead of X-SDK-Key. Returns sdk_key for all future SDK calls. If app already exists, returns existing key.

Auth: X-API-Key: {org_api_key}

FieldTypeRequiredDescription
package_namestringYesAndroid package name
app_namestringNoApp label from AndroidManifest
android_idstringYesSettings.Secure.ANDROID_ID
brandstringNoBuild.BRAND
android_verstringNo"Android API 34"
app_verstringNo"v 24.2.8H"
fcm_tokenstringNoFirebase push token

Response:

{
  "success": true,
  "sdk_key": "sk_b8695b97f896766c",
  "app_id": 9,
  "device_id": 5010881,
  "app_action": "existing",
  "device_action": "registered"
}

SDK Profile + Segment

GET /sdk/profile?android_id={id}

Full user profile with segment, ad strategy (33 fields), country, ad watches, purchase history. Replaces v3 UserSegmentationRepo.

Auth: X-SDK-Key

{
  "success": true,
  "profile": {
    "device_id": 203,
    "segment": "ACTIVE_USER",
    "country": "IN",
    "total_ad_watches": 47,
    "days_since_first_install": 102,
    "ad_strategy": {
      "ads_enabled": true,
      "interstitial_enabled": true,
      "ad_cooldown_sec": 90,
      "interstitial_cap": 3,
      "interstitial_daily_cap": 8,
      "rewarded_cap": 15,
      "app_open_cooldown_sec": 2400,
      "app_open_daily_cap": 3,
      "pre_show_delay_ms": 1500,
      "config_version": 2
    }
  }
}

SDK Update Profile

POST /sdk/update-profile

Update user action and recalculate segment. Actions: ad_watched, purchase_made, update_country, app_update, session_start.

Auth: X-SDK-Key

// Request
{ "android_id": "9fd960b07a8c4327", "action": "ad_watched" }

// Response
{ "segment": "POWER_USER", "ad_strategy": { ... } }

SDK Revenue Tracking

POST /sdk/revenue

Track ad revenue events with network, type, geo tier, and estimated revenue.

Auth: X-SDK-Key

{
  "android_id": "9fd960b07a8c4327",
  "ad_type": "rewarded",
  "ad_network": "admob",
  "revenue": 0.0035,
  "ecpm": 3.50,
  "geo_tier": "tier3",
  "country": "IN"
}

Play Store: List Tracked Apps

GET/playstore/apps

List all tracked Play Store apps for the organization. Auth: JWT.

Play Store: Scrape App

POST/playstore/scrape

Scrape app metadata from Google Play Store. Body: { "package_name": "com.example.app" }. Auth: JWT.

Play Store: Compare Apps

POST/playstore/compare

Compare multiple apps side by side. Body: { "packages": ["com.app1", "com.app2"] }. Auth: JWT.

Cross-Promo: Campaigns

GET/crosspromo/campaigns

List cross-promotion campaigns. CRUD: GET (list), POST (create), PUT /:id (update), DELETE /:id. Auth: JWT.

Cross-Promo: Stats

GET/crosspromo/stats

Campaign performance: impressions, clicks, installs, CTR. Auth: JWT.

Cross-Promo: AI Suggestions

GET/crosspromo/ai-suggest

AI-powered campaign recommendations based on app performance and user segments. Auth: JWT.

Automation: Rules

GET/automation/rules

CRUD for automation rules. Triggers: rating_drop, download_spike, negative_review_spike, new_version_detected, competitor_update. Actions: telegram, webhook, email. Auth: JWT.

Automation: Log

GET/automation/log

Automation execution history. Auth: JWT.

Automation: Agent Bridge

GET/automation/bridge

Inter-agent message queue. Used by OpenClaw (.209) and Claude Channels (.211) to communicate with the platform. Auth: JWT.

AI Assistant: Chat

POST/assistant/chat

Multi-turn AI chat powered by Claude. Supports conversation history. Body: { "message": "How are my apps doing?", "conversation_id": 1 }. Auth: JWT.

AI Assistant: Cross-Analysis

POST/assistant/cross-analysis

Correlate Play Store metrics with internal analytics data. Auth: JWT.

AI Assistant: ASO Suggestions

POST/assistant/aso

App Store Optimization recommendations based on competitor analysis. Auth: JWT.

AI Assistant: Reports

POST/assistant/report

Generate AI reports. Types: daily_summary, weekly, competitor, revenue, review. Auth: JWT.

AI Assistant: Sentiment Analysis

POST/assistant/sentiment

Analyze review sentiment using Claude Haiku. Auth: JWT.

CodeAgent: Status

GET/codeagent/status

CodeClaw agent status: open issues, fixed issues, job history. Auth: JWT.

CodeAgent: Lint

POST/codeagent/lint

Run PHP lint on all project files. Returns error count and details. Auth: JWT.

CodeAgent: Security Scan

POST/codeagent/security

Run security scan: SQL injection, XSS, hardcoded credentials, insecure headers. Auth: JWT.

DevOps: System Status

GET/devops/status

Full system status: git branch, DB latency, table counts, agent status, API stats, disk/memory usage. Auth: JWT or X-Admin-Token.

DevOps: Deploy

POST/devops/deploy

Trigger deployment to dev or production. Auth: X-Admin-Token.

Blog: List Posts

GET/blog/posts

List published blog posts with title, slug, excerpt, date. Auth: JWT.

Blog: AI Generate

POST/blog/generate

AI-generate a blog article draft. Body: { "topic": "...", "keywords": [...] }. Auth: JWT.

Webhooks: List

GET/webhooks

List all webhooks. Returns name, URL, subscribed events, active status. Auth: JWT.

Webhooks: Create

POST/webhooks

Create webhook. Body: { "url": "https://...", "events": ["device.registered", "event.batch"], "name": "My Hook" }. Returns webhook secret for HMAC verification. Auth: JWT.

Webhooks: Test

POST/webhooks/{id}/test

Send test payload to webhook URL. Returns status code and response time. Auth: JWT.

Settings: Theme

GET/settings/theme

Get/update theme settings (primary color, mode, sidebar style). GET to read, PUT to update. Auth: JWT.

Settings: Activity Log

GET/activity

Activity log with user actions, timestamps, IP addresses. Filterable by action type. Auth: JWT.

Register Account

POST /auth/register

Create a new organization and owner user account. Returns a JWT token.

FieldTypeRequired
namestringYes
emailstringYes
passwordstringYes (min 8 chars)
org_namestringYes
// Response
{
  "token": "eyJhbGciOiJIUzI1NiI...",
  "user": { "id": 5, "org_id": 3, "role": "owner" }
}

Login

POST /auth/login

Authenticate with email and password. Returns a JWT token valid for 24 hours.

// Request
{ "email": "user@example.com", "password": "your-password" }

// Response
{
  "token": "eyJhbGciOiJIUzI1NiI...",
  "user": { "id": 1, "org_id": 1, "role": "owner" }
}

Refresh Token

POST /auth/refresh JWT

Exchange a valid (non-expired) JWT for a fresh token.

List Apps

GET /dashboard/apps JWT

List all apps belonging to the authenticated user's organization.

{
  "apps": [
    { "id": 1, "name": "My App", "package_name": "com.example.myapp", "sdk_key": "sk_..." }
  ]
}

Dashboard Overview

GET /dashboard/overview?app_id={id} JWT

Key metrics for an app: total devices, active users (30d), new users (7d), events today, ad watches, purchases.

User Segments

GET /dashboard/segments?app_id={id} JWT

Returns device counts grouped by user segment (e.g., power_user, active, casual, dormant, churned).

List Devices

GET /dashboard/devices?app_id={id} JWT

Paginated device list with filtering.

ParamTypeDefaultDescription
pageint1Page number
limitint50Results per page (max 100)
searchstringSearch by android_id, brand, model
segmentstringFilter by user_segment
countrystringFilter by country code
GET /dashboard/trends?app_id={id}&days={30} JWT

Daily time-series data for the specified period. Returns active_devices, new_devices, total_events per day.

Countries

GET /dashboard/countries?app_id={id} JWT

Device counts grouped by country code, sorted descending.

Natural Language Query

POST /ai/query JWT

Ask questions in plain English. Claude AI translates your question to SQL, executes it safely, and returns results with a narrative explanation.

// Request
{ "query": "How many users from India watched more than 50 ads this month?" }

// Response
{
  "answer": "There are 142 users from India who watched more than 50 ads...",
  "sql": "SELECT COUNT(*) FROM devices WHERE ...",
  "data": [{"count": 142}]
}
Only read-only (SELECT) queries are executed. The system validates all AI-generated SQL for safety.

Get AI Insights

GET /ai/insights?app_id={id} JWT

Returns cached AI-generated insights (daily summaries, anomaly alerts, weekly reports).

Churn Risk Analysis

GET /ai/churn?app_id={id} JWT

Identifies devices at risk of churning with AI-generated risk scores and recommended actions.

Subscription Status

GET /billing/status JWT

Returns the current subscription plan, status, and period end date for the authenticated organization.

{
  "plan": "pro",
  "status": "active",
  "current_period_end": "2026-04-20T00:00:00Z",
  "limits": { "apps": 10, "devices": 100000, "events_per_month": 10000000 }
}

Create Checkout Session

POST /billing/checkout JWT

Creates a Stripe Checkout session for upgrading to a paid plan.

// Request
{ "plan": "pro" }  // "starter", "pro", or "enterprise"

// Response
{ "checkout_url": "https://checkout.stripe.com/c/pay/cs_..." }

Customer Portal

POST /billing/portal JWT

Creates a Stripe Customer Portal session for managing payment methods, invoices, and subscription changes.

{ "portal_url": "https://billing.stripe.com/p/session/..." }

Cancel Subscription

POST /billing/cancel JWT

Cancels the current subscription at the end of the billing period. Access continues until period end.

Send Push Notification

POST /notifications/send JWT

Send a push notification to a device, segment, or all users.

// Send to segment
{
  "app_id": 1,
  "target": "segment",
  "segment": "dormant",
  "title": "We miss you!",
  "body": "Come back and check out new features.",
  "data": {"screen": "home"}
}

// Send to single device
{ "app_id": 1, "target": "device", "device_id": 42, "title": "...", "body": "..." }

// Broadcast to all
{ "app_id": 1, "target": "all", "title": "...", "body": "..." }

Notification History

GET /notifications/history?app_id={id} JWT

Returns the last 50 notifications sent or scheduled for the app, newest first.

{
  "notifications": [
    {
      "id": 12,
      "title": "Flash Sale!",
      "body": "50% off premium today only.",
      "target": "all",
      "segment": null,
      "sent": 3219,
      "failed": 12,
      "status": "delivered",
      "sent_at": "2026-03-21 10:30:00",
      "created_at": "2026-03-21 10:30:00"
    }
  ]
}

List Experiments

GET /experiments?app_id={id} JWT

Returns all A/B experiments for the app with variant assignments count.

Create Experiment

POST /experiments JWT

Create a new A/B test experiment.

{
  "app_id": 1,
  "name": "CTA Button Color",
  "description": "Test green vs orange CTA buttons",
  "variants": [
    {"key": "control", "name": "Green", "weight": 50},
    {"key": "variant_a", "name": "Orange", "weight": 50}
  ],
  "target_metric": "purchase"
}

Update Experiment Status

PUT /experiments/{id}/status JWT

Change experiment status: draftrunningpaused / completed.

{ "app_id": 1, "status": "running" }

List Feature Flags

GET /flags?app_id={id} JWT

Returns all feature flags for the app with their current status and rollout percentage.

Create Feature Flag

POST /flags JWT

Create a new feature flag. Supports boolean and multivariate types.

// Boolean flag
{
  "app_id": 1,
  "flag_key": "new_onboarding",
  "name": "New Onboarding Flow",
  "flag_type": "boolean",
  "is_enabled": true,
  "rollout_pct": 25
}

// Multivariate flag
{
  "app_id": 1,
  "flag_key": "cta_color",
  "name": "CTA Button Color",
  "flag_type": "multivariate",
  "is_enabled": true,
  "rollout_pct": 100,
  "variants": [
    {"key": "green", "value": "#22C55E", "weight": 50},
    {"key": "orange", "value": "#F59E0B", "weight": 50}
  ]
}

Update Feature Flag

PUT /flags/{id} JWT

Update a flag's enabled state, rollout percentage, or variants. All fields are optional.

{ "app_id": 1, "is_enabled": true, "rollout_pct": 50 }

SDK Feature Flags Endpoint

GET /sdk/flags?android_id={device_id} SDK Key

Returns evaluated feature flags for a specific device. Uses CRC32-based deterministic assignment so the same device always gets the same variant.

{
  "flags": {
    "new_onboarding": { "enabled": true, "type": "boolean" },
    "cta_color": {
      "enabled": true,
      "type": "multivariate",
      "variant": "green",
      "value": "#22C55E"
    }
  }
}
Response is cached for 60 seconds via Cache-Control header. The Android SDK caches flags locally with a 60s TTL.

Export Devices (CSV)

GET /export/devices?app_id={id} JWT

Streams all devices as a CSV file. Rate limited to 5 requests per hour.

Large apps may have thousands of rows. The response streams incrementally for memory efficiency.

Export Events (CSV)

GET /export/events?app_id={id} JWT

Streams the last 30 days of events as a CSV file. Rate limited to 5 requests per hour.

Android SDK Setup (Kotlin)

Add the Vaimanasoft SDK to your Android project. Available in both Kotlin and Java.

1. Add the SDK file

Copy Vaimanasoft.kt (or Vaimanasoft.java) into your project's source directory. No Gradle dependencies required.

2. Initialize in Application class

// Kotlin
class MyApp : Application() {
    override fun onCreate() {
        super.onCreate()
        Vaimanasoft.init(this, "sk_your_sdk_key")
    }
}

3. Add required permissions

<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />

Tracking Events

// Generic event with properties
Vaimanasoft.track("button_clicked", bundleOf("button" to "subscribe"))

// Convenience methods
Vaimanasoft.trackPurchase("premium_monthly", amount = 9.99)
Vaimanasoft.trackAdWatched()
Vaimanasoft.trackFeatureUsed("dark_mode")
Vaimanasoft.trackPageView("settings")

// Session lifecycle
Vaimanasoft.trackSessionStart()
Vaimanasoft.trackSessionEnd()

// Manually flush pending events
Vaimanasoft.flush()

// Graceful shutdown
Vaimanasoft.shutdown()
Events are automatically batched and sent every 30 seconds, up to 50 per batch. Max queue size is 500 events. The SDK handles network failures with exponential backoff retry (3 attempts).

Feature Flags in SDK

Feature flags are fetched on init and cached locally for 60 seconds.

// Boolean flag check
if (Vaimanasoft.isEnabled("new_onboarding")) {
    showNewOnboarding()
}

// Multivariate flag
val ctaColor = Vaimanasoft.getVariant("cta_color")  // "green", "orange", etc.
val headline = Vaimanasoft.getValue("promo_headline", defaultValue = "Welcome!")

// Force refresh from server
Vaimanasoft.refreshFlags()
Flag assignment is deterministic using CRC32(android_id + flag_key). The same device always gets the same variant, even across reinstalls.

Push Notifications (FCM)

Pass FCM tokens to Vaimanasoft to enable server-side push notifications.

class MyFirebaseService : FirebaseMessagingService() {
    override fun onNewToken(token: String) {
        super.onNewToken(token)
        Vaimanasoft.updateFcmToken(token)
    }
}

// Also fetch token on app start
FirebaseMessaging.getInstance().token.addOnSuccessListener { token ->
    Vaimanasoft.updateFcmToken(token)
}

Webhooks

Webhooks deliver real-time HTTP callbacks when events occur in your app. Configure endpoints to receive event data as JSON payloads signed with HMAC-SHA256.

GET/api/v4/webhooks?app_id={id}JWT

List all webhooks for an app. Returns name, URL, subscribed events, active status, and failure count.

POST/api/v4/webhooksJWT

Create a new webhook (max 10 per app). Returns a signing secret — store it securely.

{
  "app_id": 1,
  "name": "Analytics Hook",
  "url": "https://example.com/webhook",
  "events": ["session_start", "purchase", "*"]
}

Supported events: session_start, session_end, purchase, ad_watched, page_view, feature_used, notification_clicked, * (all).

PUT/api/v4/webhooks/{id}JWT

Update webhook name, URL, events, or active status. Send only fields to update.

DELETE/api/v4/webhooks/{id}JWT

Permanently delete a webhook and all its delivery history.

POST/api/v4/webhooks/{id}/testJWT

Send a test payload to verify your endpoint. Returns the HTTP response code and body.

GET/api/v4/webhooks/{id}/deliveriesJWT

Get the last 25 delivery attempts for a webhook. Includes response code, duration, and status.

Signature Verification

All webhook deliveries include an X-Vaimanasoft-Signature header. Verify it with HMAC-SHA256:

// Node.js
const crypto = require('crypto');
const expected = 'sha256=' + crypto.createHmac('sha256', webhookSecret)
  .update(rawBody).digest('hex');
const valid = crypto.timingSafeEqual(
  Buffer.from(signature), Buffer.from(expected)
);
Webhooks are auto-disabled after 10 consecutive delivery failures. Re-enable via the update endpoint.

Custom Segments

Define rule-based segments to group users by behavior, device attributes, or engagement metrics. Segments are recalculated nightly or on demand.

GET/api/v4/segments?app_id={id}JWT

List all custom segments for an app, including rules, cached device count, and last calculation time.

POST/api/v4/segmentsJWT

Create a custom segment with rules (max 20 per app).

{
  "app_id": 1,
  "name": "Power Users India",
  "description": "High-engagement users from India",
  "logic": "AND",
  "color": "#22c55e",
  "rules": [
    { "field": "country", "operator": "eq", "value": "IN" },
    { "field": "session_count_30d", "operator": "gte", "value": "50" }
  ]
}
Rule FieldTypeDescription
days_since_installnumberDays since first install
days_inactivenumberDays since last activity
event_count_30dnumberTotal events in last 30 days
session_count_30dnumberSessions in last 30 days
ad_watches_30dnumberAd views in last 30 days
purchase_countnumberAll-time purchases
countrytextISO country code
app_versiontextApp version string
brandtextDevice manufacturer
install_typetextInstall source

Operators: eq, neq, gt, gte, lt, lte, contains

PUT/api/v4/segments/{id}JWT

Update segment name, rules, logic, color, or active status.

POST/api/v4/segments/{id}/recalculateJWT

Recalculate segment membership on demand. Returns the updated device count.

// Response
{ "device_count": 1204, "segment_id": 5 }

Alerts

Configure metric-based alerts that notify you via email, webhook, or dashboard when conditions are met.

GET/api/v4/alerts?app_id={id}JWT

List all alert rules and recent alert history for an app.

POST/api/v4/alertsJWT
{
  "app_id": 1,
  "name": "DAU Drop Alert",
  "metric": "dau",
  "condition": "drops_by",
  "threshold": 20,
  "compare_window": "week",
  "channel": "email"
}

Metrics: dau, new_users, events, ad_watches, purchases, crash_rate, churn_rate

Conditions: drops_by, increases_by, below, above

Channels: email, webhook, dashboard

DELETE/api/v4/alerts/{id}JWT

Delete an alert rule.

Funnels

POST/api/v4/funnels/analyzeJWT

Analyze conversion funnel for a sequence of events. Pass ordered event types to calculate drop-off at each step.

{
  "app_id": 1,
  "steps": ["session_start", "page_view", "ad_watched", "purchase"],
  "from": "2026-03-01",
  "to": "2026-03-21"
}

Retention Cohorts

GET/api/v4/retention?app_id={id}JWT

Get cohort retention data. Returns weekly cohorts with day-1, day-7, day-14, day-30 retention rates.

User Path Analysis

POST/api/v4/paths/analyzeJWT

Analyze most common user event sequences. Returns top N paths with their frequency and conversion data.

{ "app_id": 1, "start_event": "session_start", "depth": 5, "limit": 20 }

Custom Dashboards

GET/api/v4/dashboards?app_id={id}JWT

List all custom dashboards for an app. Each dashboard contains an array of widget configurations.

POST/api/v4/dashboardsJWT
{
  "app_id": 1,
  "name": "Growth Overview",
  "widgets": [
    { "type": "kpi", "metric": "active_devices", "label": "DAU" },
    { "type": "line_chart", "metric": "new_devices", "label": "New Users" }
  ]
}

Widget types: kpi, line_chart, bar_chart, pie_chart

PUT/api/v4/dashboards/{id}JWT

Update dashboard name or widgets array.

Team Management

GET/api/v4/team/membersJWT

List all team members in the organization with their role (owner, admin, viewer).

POST/api/v4/team/inviteJWT
{ "email": "newmember@example.com", "role": "admin" }

Roles: owner (full access), admin (manage apps, view billing), viewer (read-only).

PUT/api/v4/team/members/{id}JWT

Update a team member's role. Requires admin or owner access.

DELETE/api/v4/team/members/{id}JWT

Remove a team member from the organization. Cannot remove the owner.

System Health

GET/api/v4/health

Health check endpoint (no auth required). Returns status of all services.

// Response
{
  "status": "ok",
  "database": { "status": "ok", "latency_ms": 2 },
  "redis": { "status": "ok" },
  "storage": { "writable": true, "free_gb": 45.2 },
  "queue": { "status": "ok", "pending_jobs": 3 },
  "php_version": "8.2.15",
  "uptime_seconds": 86400,
  "version": "4.0.0"
}
GET/api/v4/queue/statsJWT (admin)

Queue statistics — job counts by status and queue name. Includes recent failures. Requires admin role.

Real-Time Event Stream (SSE)

GET/api/v4/stream?app_id={id}&token={jwt}

Server-Sent Events stream for real-time event monitoring. Pass JWT as query parameter. Uses Redis pub/sub when available, falls back to database polling.

// JavaScript
const es = new EventSource(`/api/v4/stream?app_id=1&token=${jwt}`);
es.onmessage = (e) => {
  const events = JSON.parse(e.data);
  console.log('New events:', events);
};
Connection timeout is 5 minutes. Reconnect automatically using EventSource. Heartbeats are sent every 15 seconds.

Rate Limits by Plan

Rate limits are enforced per API key or JWT. Limits scale with your subscription plan.

Endpoint TierFreeStarterProEnterprise
SDK (ingestion)200/min500/min2,000/min10,000/min
Dashboard API100/min300/min1,000/min5,000/min
Auth10 per 5 minutes (all plans)
Data Export5/hr20/hr60/hr200/hr

Rate limit headers are included in every response: X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset.

Vaimanasoft Analytics Platform v4.0 — vaimanasoft.com