Create Template
POSThttps://api.confident-ai.com/v2/report-templates
Creates a report template in your Confident AI project and returns its id. The description is the question the report answers; send templateSections to fix its structure, and a cadence to control when it generates. Without a cadence it repeats every 1 day.
curl -X POST "https://api.confident-ai.com/v2/report-templates" \
-H "CONFIDENT_API_KEY: <PROJECT-API-KEY>" \
-H "Content-Type: application/json" \
-d '{
"name": "Weekly Health Check",
"description": "Give me an overall health check for the last week: request volume, error rate, latency, total cost and user activity.",
"templateSections": [
{
"id": "<REPORT-TEMPLATE-SECTION-ID>",
"type": "CONTENT",
"heading": "What'\''s Failing",
"useAI": true,
"prompt": "Summarize the dominant failure modes in 2-4 sentences, citing error counts.",
"content": {
"text": "Generated daily for the platform team.",
"severity": "INFO"
},
"startOnNewPage": false
}
],
"enabled": true,
"recurrence": "ONCE",
"repeatEvery": 1,
"repeatUnit": "MINUTE",
"startAt": "2025-02-01T09:00:00Z",
"maxRuns": 12,
"endAt": "2025-12-31T23:59:59Z"
}'{
"success": true,
"data": {
"id": "<REPORT-TEMPLATE-ID>"
},
"deprecated": false
}Headers
CONFIDENT_API_KEYstringRequiredThe API key of your Confident AI project.
Request body
namestringRequiredThe template's name, also used as the report's title.
descriptionstring | nullThe question the report should answer, written as a question. Supply this even when providing sections — it drives the single data retrieval that serves them all.
templateSectionslist of objectsThe report's exact sections, in render order. Omit it to let the generator choose the structure from
description.Show 7 propertiesHide 7 properties
idstringThe id of the section. Send the id a section was read back with to keep its creation time across a rewrite; omit it and Confident AI assigns one.
typeenumRequiredWhat a section renders as. STAT_CARDS, TABLE and GRAPH must be AI-authored; CONTENT and ADMONITION can be either AI-authored or hardcoded.
Show 5 enum valuesHide 5 enum values
CONTENTSTAT_CARDSTABLEGRAPHADMONITION
headingstring | nullThe heading rendered above the section. Omit it for an unheaded section.
useAIbooleanWhether the generator authors this section from
prompt. Defaults to false, which renderscontentverbatim instead.promptstring | nullRequired when
useAIis true: a single directive for what this section must cover.contentobject | nullThe static content of a hardcoded (non-AI) template section. Null for AI-authored sections, which are written by the generator from their prompt.
Show 2 propertiesHide 2 properties
textstring | nullThe section's literal text, written verbatim into every generated report.
severityenum | nullThe callout style of an ADMONITION section, from an informational note to a danger warning.
Show 4 enum valuesHide 4 enum values
INFOSUCCESSWARNINGDANGER
startOnNewPagebooleanWhether the section starts on a new page in the exported report. Defaults to false.
enabledbooleanWhether to start generating on the schedule. Defaults to true; send false to create the template without scheduling it.
recurrenceenumHow often a schedule fires: ONCE runs a single time at
startAt, INTERVAL repeats everyrepeatEveryrepeatUnits.Show 2 enum valuesHide 2 enum values
ONCEINTERVAL
repeatEveryinteger | nullHow many
repeatUnits apart the runs are, for an INTERVAL schedule. Send null to clear it.repeatUnitenum | nullThe unit
repeatEverycounts for an INTERVAL schedule.Show 5 enum valuesHide 5 enum values
MINUTEHOURDAYWEEKMONTH
startAtstring | nullWhen the schedule first runs, as an ISO 8601 datetime. Send null to start it immediately.
maxRunsinteger | nullHow many times the schedule runs before it stops. Send null to let it run indefinitely.
endAtstring | nullWhen the schedule stops running, as an ISO 8601 datetime. Send null to leave it open-ended.
Response
Create Template succeeded.
successbooleanIndicates if the request was successful.
dataobjectA reference to a report template by its id.
Show 1 propertyHide 1 property
idstringThe id of the report template, generated by Confident AI.
deprecatedbooleanIndicates if this endpoint is deprecated.