Reports
Overview
The Confident AI SDK exposes every Report method on the platform. This page documents how to call these methods in all supported languages. See the introduction to install the SDK and set your API key.
Methods
List Reports
Lists the reports in your Confident AI project one page at a time, newest first, without their sections. Narrow the page with reportTemplateId, status, or a startDate/endDate window; retrieve a report by id to read its sections.
from confident_ai import ConfidentAI
from confident_ai.reports import ReportStatus
client = ConfidentAI()
result = client.reports.list(
report_template_id="<REPORT-TEMPLATE-ID>",
status=ReportStatus.IN_PROGRESS,
start_date="2025-01-01T00:00:00+00:00",
end_date="2025-01-31T23:59:59+00:00",
page=1,
page_size=25,
)For async mode, call a_list and await it as shown below:
result = await client.reports.a_list(...)Parameters
| Parameter | Type | Description |
|---|---|---|
report_template_id | Optional[str] | Only return reports written under this report template. |
status | Optional[ReportStatus] | See ReportStatus. |
start_date | Optional[str] | Only return reports created at or after this ISO 8601 datetime. |
end_date | Optional[str] | Only return reports created at or before this ISO 8601 datetime. |
page | Optional[int] | The page to return. Defaults to 1. |
page_size | Optional[int] | The number of results per page, at most 100. Defaults to 25. |
import { ConfidentAI } from "confident-ai";
import { ReportStatus } from "confident-ai/reports";
const client = new ConfidentAI();
const result = await client.reports.list(
{
reportTemplateId: "<REPORT-TEMPLATE-ID>",
status: ReportStatus.IN_PROGRESS,
startDate: "2025-01-01T00:00:00+00:00",
endDate: "2025-01-31T23:59:59+00:00",
page: 1,
pageSize: 25
},
);Parameters
| Parameter | Type | Description |
|---|---|---|
reportTemplateId | string | Only return reports written under this report template. |
status | ReportStatus | See ReportStatus. |
startDate | string | Only return reports created at or after this ISO 8601 datetime. |
endDate | string | Only return reports created at or before this ISO 8601 datetime. |
page | number | The page to return. Defaults to 1. |
pageSize | number | The number of results per page, at most 100. Defaults to 25. |
Returns
This method returns an object of type ReportList.
Create Report
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.
from confident_ai import ConfidentAI
from confident_ai.reports import ReportContentSectionInput
from confident_ai.reports import ReportDateRange
from confident_ai.reports import ReportMetadataInput
from confident_ai.reports import ReportNarrativeContent
from confident_ai.reports import ReportStatus
client = ConfidentAI()
result = client.reports.create(
report_template_id="<REPORT-TEMPLATE-ID>",
sections=[
ReportContentSectionInput(
type="CONTENT",
heading="Overview",
start_on_new_page=False,
content=ReportNarrativeContent(
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"]
)
)
],
status=ReportStatus.IN_PROGRESS,
error="<ERROR>",
metadata=ReportMetadataInput(
report_title="Weekly Health Check",
description="Production health for the last week.",
date_range=ReportDateRange(
start_date="2025-01-01T00:00:00+00:00",
end_date="2025-01-08T00:00:00+00:00"
)
),
)For async mode, call a_create and await it as shown below:
result = await client.reports.a_create(...)Parameters
| Parameter | Type | Description |
|---|---|---|
report_template_id | str | Required. The report template to write this report under. Required, since a report is read under its template. |
sections | List[ReportSectionInput] | Required. The report's sections, in render order. At least one is required. See ReportSectionInput. |
status | Optional[ReportStatus] | See ReportStatus. |
error | Optional[str] | Why the report failed, when creating it as ERRORED. |
metadata | Optional[ReportMetadataInput] | See ReportMetadataInput. |
import { ConfidentAI } from "confident-ai";
import { ReportStatus } from "confident-ai/reports";
const client = new ConfidentAI();
const result = await client.reports.create(
"<REPORT-TEMPLATE-ID>",
[
{
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"]
}
}
],
{
status: ReportStatus.IN_PROGRESS,
error: "<ERROR>",
metadata: {
reportTitle: "Weekly Health Check",
description: "Production health for the last week.",
dateRange: {
startDate: "2025-01-01T00:00:00+00:00",
endDate: "2025-01-08T00:00:00+00:00"
}
}
},
);Parameters
| Parameter | Type | Description |
|---|---|---|
reportTemplateId | string | Required. The report template to write this report under. Required, since a report is read under its template. |
sections | ReportSectionInput[] | Required. The report's sections, in render order. At least one is required. See ReportSectionInput. |
status | ReportStatus | See ReportStatus. |
error | string | null | Why the report failed, when creating it as ERRORED. |
metadata | ReportMetadataInput | See ReportMetadataInput. |
Returns
This method returns an object of type ReportRef.
Get Report
Retrieves a report by id, with every section it renders in order. A section Confident AI is still writing comes back with null content.
from confident_ai import ConfidentAI
client = ConfidentAI()
result = client.reports.get(report_id="<REPORT-ID>")For async mode, call a_get and await it as shown below:
result = await client.reports.a_get(...)Parameters
| Parameter | Type | Description |
|---|---|---|
report_id | str | Required. The id of the report. |
import { ConfidentAI } from "confident-ai";
const client = new ConfidentAI();
const result = await client.reports.get("<REPORT-ID>");Parameters
| Parameter | Type | Description |
|---|---|---|
reportId | string | Required. The id of the report. |
Returns
This method returns an object of type Report.
Update Report
Updates a report and returns it. Only the fields you send are changed: metadata is merged onto the report's stored header, while sections replaces its section list wholesale.
from confident_ai import ConfidentAI
from confident_ai.reports import ReportContentSectionInput
from confident_ai.reports import ReportDateRange
from confident_ai.reports import ReportMetadataInput
from confident_ai.reports import ReportNarrativeContent
from confident_ai.reports import ReportStatus
client = ConfidentAI()
result = client.reports.update(
report_id="<REPORT-ID>",
status=ReportStatus.IN_PROGRESS,
error="<ERROR>",
metadata=ReportMetadataInput(
report_title="Weekly Health Check",
description="Production health for the last week.",
date_range=ReportDateRange(
start_date="2025-01-01T00:00:00+00:00",
end_date="2025-01-08T00:00:00+00:00"
)
),
sections=[
ReportContentSectionInput(
type="CONTENT",
heading="Overview",
start_on_new_page=False,
content=ReportNarrativeContent(
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"]
)
)
],
)For async mode, call a_update and await it as shown below:
result = await client.reports.a_update(...)Parameters
| Parameter | Type | Description |
|---|---|---|
report_id | str | Required. The id of the report. |
status | Optional[ReportStatus] | See ReportStatus. |
error | Optional[str] | Why the report failed. Pair it with a status of ERRORED, or send null to clear it. |
metadata | Optional[ReportMetadataInput] | See ReportMetadataInput. |
sections | Optional[List[ReportSectionInput]] | The report's sections, in render order. The list replaces the report's current sections rather than adding to them. See ReportSectionInput. |
import { ConfidentAI } from "confident-ai";
import { ReportStatus } from "confident-ai/reports";
const client = new ConfidentAI();
const result = await client.reports.update(
"<REPORT-ID>",
{
status: ReportStatus.IN_PROGRESS,
error: "<ERROR>",
metadata: {
reportTitle: "Weekly Health Check",
description: "Production health for the last week.",
dateRange: {
startDate: "2025-01-01T00:00:00+00:00",
endDate: "2025-01-08T00:00:00+00:00"
}
},
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"]
}
}
]
},
);Parameters
| Parameter | Type | Description |
|---|---|---|
reportId | string | Required. The id of the report. |
status | ReportStatus | See ReportStatus. |
error | string | null | Why the report failed. Pair it with a status of ERRORED, or send null to clear it. |
metadata | ReportMetadataInput | See ReportMetadataInput. |
sections | ReportSectionInput[] | The report's sections, in render order. The list replaces the report's current sections rather than adding to them. See ReportSectionInput. |
Returns
This method returns an object of type Report.
Delete Report
Permanently deletes a report and all of its sections. The report template it was written under is kept.
from confident_ai import ConfidentAI
client = ConfidentAI()
result = client.reports.delete(report_id="<REPORT-ID>")For async mode, call a_delete and await it as shown below:
result = await client.reports.a_delete(...)Parameters
| Parameter | Type | Description |
|---|---|---|
report_id | str | Required. The id of the report. |
import { ConfidentAI } from "confident-ai";
const client = new ConfidentAI();
const result = await client.reports.delete("<REPORT-ID>");Parameters
| Parameter | Type | Description |
|---|---|---|
reportId | string | Required. The id of the report. |
Returns
This method returns an object of type ReportRef.
Types
Report
A report written under a report template, with every section it renders.
class Report:
id: str
report_template_id: Optional[str] = Field(alias="reportTemplateId")
status: ReportStatus
error: Optional[str]
metadata: Optional[ReportMetadata]
created_at: str = Field(alias="createdAt")
updated_at: str = Field(alias="updatedAt")
sections: List[ReportSection]idstrRequired
The id of the report, generated by Confident AI.
Example: "<REPORT-ID>"
report_template_idOptional[str]Required
The id of the report template this report is written under, or null once that template has been deleted, which leaves the report unreachable on the platform.
Example: "<REPORT-TEMPLATE-ID>"
statusReportStatusRequired
See ReportStatus.
errorOptional[str]Required
Why the report failed, when it did.
metadataOptional[ReportMetadata]Required
See ReportMetadata.
created_atstrRequired
When the report was created.
Example: "2025-01-08T00:00:00+00:00"
updated_atstrRequired
When the report was last updated.
Example: "2025-01-08T00:00:00+00:00"
sectionsList[ReportSection]Required
The report's sections, ordered as they render.
See ReportSection.
interface Report {
id: string;
reportTemplateId: string | null;
status: ReportStatus;
error: string | null;
metadata: ReportMetadata | null;
createdAt: string;
updatedAt: string;
sections: ReportSection[];
}idstringRequired
The id of the report, generated by Confident AI.
Example: "<REPORT-ID>"
reportTemplateIdstring | nullRequired
The id of the report template this report is written under, or null once that template has been deleted, which leaves the report unreachable on the platform.
Example: "<REPORT-TEMPLATE-ID>"
statusReportStatusRequired
See ReportStatus.
errorstring | nullRequired
Why the report failed, when it did.
metadataReportMetadata | nullRequired
See ReportMetadata.
createdAtstringRequired
When the report was created.
Example: "2025-01-08T00:00:00+00:00"
updatedAtstringRequired
When the report was last updated.
Example: "2025-01-08T00:00:00+00:00"
sectionsReportSection[]Required
The report's sections, ordered as they render.
See ReportSection.
ReportAdmonitionContent
The content of an ADMONITION section — a callout carrying a severity.
class ReportAdmonitionContent:
severity: ReportAdmonitionSeverity
text: str
sources: Optional[List[str]] = NoneseverityReportAdmonitionSeverityRequired
textstrRequired
One to three sentences.
Example: "The error rate is falling but still sits above the 1% target for a second week."
sourcesOptional[List[str]]
Reader-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.
Example: ["Traces, 1-8 Jan 2025"]
interface ReportAdmonitionContent {
severity: ReportAdmonitionSeverity;
text: string;
sources?: string[] | null;
}severityReportAdmonitionSeverityRequired
textstringRequired
One to three sentences.
Example: "The error rate is falling but still sits above the 1% target for a second week."
sourcesstring[] | null
Reader-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.
Example: ["Traces, 1-8 Jan 2025"]
ReportAdmonitionSeverity
How an ADMONITION section's callout is styled.
class ReportAdmonitionSeverity(Enum):
INFO = "INFO"
SUCCESS = "SUCCESS"
WARNING = "WARNING"
DANGER = "DANGER"enum ReportAdmonitionSeverity {
INFO = "INFO",
SUCCESS = "SUCCESS",
WARNING = "WARNING",
DANGER = "DANGER",
}INFO · SUCCESS · WARNING · DANGER
ReportDateRange
The window a report describes, shown in its header.
class ReportDateRange:
start_date: str = Field(alias="startDate")
end_date: str = Field(alias="endDate")start_datestrRequired
The start of the window, as an ISO 8601 datetime.
Example: "2025-01-01T00:00:00+00:00"
end_datestrRequired
The end of the window, as an ISO 8601 datetime.
Example: "2025-01-08T00:00:00+00:00"
interface ReportDateRange {
startDate: string;
endDate: string;
}startDatestringRequired
The start of the window, as an ISO 8601 datetime.
Example: "2025-01-01T00:00:00+00:00"
endDatestringRequired
The end of the window, as an ISO 8601 datetime.
Example: "2025-01-08T00:00:00+00:00"
ReportGraphConfigContent
The content of a GRAPH section that Confident AI generated as a live query rather than a snapshot. It carries no data of its own: the query is run against your project when the report is rendered. Read-only — a chart you write yourself is always a snapshot.
class ReportGraphConfigContent:
type: Literal["config"]
source: Optional[str] = None
title: str
data_model: str = Field(alias="dataModel")
metric: str
dimension: Optional[str] = None
granularity: Optional[str] = None
span_type: Optional[str] = Field(default=None, alias="spanType")
start_date: Optional[str] = Field(default=None, alias="startDate")
end_date: Optional[str] = Field(default=None, alias="endDate")
sources: Optional[List[str]] = NonetypeLiteral["config"]Required
Always config.
Example: "config"
sourceOptional[str]
Which data source resolves the query.
Example: "aggregate"
titlestrRequired
The chart title.
Example: "Daily trace error rate"
data_modelstrRequired
The data model queried, such as TRACE, SPAN or METRIC_DATA.
Example: "TRACE"
metricstrRequired
The aggregate plotted, such as error_rate or total_cost.
Example: "error_rate"
dimensionOptional[str]
The property the metric is split by, giving one line per value. Null for a plain trend over time.
granularityOptional[str]
The time bucket, such as hour, day, week or month.
Example: "day"
span_typeOptional[str]
The span type queried, for SPAN charts only.
start_dateOptional[str]
The start of the queried window as an ISO 8601 datetime, pinning the chart to a point in time.
Example: "2025-01-01T00:00:00+00:00"
end_dateOptional[str]
The end of the queried window as an ISO 8601 datetime.
Example: "2025-01-08T00:00:00+00:00"
sourcesOptional[List[str]]
Reader-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.
Example: ["Traces, 1-8 Jan 2025"]
interface ReportGraphConfigContent {
type: "config";
source?: string | null;
title: string;
dataModel: string;
metric: string;
dimension?: string | null;
granularity?: string | null;
spanType?: string | null;
startDate?: string | null;
endDate?: string | null;
sources?: string[] | null;
}type"config"Required
Always config.
Example: "config"
sourcestring | null
Which data source resolves the query.
Example: "aggregate"
titlestringRequired
The chart title.
Example: "Daily trace error rate"
dataModelstringRequired
The data model queried, such as TRACE, SPAN or METRIC_DATA.
Example: "TRACE"
metricstringRequired
The aggregate plotted, such as error_rate or total_cost.
Example: "error_rate"
dimensionstring | null
The property the metric is split by, giving one line per value. Null for a plain trend over time.
granularitystring | null
The time bucket, such as hour, day, week or month.
Example: "day"
spanTypestring | null
The span type queried, for SPAN charts only.
startDatestring | null
The start of the queried window as an ISO 8601 datetime, pinning the chart to a point in time.
Example: "2025-01-01T00:00:00+00:00"
endDatestring | null
The end of the queried window as an ISO 8601 datetime.
Example: "2025-01-08T00:00:00+00:00"
sourcesstring[] | null
Reader-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.
Example: ["Traces, 1-8 Jan 2025"]
ReportGraphContent
The 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.
class ReportGraphContent:
type: Literal["snapshot"]
graph_type: ReportGraphType = Field(alias="graphType")
categories: List[str]
series: List[ReportGraphSeries]
x_axis_label: Optional[str] = Field(default=None, alias="xAxisLabel")
y_axis_label: Optional[str] = Field(default=None, alias="yAxisLabel")
sources: Optional[List[str]] = NonetypeLiteral["snapshot"]Required
Always snapshot.
Example: "snapshot"
graph_typeReportGraphTypeRequired
See ReportGraphType.
categoriesList[str]Required
The x-axis labels. At least one is required.
Example: ["2025-01-06","2025-01-07","2025-01-08"]
seriesList[ReportGraphSeries]Required
One entry per plotted line. Every series' values must be the same length as categories.
See ReportGraphSeries.
x_axis_labelOptional[str]
A label for the x-axis.
Example: "Day"
y_axis_labelOptional[str]
A label for the y-axis.
Example: "Errored traces / total traces"
sourcesOptional[List[str]]
Reader-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.
Example: ["Traces, 1-8 Jan 2025"]
interface ReportGraphContent {
type: "snapshot";
graphType: ReportGraphType;
categories: string[];
series: ReportGraphSeries[];
xAxisLabel?: string | null;
yAxisLabel?: string | null;
sources?: string[] | null;
}type"snapshot"Required
Always snapshot.
Example: "snapshot"
graphTypeReportGraphTypeRequired
See ReportGraphType.
categoriesstring[]Required
The x-axis labels. At least one is required.
Example: ["2025-01-06","2025-01-07","2025-01-08"]
seriesReportGraphSeries[]Required
One entry per plotted line. Every series' values must be the same length as categories.
See ReportGraphSeries.
xAxisLabelstring | null
A label for the x-axis.
Example: "Day"
yAxisLabelstring | null
A label for the y-axis.
Example: "Errored traces / total traces"
sourcesstring[] | null
Reader-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.
Example: ["Traces, 1-8 Jan 2025"]
ReportGraphSeries
One plotted line on a GRAPH section.
class ReportGraphSeries:
name: str
values: List[float]
color: Optional[str] = NonenamestrRequired
The series label, which doubles as its legend entry.
Example: "Error Rate"
valuesList[float]Required
One number per category, aligned positionally with them.
Example: [0.031,0.025,0.021]
colorOptional[str]
A colour for the series. Confident AI picks one when omitted.
Example: "#F97316"
interface ReportGraphSeries {
name: string;
values: number[];
color?: string | null;
}namestringRequired
The series label, which doubles as its legend entry.
Example: "Error Rate"
valuesnumber[]Required
One number per category, aligned positionally with them.
Example: [0.031,0.025,0.021]
colorstring | null
A colour for the series. Confident AI picks one when omitted.
Example: "#F97316"
ReportGraphType
The chart style a GRAPH section renders as.
class ReportGraphType(Enum):
LINE = "LINE"
AREA = "AREA"
BAR = "BAR"
STACKED_BAR = "STACKED_BAR"enum ReportGraphType {
LINE = "LINE",
AREA = "AREA",
BAR = "BAR",
STACKED_BAR = "STACKED_BAR",
}LINE · AREA · BAR · STACKED_BAR
ReportList
One page of reports, with the total across all pages.
class ReportList:
reports: List[ReportSummary]
total_reports: int = Field(alias="totalReports")
page: int
page_size: int = Field(alias="pageSize")reportsList[ReportSummary]Required
The reports for the current page, newest first.
See ReportSummary.
total_reportsintRequired
The total number of reports matching the filters.
Example: 12
pageintRequired
The page this response covers.
Example: 1
page_sizeintRequired
The number of reports per page.
Example: 25
interface ReportList {
reports: ReportSummary[];
totalReports: number;
page: number;
pageSize: number;
}reportsReportSummary[]Required
The reports for the current page, newest first.
See ReportSummary.
totalReportsnumberRequired
The total number of reports matching the filters.
Example: 12
pagenumberRequired
The page this response covers.
Example: 1
pageSizenumberRequired
The number of reports per page.
Example: 25
ReportMetadata
The report's stored header information. A field the report was written without comes back as null.
class ReportMetadata:
report_title: Optional[str] = Field(alias="reportTitle")
description: Optional[str]
date_range: Optional[ReportDateRange] = Field(alias="dateRange")
generated_at: Optional[str] = Field(alias="generatedAt")report_titleOptional[str]Required
The report's title, as rendered in its header.
Example: "Weekly Health Check"
descriptionOptional[str]Required
One line on what the report covers.
Example: "Production health for the last week."
date_rangeOptional[ReportDateRange]Required
See ReportDateRange.
generated_atOptional[str]Required
When the report was written. Always stamped by Confident AI.
Example: "2025-01-08T00:00:00+00:00"
interface ReportMetadata {
reportTitle: string | null;
description: string | null;
dateRange: ReportDateRange | null;
generatedAt: string | null;
}reportTitlestring | nullRequired
The report's title, as rendered in its header.
Example: "Weekly Health Check"
descriptionstring | nullRequired
One line on what the report covers.
Example: "Production health for the last week."
dateRangeReportDateRange | nullRequired
See ReportDateRange.
generatedAtstring | nullRequired
When the report was written. Always stamped by Confident AI.
Example: "2025-01-08T00:00:00+00:00"
ReportMetadataInput
The report's header information. Confident AI stamps generatedAt itself.
class ReportMetadataInput:
report_title: Optional[str] = Field(default=None, alias="reportTitle")
description: Optional[str] = None
date_range: Optional[ReportDateRange] = Field(default=None, alias="dateRange")report_titleOptional[str]
The report's title. Defaults to the name of the report template it is written under.
Example: "Weekly Health Check"
descriptionOptional[str]
One line on what the report covers.
Example: "Production health for the last week."
date_rangeOptional[ReportDateRange]
See ReportDateRange.
interface ReportMetadataInput {
reportTitle?: string;
description?: string;
dateRange?: ReportDateRange;
}reportTitlestring
The report's title. Defaults to the name of the report template it is written under.
Example: "Weekly Health Check"
descriptionstring
One line on what the report covers.
Example: "Production health for the last week."
dateRangeReportDateRange
See ReportDateRange.
ReportNarrativeContent
The content of a CONTENT section — a block of prose.
class ReportNarrativeContent:
kind: Literal["narrative"]
narrative: str
sources: Optional[List[str]] = NonekindLiteral["narrative"]Required
Always narrative.
Example: "narrative"
narrativestrRequired
Plain 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 "- ".
Example: "Traffic held steady while the error rate fell by a third, and spend stayed inside budget."
sourcesOptional[List[str]]
Reader-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.
Example: ["Traces, 1-8 Jan 2025"]
interface ReportNarrativeContent {
kind: "narrative";
narrative: string;
sources?: string[] | null;
}kind"narrative"Required
Always narrative.
Example: "narrative"
narrativestringRequired
Plain 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 "- ".
Example: "Traffic held steady while the error rate fell by a third, and spend stayed inside budget."
sourcesstring[] | null
Reader-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.
Example: ["Traces, 1-8 Jan 2025"]
ReportRef
A reference to a report by its id.
class ReportRef:
id: stridstrRequired
The id of the report, generated by Confident AI.
Example: "<REPORT-ID>"
interface ReportRef {
id: string;
}idstringRequired
The id of the report, generated by Confident AI.
Example: "<REPORT-ID>"
ReportSection
One section of a report. Its content is null while Confident AI is still writing it.
class ReportSection:
id: str
type: ReportSectionType
heading: Optional[str]
order: int
content: Optional[Union[ReportNarrativeContent, ReportAdmonitionContent, ReportStatCardsContent, ReportTableContent, ReportGraphContent, ReportGraphConfigContent]]
error: Optional[str]
start_on_new_page: Optional[bool] = Field(alias="startOnNewPage")idstrRequired
The id of the section, generated by Confident AI.
Example: "<REPORT-SECTION-ID>"
typeReportSectionTypeRequired
See ReportSectionType.
headingOptional[str]Required
The heading rendered above the section, or null when it has none.
Example: "Overview"
orderintRequired
The section's position in the report, starting at 0.
Example: 0
contentOptional[Union[ReportNarrativeContent, ReportAdmonitionContent, ReportStatCardsContent, ReportTableContent, ReportGraphContent, ReportGraphConfigContent]]Required
errorOptional[str]Required
Why this section failed to generate, when it did.
start_on_new_pageOptional[bool]Required
Whether the section starts on a new page in the exported report.
Example: false
interface ReportSection {
id: string;
type: ReportSectionType;
heading: string | null;
order: number;
content: ReportNarrativeContent | ReportAdmonitionContent | ReportStatCardsContent | ReportTableContent | ReportGraphContent | ReportGraphConfigContent | null;
error: string | null;
startOnNewPage: boolean | null;
}idstringRequired
The id of the section, generated by Confident AI.
Example: "<REPORT-SECTION-ID>"
typeReportSectionTypeRequired
See ReportSectionType.
headingstring | nullRequired
The heading rendered above the section, or null when it has none.
Example: "Overview"
ordernumberRequired
The section's position in the report, starting at 0.
Example: 0
contentReportNarrativeContent | ReportAdmonitionContent | ReportStatCardsContent | ReportTableContent | ReportGraphContent | ReportGraphConfigContent | nullRequired
errorstring | nullRequired
Why this section failed to generate, when it did.
startOnNewPageboolean | nullRequired
Whether the section starts on a new page in the exported report.
Example: false
ReportSectionInput
One section to write into a report. Its content must match its type, and sections render in the order you send them.
ReportSectionInput = Union[
ReportContentSectionInput,
ReportAdmonitionSectionInput,
ReportStatCardsSectionInput,
ReportTableSectionInput,
ReportGraphSectionInput,
]type ReportSectionInput =
| ReportContentSectionInput
| ReportAdmonitionSectionInput
| ReportStatCardsSectionInput
| ReportTableSectionInput
| ReportGraphSectionInput;A ReportSectionInput is one of the shapes below. Send the fields of one of them, never a mix of both.
A section of prose.
class ReportContentSectionInput:
type: Literal["CONTENT"]
heading: Optional[str] = None
start_on_new_page: Optional[bool] = Field(default=None, alias="startOnNewPage")
content: ReportNarrativeContenttypeLiteral["CONTENT"]Required
Always CONTENT.
Example: "CONTENT"
headingOptional[str]
The heading rendered above the section. Omit it for an unheaded section.
Example: "Overview"
start_on_new_pageOptional[bool]
Whether the section starts on a new page in the exported report. Defaults to false.
Example: false
contentReportNarrativeContentRequired
interface ReportContentSectionInput {
type: "CONTENT";
heading?: string | null;
startOnNewPage?: boolean;
content: ReportNarrativeContent;
}type"CONTENT"Required
Always CONTENT.
Example: "CONTENT"
headingstring | null
The heading rendered above the section. Omit it for an unheaded section.
Example: "Overview"
startOnNewPageboolean
Whether the section starts on a new page in the exported report. Defaults to false.
Example: false
contentReportNarrativeContentRequired
A callout box carrying a severity.
class ReportAdmonitionSectionInput:
type: Literal["ADMONITION"]
heading: Optional[str] = None
start_on_new_page: Optional[bool] = Field(default=None, alias="startOnNewPage")
content: ReportAdmonitionContenttypeLiteral["ADMONITION"]Required
Always ADMONITION.
Example: "ADMONITION"
headingOptional[str]
The heading rendered above the section. Omit it for an unheaded section.
Example: "Overview"
start_on_new_pageOptional[bool]
Whether the section starts on a new page in the exported report. Defaults to false.
Example: false
contentReportAdmonitionContentRequired
interface ReportAdmonitionSectionInput {
type: "ADMONITION";
heading?: string | null;
startOnNewPage?: boolean;
content: ReportAdmonitionContent;
}type"ADMONITION"Required
Always ADMONITION.
Example: "ADMONITION"
headingstring | null
The heading rendered above the section. Omit it for an unheaded section.
Example: "Overview"
startOnNewPageboolean
Whether the section starts on a new page in the exported report. Defaults to false.
Example: false
contentReportAdmonitionContentRequired
A row of headline numbers.
class ReportStatCardsSectionInput:
type: Literal["STAT_CARDS"]
heading: Optional[str] = None
start_on_new_page: Optional[bool] = Field(default=None, alias="startOnNewPage")
content: ReportStatCardsContenttypeLiteral["STAT_CARDS"]Required
Always STAT_CARDS.
Example: "STAT_CARDS"
headingOptional[str]
The heading rendered above the section. Omit it for an unheaded section.
Example: "Overview"
start_on_new_pageOptional[bool]
Whether the section starts on a new page in the exported report. Defaults to false.
Example: false
contentReportStatCardsContentRequired
interface ReportStatCardsSectionInput {
type: "STAT_CARDS";
heading?: string | null;
startOnNewPage?: boolean;
content: ReportStatCardsContent;
}type"STAT_CARDS"Required
Always STAT_CARDS.
Example: "STAT_CARDS"
headingstring | null
The heading rendered above the section. Omit it for an unheaded section.
Example: "Overview"
startOnNewPageboolean
Whether the section starts on a new page in the exported report. Defaults to false.
Example: false
contentReportStatCardsContentRequired
A grid of headers and rows.
class ReportTableSectionInput:
type: Literal["TABLE"]
heading: Optional[str] = None
start_on_new_page: Optional[bool] = Field(default=None, alias="startOnNewPage")
content: ReportTableContenttypeLiteral["TABLE"]Required
Always TABLE.
Example: "TABLE"
headingOptional[str]
The heading rendered above the section. Omit it for an unheaded section.
Example: "Overview"
start_on_new_pageOptional[bool]
Whether the section starts on a new page in the exported report. Defaults to false.
Example: false
contentReportTableContentRequired
See ReportTableContent.
interface ReportTableSectionInput {
type: "TABLE";
heading?: string | null;
startOnNewPage?: boolean;
content: ReportTableContent;
}type"TABLE"Required
Always TABLE.
Example: "TABLE"
headingstring | null
The heading rendered above the section. Omit it for an unheaded section.
Example: "Overview"
startOnNewPageboolean
Whether the section starts on a new page in the exported report. Defaults to false.
Example: false
contentReportTableContentRequired
See ReportTableContent.
A chart plotting the numbers you supply.
class ReportGraphSectionInput:
type: Literal["GRAPH"]
heading: Optional[str] = None
start_on_new_page: Optional[bool] = Field(default=None, alias="startOnNewPage")
content: ReportGraphContenttypeLiteral["GRAPH"]Required
Always GRAPH.
Example: "GRAPH"
headingOptional[str]
The heading rendered above the section. Omit it for an unheaded section.
Example: "Overview"
start_on_new_pageOptional[bool]
Whether the section starts on a new page in the exported report. Defaults to false.
Example: false
contentReportGraphContentRequired
See ReportGraphContent.
interface ReportGraphSectionInput {
type: "GRAPH";
heading?: string | null;
startOnNewPage?: boolean;
content: ReportGraphContent;
}type"GRAPH"Required
Always GRAPH.
Example: "GRAPH"
headingstring | null
The heading rendered above the section. Omit it for an unheaded section.
Example: "Overview"
startOnNewPageboolean
Whether the section starts on a new page in the exported report. Defaults to false.
Example: false
contentReportGraphContentRequired
See ReportGraphContent.
ReportSectionType
What a section renders as, which decides the shape of its content: CONTENT is prose, ADMONITION a callout, STAT_CARDS a row of headline numbers, TABLE a grid, and GRAPH a chart.
class ReportSectionType(Enum):
CONTENT = "CONTENT"
STAT_CARDS = "STAT_CARDS"
TABLE = "TABLE"
GRAPH = "GRAPH"
ADMONITION = "ADMONITION"enum ReportSectionType {
CONTENT = "CONTENT",
STAT_CARDS = "STAT_CARDS",
TABLE = "TABLE",
GRAPH = "GRAPH",
ADMONITION = "ADMONITION",
}CONTENT · STAT_CARDS · TABLE · GRAPH · ADMONITION
ReportStatCard
One headline number on a STAT_CARDS section.
class ReportStatCard:
label: str
value: str
caption: Optional[str] = NonelabelstrRequired
A short Title Case phrase of 2-4 words — never a sentence or a raw column name.
Example: "Error Rate"
valuestrRequired
A number, percentage, or short phrase, with numbers rounded to 2 decimal places.
Example: "2.10%"
captionOptional[str]
One short supporting line of 10 words or fewer.
Example: "412 of 19,600 requests"
interface ReportStatCard {
label: string;
value: string;
caption?: string | null;
}labelstringRequired
A short Title Case phrase of 2-4 words — never a sentence or a raw column name.
Example: "Error Rate"
valuestringRequired
A number, percentage, or short phrase, with numbers rounded to 2 decimal places.
Example: "2.10%"
captionstring | null
One short supporting line of 10 words or fewer.
Example: "412 of 19,600 requests"
ReportStatCardsContent
The content of a STAT_CARDS section — a row of headline numbers.
class ReportStatCardsContent:
cards: List[ReportStatCard]
highlights: Optional[List[ReportStatHighlight]] = None
sources: Optional[List[str]] = NonecardsList[ReportStatCard]Required
Three to five cards read best. At least one is required.
See ReportStatCard.
highlightsOptional[List[ReportStatHighlight]]
At most three standout findings. Omit rather than padding.
See ReportStatHighlight.
sourcesOptional[List[str]]
Reader-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.
Example: ["Traces, 1-8 Jan 2025"]
interface ReportStatCardsContent {
cards: ReportStatCard[];
highlights?: ReportStatHighlight[] | null;
sources?: string[] | null;
}cardsReportStatCard[]Required
Three to five cards read best. At least one is required.
See ReportStatCard.
highlightsReportStatHighlight[] | null
At most three standout findings. Omit rather than padding.
See ReportStatHighlight.
sourcesstring[] | null
Reader-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.
Example: ["Traces, 1-8 Jan 2025"]
ReportStatHighlight
A standout finding shown alongside the stat cards.
class ReportStatHighlight:
label: str
value: strlabelstrRequired
A short Title Case phrase.
Example: "Costliest Model"
valuestrRequired
The highlighted value.
Example: "gpt-4o, $96.20"
interface ReportStatHighlight {
label: string;
value: string;
}labelstringRequired
A short Title Case phrase.
Example: "Costliest Model"
valuestringRequired
The highlighted value.
Example: "gpt-4o, $96.20"
ReportStatus
Where 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.
class ReportStatus(Enum):
IN_PROGRESS = "IN_PROGRESS"
COMPLETED = "COMPLETED"
ERRORED = "ERRORED"enum ReportStatus {
IN_PROGRESS = "IN_PROGRESS",
COMPLETED = "COMPLETED",
ERRORED = "ERRORED",
}IN_PROGRESS · COMPLETED · ERRORED
ReportSummary
A report as it appears in a list: its status and header information, without its sections.
class ReportSummary:
id: str
report_template_id: Optional[str] = Field(alias="reportTemplateId")
status: ReportStatus
error: Optional[str]
metadata: Optional[ReportMetadata]
created_at: str = Field(alias="createdAt")
updated_at: str = Field(alias="updatedAt")idstrRequired
The id of the report, generated by Confident AI.
Example: "<REPORT-ID>"
report_template_idOptional[str]Required
The id of the report template this report is written under, or null once that template has been deleted, which leaves the report unreachable on the platform.
Example: "<REPORT-TEMPLATE-ID>"
statusReportStatusRequired
See ReportStatus.
errorOptional[str]Required
Why the report failed, when it did.
metadataOptional[ReportMetadata]Required
See ReportMetadata.
created_atstrRequired
When the report was created.
Example: "2025-01-08T00:00:00+00:00"
updated_atstrRequired
When the report was last updated.
Example: "2025-01-08T00:00:00+00:00"
interface ReportSummary {
id: string;
reportTemplateId: string | null;
status: ReportStatus;
error: string | null;
metadata: ReportMetadata | null;
createdAt: string;
updatedAt: string;
}idstringRequired
The id of the report, generated by Confident AI.
Example: "<REPORT-ID>"
reportTemplateIdstring | nullRequired
The id of the report template this report is written under, or null once that template has been deleted, which leaves the report unreachable on the platform.
Example: "<REPORT-TEMPLATE-ID>"
statusReportStatusRequired
See ReportStatus.
errorstring | nullRequired
Why the report failed, when it did.
metadataReportMetadata | nullRequired
See ReportMetadata.
createdAtstringRequired
When the report was created.
Example: "2025-01-08T00:00:00+00:00"
updatedAtstringRequired
When the report was last updated.
Example: "2025-01-08T00:00:00+00:00"
ReportTableContent
The content of a TABLE section — headers and the rows beneath them.
class ReportTableContent:
headers: List[str]
rows: List[List[str]]
sources: Optional[List[str]] = NoneheadersList[str]Required
The column headers. At least one is required.
Example: ["Model","Total Cost"]
rowsList[List[str]]Required
The rows. Every row must hold exactly as many cells as there are headers, in the same order.
Example: [["gpt-4o","$96.20"],["gpt-4o-mini","$32.20"]]
sourcesOptional[List[str]]
Reader-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.
Example: ["Traces, 1-8 Jan 2025"]
interface ReportTableContent {
headers: string[];
rows: string[][];
sources?: string[] | null;
}headersstring[]Required
The column headers. At least one is required.
Example: ["Model","Total Cost"]
rowsstring[][]Required
The rows. Every row must hold exactly as many cells as there are headers, in the same order.
Example: [["gpt-4o","$96.20"],["gpt-4o-mini","$32.20"]]
sourcesstring[] | null
Reader-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.
Example: ["Traces, 1-8 Jan 2025"]
Last updated on