Skip to main content
GET
/
dashboard
/
stats
Dashboard Stats
curl --request GET \
  --url https://api.example.com/dashboard/stats
{
  "total_jobs": 1523,
  "pending_jobs": 5,
  "processing_jobs": 12,
  "completed_jobs": 1450,
  "failed_jobs": 56,
  "storage_used_bytes": 53687091200,
  "storage_used_gb": 50.0,
  "client_name": "My Application"
}

Overview

Returns aggregated job statistics for the dashboard, including counts by status and storage usage.

Request

No request body required. Authentication via x-api-key header.

Response

total_jobs
integer
Total number of jobs created
pending_jobs
integer
Jobs waiting in queue
processing_jobs
integer
Jobs currently being processed
completed_jobs
integer
Successfully completed jobs
failed_jobs
integer
Jobs that encountered errors
storage_used_bytes
integer
Total storage used in bytes
storage_used_gb
number
Total storage used in gigabytes
client_name
string
Your account/client name

Example

curl -X GET "https://tornado.velys.software/dashboard/stats" \
  -H "x-api-key: sk_your_api_key"

Success Response

{
  "total_jobs": 1523,
  "pending_jobs": 5,
  "processing_jobs": 12,
  "completed_jobs": 1450,
  "failed_jobs": 56,
  "storage_used_bytes": 53687091200,
  "storage_used_gb": 50.0,
  "client_name": "My Application"
}

Error Responses

{
  "error": "Missing x-api-key header"
}

Usage

This endpoint is used by the web dashboard to populate the stats cards at the top of the page.
async function loadStats(apiKey) {
  const response = await fetch('/dashboard/stats', {
    headers: { 'x-api-key': apiKey }
  });
  const stats = await response.json();

  document.getElementById('total').textContent = stats.total_jobs;
  document.getElementById('completed').textContent = stats.completed_jobs;
  document.getElementById('failed').textContent = stats.failed_jobs;
  document.getElementById('processing').textContent =
    stats.pending_jobs + stats.processing_jobs;
  document.getElementById('storage').textContent =
    stats.storage_used_gb.toFixed(2) + ' GB';
}