Skip to main content

Send Smart Report by Email

Deliver a SmartReport by email with attached PDF reports. You can let Verifik render the PDF for a single row (rowIndex) or all rows (sendAll: true, up to 50 rows), or supply pre-rendered printHtml, pdfBase64, or pdfFiles payloads.

Sending an email records emailDelivery on the SmartReport document and emits either smart_batch_report_sent on success or smart_batch_report_delivery_failed on delivery failure.

Endpoint​

POST https://api.verifik.co/v2/smart-reports/{id}/send-email

This endpoint accepts JSON payloads up to 64 MB. It is also reachable through the Smart-Agent proxy at https://ai.verifik.co/v2/smart-reports/{id}/send-email using your own per-client Authorization: Bearer <VERIFIK_JWT>. Shared x402 execution is blocked with 403 Forbidden.

Headers​

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

Parameters​

NameTypeRequiredDescription
idstringYesSmartReport ObjectId.

Body​

NameTypeRequiredDescription
recipientsstring[]YesArray of valid recipient email addresses (minimum 1).
subjectstringNoCustom email subject line.
languagestringNoEmail copy language: "en" or "es". Default "es".
rowIndexnumberNoZero-based row index to render and attach when sendAll is not enabled.
sendAllbooleanNoWhen true, sends up to 50 rows (MAX_SEND_ALL_ROWS), attaching 1 PDF per row when the batch has more than 1 row.
enginestringNoPDF rendering engine: "pdfkit" or "puppeteer".
printHtmlstringNoPre-rendered HTML string (max 64000000 characters) to convert and attach.
pdfBase64stringNoPre-rendered base64-encoded PDF string (max 64000000 characters) to attach directly.
pdfFilesobject[]NoArray of up to 200 attachment objects ({ filename, pdfBase64 }), where each filename (max 80 characters) and pdfBase64 (max 64000000 characters) are required.

Attachment and batch delivery rules​

  • sendAll cap: Sending all rows in a batch supports up to 50 rows (MAX_SEND_ALL_ROWS). Exceeding 50 rows fails with 409 Conflict (send_all_limit). When a batch contains more than 1 row, each row is attached as its own PDF file.
  • Pre-rendered payloads: Supply pdfFiles (up to 200 items), pdfBase64, or printHtml when your integration already rendered custom attachments. Corrupt PDF data returns 500 (invalid_pdf), and requests resolving to zero attachments return 409 Conflict (no_pdf_attachments).
  • Delivery outcome response: If the email transport fails after validation and PDF preparation succeed, the endpoint returns HTTP 200 OK with "success": false, "messageId": null, and an "error" field while recording emailDelivery and emitting smart_batch_report_delivery_failed.

Request​

import axios from "axios";

const run = async () => {
const id = "6801a2b3c4d5e6f7a8b9c0d1";
const { data } = await axios.post(
`https://api.verifik.co/v2/smart-reports/${id}/send-email`,
{
recipients: ["compliance@example.com"],
subject: "Background Verification Report - Applicant 42",
language: "en",
rowIndex: 0,
engine: "puppeteer",
},
{
headers: {
"Content-Type": "application/json",
Authorization: `Bearer ${process.env.VERIFIK_JWT}`,
},
}
);

console.log(data);
};

run();

Response​

{
"success": true,
"message": "Email sent successfully",
"recipients": ["compliance@example.com"],
"messageId": "<message-id@example.com>"
}

Error codes​

StatusError Code / TypeCause
401UnauthorizedMissing or invalid JWT.
403ForbiddenShared x402 execution was attempted; use your own per-client JWT.
404not_foundReport ID does not exist or belongs to another client.
404template_not_foundLinked template could not be found.
409MissingParameterJoi validation failed (for example, missing or invalid recipients).
409send_all_limitsendAll: true was requested on a batch with more than 50 rows (MAX_SEND_ALL_ROWS).
409no_pdf_attachmentsNo PDF attachments could be resolved or rendered for the request.
409row_not_foundThe requested rowIndex does not exist in the batch.
422UnprocessableEntityMongoose validation error.
500invalid_pdfSupplied pdfBase64 or pdfFiles payload is not a valid PDF.

Webhooks & MCP Integration​

  • Webhooks: Automatically emits smart_batch_report_sent when delivery succeeds or smart_batch_report_delivery_failed when delivery fails, and records emailDelivery on the SmartReport. See Smart Reports Webhooks.
  • MCP Equivalent: AI agents can send report emails via the smart_report_send_email MCP tool. See MCP and AI Agents.

Notes​

  • Always inspect success in the 200 OK body, because email transport errors return success: false with messageId: null and error rather than a non-200 status code.
  • If you want to run verification steps, generate PDFs, and send email in one call, use Run a Smart Report.