Skip to main content

Create a Smart Report

Create a draft SmartReport record (status: "draft") linked to an existing template and smartBatch. Use this endpoint when you already have a completed or ongoing SmartBatch and want to manage report creation, PDF generation, HTML retrieval, and email delivery as separate steps.

Creating a draft record returns HTTP 200 OK with the new SmartReport in { data }. It does not execute verification steps or render a PDF on its own — follow up with Generate Smart Report PDF or Send Smart Report by Email. If you want to execute verification steps and produce a report in one request, use Run a Smart Report.

Endpoint​

POST https://api.verifik.co/v2/smart-reports

This endpoint is also reachable through the Smart-Agent proxy at https://ai.verifik.co/v2/smart-reports using your own per-client Authorization: Bearer <VERIFIK_JWT>. Shared x402 execution is blocked with 403 Forbidden.

Headers​

NameValueDescription
Content-Typeapplication/jsonRequest payload format.
AuthorizationBearer <VERIFIK_JWT>Client-scoped JWT (authUser.clientId).

Body​

NameTypeRequiredDescription
templatestringYesTemplate ObjectId to render this report against.
smartBatchstringYesSmartBatch ObjectId supplying verification row results.
namestringNoDisplay name for the report. Max 150 characters.
externalRefIdstringNoCaller correlation identifier. Max 200 characters.
webhookUrlstringNoPer-report http or https webhook override URL. Max 2048 characters.
rowIndexintegerNoZero-based row index (>= 0) from the linked SmartBatch.
createdByChannelstringNoOrigin channel: "portal", "api", "mcp", "x402", or "webhook". Default "portal".

Step-by-step workflow vs headless run​

  • Use POST /v2/smart-reports when your workflow already executed a SmartBatch (for example via SmartBatch UI or queue API) and you want to create a draft SmartReport (status: "draft") first, preview HTML with Retrieve Smart Report HTML, render PDF with Generate Smart Report PDF, and deliver it with Send Smart Report by Email.
  • Note that createdByChannel defaults to "portal" on this route, so API integrations should set createdByChannel: "api" when tracking channel attribution.

Request​

import axios from "axios";

const run = async () => {
const { data } = await axios.post(
"https://api.verifik.co/v2/smart-reports",
{
template: "6801a2b3c4d5e6f7a8b9c0d2",
smartBatch: "6801a2b3c4d5e6f7a8b9c0d3",
name: "Applicant 42 Draft Report",
externalRefId: "applicant-42",
webhookUrl: "https://webhooks.example.com/verifik",
rowIndex: 0,
createdByChannel: "api",
},
{
headers: {
"Content-Type": "application/json",
Authorization: `Bearer ${process.env.VERIFIK_JWT}`,
},
}
);

console.log(data);
};

run();

Response​

{
"data": {
"_id": "6801a2b3c4d5e6f7a8b9c0d1",
"template": "6801a2b3c4d5e6f7a8b9c0d2",
"smartBatch": "6801a2b3c4d5e6f7a8b9c0d3",
"name": "Applicant 42 Draft Report",
"status": "draft",
"externalRefId": "applicant-42",
"webhookUrl": "https://webhooks.example.com/verifik",
"rowIndex": 0,
"createdByChannel": "api",
"createdAt": "2026-11-24T20:00:00.000Z",
"updatedAt": "2026-11-24T20:00:00.000Z"
}
}

Webhooks & MCP Integration​

  • Webhooks: Storing webhookUrl and externalRefId on the draft SmartReport ensures subsequent generation (smart_batch_report_generated, smart_batch_report_generation_failed) and email delivery (smart_batch_report_sent, smart_batch_report_delivery_failed) calls inherit your per-report callback destination and correlation identifier. See Smart Reports Webhooks.
  • MCP Integration: For single-call headless report execution in AI agents, use smart_report_run. See MCP and AI Agents.

Notes​