Create Report
POSThttps://api.confident-ai.com/v2/reports
Writes a report into your Confident AI project and returns its id. You supply the finished section content and it is stored and rendered exactly as given, under the report template you name.
curl -X POST "https://api.confident-ai.com/v2/reports" \
-H "CONFIDENT_API_KEY: <PROJECT-API-KEY>" \
-H "Content-Type: application/json" \
-d '{
"reportTemplateId": "<REPORT-TEMPLATE-ID>",
"status": "IN_PROGRESS",
"error": null,
"metadata": {
"reportTitle": "Weekly Health Check",
"description": "Production health for the last week.",
"dateRange": {
"startDate": "2025-01-01T00:00:00.000Z",
"endDate": "2025-01-08T00:00:00.000Z"
}
},
"sections": [
{
"type": "CONTENT",
"heading": "Overview",
"startOnNewPage": false,
"content": {
"kind": "narrative",
"narrative": "Traffic held steady while the error rate fell by a third, and spend stayed inside budget.",
"sources": [
"Traces, 1-8 Jan 2025"
]
}
}
]
}'{
"success": true,
"data": {
"id": "<REPORT-ID>"
},
"link": "https://app.confident-ai.com/project/<PROJECT-ID>/reports/<REPORT-TEMPLATE-ID>?reportId=<REPORT-ID>",
"deprecated": false
}Headers
CONFIDENT_API_KEYstringRequiredThe API key of your Confident AI project.
Request body
reportTemplateIdstringRequiredThe report template to write this report under. Required, since a report is read under its template.
statusenumWhere a report is in its life: IN_PROGRESS while its sections are still being written, COMPLETED once it is readable, ERRORED when writing it failed.
Show 3 enum valuesHide 3 enum values
IN_PROGRESSCOMPLETEDERRORED
errorstring | nullWhy the report failed, when creating it as ERRORED.
metadataobjectThe report's header information. Confident AI stamps
generatedAtitself.Show 3 propertiesHide 3 properties
reportTitlestringThe report's title. Defaults to the name of the report template it is written under.
descriptionstringOne line on what the report covers.
dateRangeobjectThe window a report describes, shown in its header.
Show 2 propertiesHide 2 properties
startDatestringRequiredThe start of the window, as an ISO 8601 datetime.
endDatestringRequiredThe end of the window, as an ISO 8601 datetime.
sectionslist of object | object | object | object | objectRequiredThe report's sections, in render order. At least one is required.
Show 5 variantsHide 5 variants
Content SectionobjectA section of prose.
Show 4 propertiesHide 4 properties
typeenumRequiredAlways
CONTENT.Show 1 enum valueHide 1 enum value
CONTENT
headingstring | nullThe heading rendered above the section. Omit it for an unheaded section.
startOnNewPagebooleanWhether the section starts on a new page in the exported report. Defaults to false.
contentobjectRequiredThe content of a CONTENT section — a block of prose.
Show 3 propertiesHide 3 properties
kindenumRequiredAlways
narrative.Show 1 enum valueHide 1 enum value
narrative
narrativestringRequiredPlain text only — no markdown headings, bold, or code fences. Do not repeat the section's heading, which renders above this text. Express a list as one item per line, each starting with "- ".
sourcesarray | nullReader-facing labels for the data this section draws on, rendered beneath it. Omit them unless you want the section to cite where its numbers came from.
- OR
Admonition SectionobjectA callout box carrying a severity.
Show 4 propertiesHide 4 properties
typeenumRequiredAlways
ADMONITION.Show 1 enum valueHide 1 enum value
ADMONITION
headingstring | nullThe heading rendered above the section. Omit it for an unheaded section.
startOnNewPagebooleanWhether the section starts on a new page in the exported report. Defaults to false.
contentobjectRequiredThe content of an ADMONITION section — a callout carrying a severity.
Show 3 propertiesHide 3 properties
severityenumRequiredHow an ADMONITION section's callout is styled.
Show 4 enum valuesHide 4 enum values
INFOSUCCESSWARNINGDANGER
textstringRequiredOne to three sentences.
sourcesarray | nullReader-facing labels for the data this section draws on, rendered beneath it. Omit them unless you want the section to cite where its numbers came from.
- OR
Stat Cards SectionobjectA row of headline numbers.
Show 4 propertiesHide 4 properties
typeenumRequiredAlways
STAT_CARDS.Show 1 enum valueHide 1 enum value
STAT_CARDS
headingstring | nullThe heading rendered above the section. Omit it for an unheaded section.
startOnNewPagebooleanWhether the section starts on a new page in the exported report. Defaults to false.
contentobjectRequiredThe content of a STAT_CARDS section — a row of headline numbers.
Show 3 propertiesHide 3 properties
cardslist of objectsRequiredThree to five cards read best. At least one is required.
Show 3 propertiesHide 3 properties
labelstringRequiredA short Title Case phrase of 2-4 words — never a sentence or a raw column name.
valuestringRequiredA number, percentage, or short phrase, with numbers rounded to 2 decimal places.
captionstring | nullOne short supporting line of 10 words or fewer.
highlightsarray | nullAt most three standout findings. Omit rather than padding.
Show 2 propertiesHide 2 properties
labelstringRequiredA short Title Case phrase.
valuestringRequiredThe highlighted value.
sourcesarray | nullReader-facing labels for the data this section draws on, rendered beneath it. Omit them unless you want the section to cite where its numbers came from.
- OR
Table SectionobjectA grid of headers and rows.
Show 4 propertiesHide 4 properties
typeenumRequiredAlways
TABLE.Show 1 enum valueHide 1 enum value
TABLE
headingstring | nullThe heading rendered above the section. Omit it for an unheaded section.
startOnNewPagebooleanWhether the section starts on a new page in the exported report. Defaults to false.
contentobjectRequiredThe content of a TABLE section — headers and the rows beneath them.
Show 3 propertiesHide 3 properties
headerslist of stringsRequiredThe column headers. At least one is required.
rowslist of list of stringsRequiredThe rows. Every row must hold exactly as many cells as there are headers, in the same order.
sourcesarray | nullReader-facing labels for the data this section draws on, rendered beneath it. Omit them unless you want the section to cite where its numbers came from.
- OR
Graph SectionobjectA chart plotting the numbers you supply.
Show 4 propertiesHide 4 properties
typeenumRequiredAlways
GRAPH.Show 1 enum valueHide 1 enum value
GRAPH
headingstring | nullThe heading rendered above the section. Omit it for an unheaded section.
startOnNewPagebooleanWhether the section starts on a new page in the exported report. Defaults to false.
contentobjectRequiredThe content of a GRAPH section — a chart with its data baked in. This is the only chart form you can write over the API, so the chart always renders exactly the numbers you supply.
Show 7 propertiesHide 7 properties
typeenumRequiredAlways
snapshot.Show 1 enum valueHide 1 enum value
snapshot
graphTypeenumRequiredThe chart style a GRAPH section renders as.
Show 4 enum valuesHide 4 enum values
LINEAREABARSTACKED_BAR
categorieslist of stringsRequiredThe x-axis labels. At least one is required.
serieslist of objectsRequiredOne entry per plotted line. Every series'
valuesmust be the same length ascategories.Show 3 propertiesHide 3 properties
namestringRequiredThe series label, which doubles as its legend entry.
valueslist of numbersRequiredOne number per category, aligned positionally with them.
colorstring | nullA colour for the series. Confident AI picks one when omitted.
xAxisLabelstring | nullA label for the x-axis.
yAxisLabelstring | nullA label for the y-axis.
sourcesarray | nullReader-facing labels for the data this section draws on, rendered beneath it. Omit them unless you want the section to cite where its numbers came from.
Response
Create Report succeeded.
successbooleanIndicates if the request was successful.
dataobjectA reference to a report by its id.
Show 1 propertyHide 1 property
idstringThe id of the report, generated by Confident AI.
linkstringThis is the URL of the resource on the Confident AI platform.
deprecatedbooleanIndicates if this endpoint is deprecated.