Skip to main content

Send template sample

Render a saved Smart Report template ({id}) with sampleData and email the resulting PDF directly to one or more recipients. Optionally supply printHtml to bypass HTML generation or pdfBase64 to attach a pre-rendered PDF buffer.

In headless CI/CD pipelines, template approval workflows, and AI agent automations, use this endpoint to distribute formatted report previews to compliance reviewers or product stakeholders without standing up your own email infrastructure. JSON request bodies up to 64MB are accepted to accommodate embedded fonts, logos, pre-rendered HTML, or base64 PDFs.

Endpoint​

POST https://api.verifik.co/v2/smart-report-templates/{id}/send-sample

The Smart-Agent proxy (https://ai.verifik.co) exposes the same /v2/... paths and requires your own Authorization: Bearer <VERIFIK_JWT> header.

Headers​

NameValue
Content-Typeapplication/json
Acceptapplication/json
AuthorizationBearer <VERIFIK_JWT>

Parameters​

NameTypeRequiredDescription
idstringYesSmart Report template ObjectId.

Body​

Supports JSON payloads up to 64MB.

NameTypeRequiredDescription
recipientsstring[]YesArray of valid recipient email addresses (minimum 1).
sampleDataobjectYesSample payload containing inputData, results, batchName, and rowIndex.
subjectstringNoCustom email subject line. Defaults to `Sample Report: <name>` using the template's name.
languagestringNoEmail copy language: "en" or "es". Defaults to "es".
printHtmlstringNoOptional pre-rendered HTML document to convert to PDF instead of rendering from template sections.
pdfBase64stringNoOptional base64-encoded PDF attachment to send directly without server-side PDF generation.

Request​

const fetch = require("node-fetch");

async function run() {
const id = "67c1f94b2d8a1c0012a4b301";
const res = await fetch(
`https://api.verifik.co/v2/smart-report-templates/${id}/send-sample`,
{
method: "POST",
headers: {
"Content-Type": "application/json",
Accept: "application/json",
Authorization: `Bearer ${process.env.VERIFIK_JWT}`,
},
body: JSON.stringify({
recipients: ["compliance@acme.example"],
subject: "Sample Report: Colombia Driver Onboarding",
language: "en",
sampleData: {
batchName: "Driver Onboarding Sample",
rowIndex: 0,
inputData: {
documentType: "CC",
documentNumber: "1020304050",
},
results: {
identity: {
fullName: "Mateo Rojas",
status: "active",
},
},
},
}),
}
);

console.log(await res.json());
}

run();

Response​

{
"success": true,
"message": "Sample email sent successfully",
"recipients": ["compliance@acme.example"],
"messageId": "<a1b2c3d4-5678-90ef-1234-567890abcdef@verifik.co>",
"delivery": {
"sentAt": "2026-09-10T04:15:22.000Z",
"recipients": ["compliance@acme.example"],
"subject": "Sample Report: Colombia Driver Onboarding",
"status": "sent",
"messageId": "<a1b2c3d4-5678-90ef-1234-567890abcdef@verifik.co>",
"errorMessage": null
}
}

Notes​

  • Unlike other template endpoints that wrap payloads in { "data": ... }, send-sample returns top-level success, message, recipients, messageId, and delivery fields.
  • If language is omitted, the email defaults to "es". Pass "en" for English stakeholder notifications.
  • To save the rendered PDF locally instead of emailing it, use Download template sample.