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>"
}List pull request analytics
Export metrics for merged pull requests reviewed by cubic.
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>"
}cak_. The organization must be on Pro.
Members API keys that start with cbk_ cannot authenticate this endpoint.
See the Analytics API guide for key setup, date windows, pagination, and how to
interpret the metrics.Authorizations
Personal Analytics API key from Settings > Integrations > cubic API. Starts with cak_. Requires Pro. A cbk_ Members API key does not work here.
Query Parameters
GitHub organization or owner whose pull request analytics you want to fetch. Surrounding whitespace is trimmed before validation.
1 - 255Filter to one repository under the selected owner. Surrounding whitespace is trimmed before validation; blank values are ignored.
255Start 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.
255End of the review date window. A UTC date-only value includes the full day through 23:59:59.999Z. Surrounding whitespace is trimmed before validation; blank values are ignored.
255Number of results per page, from 1 to 100. Values outside this range return 400.
1 <= x <= 100Copy nextCursor unchanged from the preceding response. Keep the same organization, filters, and date window across pages. Surrounding whitespace is trimmed before validation; blank values are ignored.
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?