All instructions for generating test sample reports
All instructions for generating test sample reports
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.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 thex-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 headerAPI 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, asYYYY-MM-DD. The report starts at 00:00 UTC on this day.to(string, required): The last day of the report, asYYYY-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, orCustom.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 chooseCustom. See Customize reports.parameters(array): Filters that narrow which pull requests the report covers. Each item has aparameter(REPOSITORY,LABEL,TEAM,USER,SOURCEBRANCH,TARGETBRANCH, orSTATE), anoperator(IN,ALL, orNOT_IN), andvalues, an array of strings. All three are required. See Report parameters.groupBy(string): The primary grouping:NONE(the default) or one of theparametervalues. See Grouping options.subgroupBy(string): The secondary grouping, with the same values asgroupBy. Defaults toNONE.scheduleRange(string): Accepts onlyDates. The report range always comes fromfromandto.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