You signed in with another tab or window.Reload to refresh your session.You signed out in another tab or window.Reload to refresh your session.You switched accounts on another tab or window.Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: _docs/kb/articles/retrieve-usage-data-api.md
+22-1Lines changed: 22 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -17,6 +17,9 @@ This guide shows how to programmatically access usage-related analytics through
17
17
18
18
>**Goal:** Pull usage metrics (e.g., credit consumption, pipeline credit consumption, active committers) for monitoring or reporting.
19
19
20
+
**Disclaimer:**
21
+
This API is used for data visualization in the user interface. It does not provide raw analytical data, but rather pre-aggregated data in the form of OLAP cubes intended for rendering graphical charts in the interface. There are currently no plans to standardize or version this API, so the data structure may change at any time without backward compatibility or public notice.
22
+
20
23
##Prerequisites
21
24
22
25
- A Codefresh**API key** with permission to access Analytics.
# Adapt the endpoint for pipelineCreditConsumption or activeCommiters as needed.
98
101
```
99
102
103
+
##Error handling
104
+
105
+
The API can return errors. Known error types and typical messages:
106
+
107
+
- BadRequestError (400)
108
+
- "Invalid report name" — check the report name for typos.
109
+
- "Passed structure is invalid -[Time dimensions are not supported for target report: {reportName}]" — invalid combination of date range and granularity. Different reports support different parameter combinations (for example, creditConsumption with daily granularity supports a maximum range of 45 days).
110
+
- "Filter by account id is not allowed by user params" — invalid filter parameter.
111
+
112
+
- AuthError (403)
113
+
- "Permission denied" — the API key/user is not authorized to access the requested report.
114
+
115
+
- ReportExecutionError (432)
116
+
- "analytics report not finished yet" — the report is still being generated. Retry the same request later (common when requesting large periods with no pre-aggregated cache).
117
+
118
+
- InternalServerError (500)
119
+
- "Could not get analytics report" — no data available for the requested combination of parameters (period/granularity/filters).
120
+
100
121
##Best practices
101
122
102
123
- Use the**metadata** endpoint to confirm available reports and supported query parameters.