Skip to main content
POST
/
api
/
analytics
/
batch
Get all analytics data in a single batched request
curl --request POST \
  --url https://api.getgranite.ai/api/analytics/batch \
  --header 'Content-Type: application/json' \
  --data '
{
  "start_date": "2023-11-07T05:31:56Z",
  "end_date": "2023-11-07T05:31:56Z",
  "granularity": "day",
  "workflow_name": "<string>",
  "triggered_by": "manual",
  "status": "pending"
}
'
{
  "summary": {
    "total_executions": 0,
    "completed": 0,
    "total_failures": 0,
    "success_rate": 0,
    "avg_duration_ms": 0,
    "active_today": 0,
    "total_tokens": 0
  },
  "executions_over_time": {
    "data": [
      {
        "time": "<string>",
        "total": 0,
        "completed": 0,
        "failed": 0,
        "running": 0,
        "pending": 0
      }
    ],
    "granularity": "<string>"
  },
  "success_rate": {
    "data": [
      {
        "time": "<string>",
        "total": 0,
        "completed": 0,
        "success_rate": 0
      }
    ],
    "granularity": "<string>"
  },
  "failure_breakdown": {
    "data": [
      {
        "category": "<string>",
        "count": 123,
        "sample_messages": [
          "<string>"
        ]
      }
    ],
    "total_failures": 0
  },
  "trigger_distribution": {
    "data": [
      {
        "trigger_type": "<string>",
        "count": 123
      }
    ]
  },
  "top_automations": {
    "data": [
      {
        "workflow_name": "<string>",
        "executions": 123,
        "completed": 123,
        "failures": 123,
        "success_rate": 123,
        "avg_duration_ms": 123,
        "last_execution": "<string>"
      }
    ],
    "sort_by": "<string>"
  },
  "duration_distribution": {
    "stats": {
      "total": 0,
      "avg_ms": 0,
      "min_ms": 0,
      "max_ms": 0,
      "p50_ms": 0,
      "p75_ms": 0,
      "p90_ms": 0,
      "p95_ms": 0,
      "p99_ms": 0
    },
    "histogram": [
      {
        "bucket_start_ms": 123,
        "bucket_end_ms": 123,
        "count": 123
      }
    ]
  },
  "recent_failures": {
    "data": [
      {
        "execution_id": "<string>",
        "run_id": "<string>",
        "workflow_name": "<string>",
        "error_category": "<string>",
        "triggered_by": "<string>",
        "started_at": "<string>",
        "error_message": "<string>",
        "duration_ms": 123
      }
    ],
    "total": 123,
    "limit": 123,
    "offset": 123
  },
  "actions_per_workflow": {
    "data": [
      {
        "workflow_name": "<string>",
        "clicks": 0,
        "keystrokes": 0,
        "scrolls": 0,
        "screenshots": 0,
        "total_steps": 0
      }
    ]
  },
  "workflow_complexity": {
    "data": [
      {
        "workflow_name": "<string>",
        "complexity_score": 123,
        "total_steps": 123,
        "total_iterations": 123,
        "parameters_count": 123,
        "success_rate": 123,
        "avg_duration_ms": 123
      }
    ]
  },
  "endpoint_usage": {
    "data": [
      {
        "endpoint_slug": "<string>",
        "http_method": "<string>",
        "invocations": 123,
        "success_count": 123,
        "success_rate": 123,
        "avg_response_time_ms": 123,
        "p95_response_time_ms": 123
      }
    ]
  },
  "workflows": [
    "<string>"
  ]
}

Body

application/json

Common filters for analytics queries.

start_date
string<date-time> | null
end_date
string<date-time> | null
granularity
enum<string>
default:day
Available options:
hour,
day,
week,
month
workflow_name
string | null
triggered_by
enum<string> | null
Available options:
manual,
endpoint,
scheduled
status
enum<string> | null
Available options:
pending,
running,
completed,
failed,
cancelled

Response

Successful Response

summary
SummaryStats · object
required

Dashboard summary statistics.

executions_over_time
ExecutionsOverTimeResponse · object
required

Response for executions over time.

success_rate
SuccessRateResponse · object
required

Response for success rate over time.

failure_breakdown
FailureBreakdownResponse · object
required

Response for failure breakdown.

trigger_distribution
TriggerDistributionResponse · object
required

Response for trigger distribution.

top_automations
TopAutomationsResponse · object
required

Response for top automations.

duration_distribution
DurationDistributionResponse · object
required

Response for duration distribution.

recent_failures
RecentFailuresResponse · object
required

Response for recent failures.

actions_per_workflow
ActionsPerWorkflowResponse · object
required

Response for actions per workflow.

workflow_complexity
WorkflowComplexityResponse · object
required

Response for workflow complexity.

endpoint_usage
EndpointUsageResponse · object
required

Response for endpoint usage.

workflows
string[]
required