List pull request analytics
curl --request GET \
--url https://www.cubic.dev/api/analytics/v1/prs \
--header 'Authorization: Bearer <token>'const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://www.cubic.dev/api/analytics/v1/prs', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://www.cubic.dev/api/analytics/v1/prs"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text){
"data": [
{
"org": "acme",
"repo": "backend",
"prNumber": 4645,
"author": "john-doe",
"createdAt": "2026-04-16T12:00:00.000Z",
"mergedAt": "2026-04-17T12:00:00.000Z",
"linesAdded": 543,
"linesDeleted": 12,
"numberOfCubicIssuesFlagged": 5,
"numberOfCubicIssuesFixed": 4,
"cubicFirstReviewedAt": "2026-04-17T00:00:00.000Z",
"totalAiLinesAuthored": 523
}
],
"nextCursor": "2026-04-16T12:00:00.000Z|102"
}{
"error": "<string>",
"details": "<unknown>"
}{
"error": "<string>",
"details": "<unknown>"
}{
"error": "<string>",
"details": "<unknown>"
}{
"error": "<string>",
"details": "<unknown>"
}{
"error": "<string>",
"details": "<unknown>"
}{
"error": "<string>",
"details": "<unknown>"
}{
"error": "<string>",
"details": "<unknown>"
}Analytics
List pull request analytics
Export metrics for merged pull requests reviewed by cubic.
GET
/
api
/
analytics
/
v1
/
prs
List pull request analytics
curl --request GET \
--url https://www.cubic.dev/api/analytics/v1/prs \
--header 'Authorization: Bearer <token>'const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://www.cubic.dev/api/analytics/v1/prs', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://www.cubic.dev/api/analytics/v1/prs"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text){
"data": [
{
"org": "acme",
"repo": "backend",
"prNumber": 4645,
"author": "john-doe",
"createdAt": "2026-04-16T12:00:00.000Z",
"mergedAt": "2026-04-17T12:00:00.000Z",
"linesAdded": 543,
"linesDeleted": 12,
"numberOfCubicIssuesFlagged": 5,
"numberOfCubicIssuesFixed": 4,
"cubicFirstReviewedAt": "2026-04-17T00:00:00.000Z",
"totalAiLinesAuthored": 523
}
],
"nextCursor": "2026-04-16T12:00:00.000Z|102"
}{
"error": "<string>",
"details": "<unknown>"
}{
"error": "<string>",
"details": "<unknown>"
}{
"error": "<string>",
"details": "<unknown>"
}{
"error": "<string>",
"details": "<unknown>"
}{
"error": "<string>",
"details": "<unknown>"
}{
"error": "<string>",
"details": "<unknown>"
}{
"error": "<string>",
"details": "<unknown>"
}Use a personal API key that starts with
cbk_ or an organization API key that starts with cok_.
The organization must be on Pro or Max. Analytics API keys that start with cak_ also work, but
cubic no longer creates them.
See the Analytics API guide for key setup, date windows, pagination, and how to
interpret the metrics.Authorizations
Query Parameters
Start of the review date window. Accepts ISO 8601 timestamps or UTC date-only values such as 2026-04-01. Surrounding whitespace is trimmed before validation; blank values are ignored. If neither date bound is set, cubic uses the last 30 days, 7 days, or 24 hours based on the installation's available history.
Maximum string length:
255Response
A page of pull request analytics. nextCursor is null on the last page. Recent updates may take a short time to appear due to read-replica lag.
Was this page helpful?