Skip to main content

Overview

Generate single-use reports instantly using the CodeRabbit API. API generated reports are ideal for testing report formats or getting quick insights without setting up recurring schedules.
For a conceptual overview of reports in CodeRabbit, see Generate reports.

API access

CodeRabbit offers a way to generate API reports with a single API request, whose fields are listed in API schema. You will need an API Key to access the CodeRabbit API and generate an API report.

Create an API key

Create an API key as Create a user or agentic key describes.

Generate an API report

Once you have the API key, pass it in the x-coderabbitai-api-key header when calling the API:

Sample response

JSON
If you get a 401 UNAUTHORIZED error, check if you’re passing the right API key in the x-coderabbitai-api-key header

API schema

POST https://api.coderabbit.ai/api/v1/report.generate takes a JSON body with these fields. Only from and to are required. A response can take up to 10 minutes.
  • from (string, required): The first day of the report, as YYYY-MM-DD. The report starts at 00:00 UTC on this day.
  • to (string, required): The last day of the report, as YYYY-MM-DD. The report includes this whole day in UTC.
  • promptTemplate (string): The report format: Daily Standup Report (the default), Sprint Report, Release Notes, Organization Stats, or Custom.
  • prompt (string): Your own instructions for the report’s content and format. When you set it, CodeRabbit uses it instead of the template’s instructions, so set it whenever you choose Custom. See Customize reports.
  • parameters (array): Filters that narrow which pull requests the report covers. Each item has a parameter (REPOSITORY, LABEL, TEAM, USER, SOURCEBRANCH, TARGETBRANCH, or STATE), an operator (IN, ALL, or NOT_IN), and values, an array of strings. All three are required. See Report parameters.
  • groupBy (string): The primary grouping: NONE (the default) or one of the parameter values. See Grouping options.
  • subgroupBy (string): The secondary grouping, with the same values as groupBy. Defaults to NONE.
  • scheduleRange (string): Accepts only Dates. The report range always comes from from and to.
  • orgId (string): Has no effect. The report always covers the organization your API key belongs to.

What’s next

Customize reports

Learn how to create custom report formats and prompts

Scheduled reports

Set up automated recurring reports for regular monitoring