Skip to main content
You may need to measure impact of cubic, but already have a set of analytics tools. The Analytics API gives you PR-level data on how many issues were flagged, how many were fixed, how much AI code was authored, etc.

Get an API key

Analytics API access requires a Pro plan.
1

Open the Analytics API integration

2

Generate a personal key

Click Generate API key. Analytics API keys start with cak_, and cubic only shows the full value once.
3

Store it securely

Save the key in your secret manager or local environment. If you revoke or regenerate the key, the previous value stops working immediately.
API keys are personal. Each team member should generate their own key, and every request is limited to the organizations and repositories that key owner can already access in cubic.

Endpoint

Use this endpoint to fetch merged pull requests that have completed cubic reviews in the selected time window.

Authentication

Send the Analytics API key in the Authorization header as a bearer token.

Example requests

Query parameters

If you do not send startDate or endDate, cubic picks a default window based on how much data is available for that installation: the last 30 days, last 7 days, or last 24 hours.
Date-only values are interpreted in UTC. For example, endDate=2026-04-30 includes the full day through 23:59:59.999Z.
If you send only one date bound, cubic fills in the other one for you:
  • startDate only: endDate defaults to the current time
  • endDate only: startDate defaults to the start of available data

Response format

The API returns one page of PR rows plus an optional cursor for the next page.

Top-level fields

Pull request row fields

Pagination

When nextCursor is present, send it back in the next request to continue from the previous page.

Common errors