Skip to main content

Run a Smart Report

Execute a complete verification and report pipeline in a single request. POST /v2/smart-reports/run is the primary headless all-in-one execution endpoint for Reports: it resolves a preset (systemKey) or an existing BatchConfiguration (batchConfigurationId), validates your inputs against the configuration input schema, verifies account feature grants, runs every verification step in FeatureRunner, creates both the SmartBatch (headlessRun: true) and the SmartReport, optionally computes verificationScore, renders PDF/HTML output, optionally sends emails, and dispatches webhooks.

For smaller runs (up to 5 rows), execution defaults to synchronous (mode: "sync") and returns 200 OK once settled within the 90-second sync window. Larger batches or runs that exceed the 90-second sync deadline automatically switch to asynchronous execution and return 202 Accepted with polling and download URLs.

Endpoint​

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

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

Headers​

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

A client-scoped JWT (authUser.clientId) is required. Tokens missing clientId return 409 Conflict (client_context_required). Missing or invalid JWTs return 401 Unauthorized.

Body​

NameTypeRequiredDescription
systemKeystringConditionalPreset identifier. Trimmed, max 120 characters, pattern /^[a-z0-9][a-z0-9._-]{1,118}$/i. At least one of systemKey or batchConfigurationId is required.
batchConfigurationIdstringConditionalExisting BatchConfiguration ObjectId. At least one of systemKey or batchConfigurationId is required.
templateIdstringNoReport template ObjectId. Overrides the preferred template on the configuration or preset.
namestringNoCustom display name for the generated report and batch. Max 150 characters.
inputsobject or object[]ConditionalSingle input object or array of input objects (min 1, max 500). At least one of inputs or rows is required; inputs takes precedence if both are sent.
rowsobject[]ConditionalArray of 1 to 500 row entries, formatted either as flat objects ({ ... }) or structured row objects ({ rowIndex, inputData }). At least one of inputs or rows is required.
modestringNo"sync" or "async". Defaults to "sync" when row count is <= 5, and "async" when row count is > 5. Passing mode: "sync" with > 5 rows returns 409 Conflict (sync_row_limit_exceeded).
generatePdfbooleanNoWhether to render a PDF during the run. Default true. Note: if emailTo is provided, a PDF is rendered even when generatePdf is false.
includePdfBase64booleanNoWhether to include the base64-encoded PDF in data.pdf.buffer. Default false.
pdfEnginestringNoPDF rendering engine: "puppeteer" or "pdfkit". Defaults to the template setting or "puppeteer".
scorebooleanNoWhether to calculate and attach verificationScore.
scoreProfilestringNoScoring profile identifier used when score is enabled. Max 64 characters.
rowIndexintegerNoZero-based row index (>= 0) used for PDF/HTML/scoring output. Default 0.
emailTostring[]NoArray of valid recipient email addresses (max 20) to deliver the report to.
emailSubjectstringNoCustom email subject line. Max 250 characters.
emailLanguagestringNoEmail template language: "en" or "es". Default "es".
webhookUrlstringNoPer-report http or https webhook override URL. Max 2048 characters.
externalRefIdstringNoCaller-supplied correlation ID (max 200 characters), echoed in the report and webhook payloads.
createdByChannelstringNoOrigin channel: "portal", "api", "mcp", "x402", or "webhook". Default "api".

Execution behavior and parameter rules​

  • Target resolution (systemKey vs batchConfigurationId): Provide either a preset systemKey or an existing batchConfigurationId. Unknown IDs or presets return 404 Not Found (batch_configuration_not_found, preset_not_found, or template_not_found). Configurations or presets without steps return 409 Conflict (preset_has_no_steps or batch_configuration_has_no_steps).
  • Account feature grants: Every step in the resolved preset or batch configuration is checked against your client account's active feature grants before execution. Unentitled steps fail with 409 Conflict (endpoints_not_in_account).
  • Sync deadline and automatic fallback: Synchronous runs wait up to 90000 ms (SYNC_DEADLINE_MS = 90s). If verification or rendering does not settle within 90 seconds, the API automatically returns 202 Accepted with mode: "async" and a pollUrl so your integration can poll Retrieve a Smart Report or wait for webhooks.
  • Email triggers PDF generation: Setting emailTo guarantees PDF generation for delivery even if you explicitly set generatePdf: false.

Request​

import axios from "axios";

const run = async () => {
const { data } = await axios.post(
"https://api.verifik.co/v2/smart-reports/run",
{
systemKey: "example-preset",
name: "Background Check - Applicant 42",
inputs: {
documentType: "CC",
documentNumber: "1032386359",
},
mode: "sync",
generatePdf: true,
includePdfBase64: false,
pdfEngine: "puppeteer",
score: true,
emailTo: ["compliance@example.com"],
emailLanguage: "en",
webhookUrl: "https://webhooks.example.com/verifik",
externalRefId: "applicant-42",
},
{
headers: {
"Content-Type": "application/json",
Authorization: `Bearer ${process.env.VERIFIK_JWT}`,
},
}
);

console.log(data);
};

run();

Response​

{
"data": {
"mode": "sync",
"report": {
"_id": "6801a2b3c4d5e6f7a8b9c0d1",
"name": "Background Check - Applicant 42",
"status": "sent",
"template": "6801a2b3c4d5e6f7a8b9c0d2",
"smartBatch": "6801a2b3c4d5e6f7a8b9c0d3",
"rowIndex": 0,
"externalRefId": "applicant-42",
"createdByChannel": "api",
"createdAt": "2026-11-24T20:00:00.000Z",
"updatedAt": "2026-11-24T20:00:04.000Z"
},
"batch": {
"_id": "6801a2b3c4d5e6f7a8b9c0d3",
"name": "Background Check - Applicant 42",
"status": "completed",
"batchConfiguration": "6801a2b3c4d5e6f7a8b9c0d4",
"totalRows": 1,
"completedRows": 1,
"failedRows": 0,
"partialRows": 0,
"creditsSpent": 2,
"rows": [
{
"rowIndex": 0,
"status": "completed",
"inputData": {
"documentType": "CC",
"documentNumber": "1032386359"
},
"results": {},
"errors": []
}
]
},
"verificationScore": {},
"pdf": {
"size": 148320,
"engine": "puppeteer",
"generationDurationMs": 1840,
"downloadUrl": "/v2/smart-reports/6801a2b3c4d5e6f7a8b9c0d1/download",
"htmlUrl": "/v2/smart-reports/6801a2b3c4d5e6f7a8b9c0d1/html"
},
"email": {
"success": true,
"recipients": ["compliance@example.com"],
"subject": "Verification Report",
"messageId": "<message-id@example.com>"
}
}
}

Error codes​

StatusError Code / TypeCause
401UnauthorizedMissing or invalid JWT in the Authorization header.
403ForbiddenShared x402 execution was attempted; supply your own per-client JWT.
404batch_configuration_not_foundThe specified batchConfigurationId does not exist for your client.
404preset_not_foundThe specified systemKey preset could not be resolved.
404template_not_foundThe specified templateId or configured report template was not found.
409MissingParameterJoi schema validation failed on one or more request fields.
409client_context_requiredThe JWT does not carry a valid authUser.clientId.
409missing_inputsNeither inputs nor rows was provided.
409max_rows_exceededMore than 500 rows/inputs were supplied.
409sync_row_limit_exceededmode: "sync" was requested with more than 5 rows.
409missing_required_inputsOne or more inputs required by the batch configuration schema are missing.
409preset_has_no_stepsThe resolved preset has no verification steps configured.
409batch_configuration_has_no_stepsThe target BatchConfiguration has no verification steps configured.
409endpoints_not_in_accountYour client account does not have feature grants for one or more configured steps.
409row_not_foundThe requested rowIndex does not exist in the batch.
409unknown_score_profileThe supplied scoreProfile is not recognized.
422UnprocessableEntityMongoose validation failure or duplicate key conflict.
500InternalServerErrorUnexpected server error during execution or rendering.

Webhooks & MCP Integration​

  • Webhooks: When webhookUrl is provided (or configured on the preset/BatchConfiguration), Verifik emits smart_batch_report_generated or smart_batch_report_generation_failed for report generation, and smart_batch_report_sent or smart_batch_report_delivery_failed when emailTo delivery runs. Your externalRefId is echoed in both the report document and webhook events. See Smart Reports Webhooks.
  • MCP Equivalent: AI agents connected via MCP can invoke the smart_report_run tool with the same headless parameters. See MCP and AI Agents.

Notes​

  • data.pdf is included only when generatePdf is true (or emailTo triggers PDF rendering); data.pdf.buffer is included only when includePdfBase64 is true.
  • data.email is included only when emailTo is supplied; if delivery fails, data.email.error contains the failure reason.
  • data.verificationScore is populated when score is enabled.