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
| Name | Value | Description |
|---|---|---|
Content-Type | application/json | Request payload format (64 MB limit). |
Authorization | Bearer <VERIFIK_JWT> | Client-scoped JWT (authUser.clientId). |
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
id | string | Yes | SmartReport ObjectId. |
Body
| Name | Type | Required | Description |
|---|---|---|---|
recipients | string[] | Yes | Array of valid recipient email addresses (minimum 1). |
subject | string | No | Custom email subject line. |
language | string | No | Email copy language: "en" or "es". Default "es". |
rowIndex | number | No | Zero-based row index to render and attach when sendAll is not enabled. |
sendAll | boolean | No | When true, sends up to 50 rows (MAX_SEND_ALL_ROWS), attaching 1 PDF per row when the batch has more than 1 row. |
engine | string | No | PDF rendering engine: "pdfkit" or "puppeteer". |
printHtml | string | No | Pre-rendered HTML string (max 64000000 characters) to convert and attach. |
pdfBase64 | string | No | Pre-rendered base64-encoded PDF string (max 64000000 characters) to attach directly. |
pdfFiles | object[] | No | Array 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
sendAllcap: Sending all rows in a batch supports up to50rows (MAX_SEND_ALL_ROWS). Exceeding 50 rows fails with409 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 to200items),pdfBase64, orprintHtmlwhen your integration already rendered custom attachments. Corrupt PDF data returns500(invalid_pdf), and requests resolving to zero attachments return409 Conflict(no_pdf_attachments). - Delivery outcome response: If the email transport fails after validation and PDF preparation succeed, the endpoint returns HTTP
200 OKwith"success": false,"messageId": null, and an"error"field while recordingemailDeliveryand emittingsmart_batch_report_delivery_failed.
Request
- Node.js
- PHP
- Python
- Go
- cURL
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();
<?php
$id = "6801a2b3c4d5e6f7a8b9c0d1";
$ch = curl_init("https://api.verifik.co/v2/smart-reports/" . $id . "/send-email");
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, [
"Content-Type: application/json",
"Authorization: Bearer " . getenv("VERIFIK_JWT"),
]);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode([
"recipients" => ["compliance@example.com"],
"subject" => "Background Verification Report - Applicant 42",
"language" => "en",
"rowIndex" => 0,
"engine" => "puppeteer",
]));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($ch);
curl_close($ch);
echo $response;
import os
import requests
report_id = "6801a2b3c4d5e6f7a8b9c0d1"
url = f"https://api.verifik.co/v2/smart-reports/{report_id}/send-email"
headers = {
"Content-Type": "application/json",
"Authorization": f"Bearer {os.getenv('VERIFIK_JWT')}",
}
payload = {
"recipients": ["compliance@example.com"],
"subject": "Background Verification Report - Applicant 42",
"language": "en",
"rowIndex": 0,
"engine": "puppeteer",
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
package main
import (
"bytes"
"encoding/json"
"fmt"
"net/http"
"os"
)
func main() {
id := "6801a2b3c4d5e6f7a8b9c0d1"
body, _ := json.Marshal(map[string]interface{}{
"recipients": []string{"compliance@example.com"},
"subject": "Background Verification Report - Applicant 42",
"language": "en",
"rowIndex": 0,
"engine": "puppeteer",
})
req, _ := http.NewRequest("POST", "https://api.verifik.co/v2/smart-reports/"+id+"/send-email", bytes.NewReader(body))
req.Header.Set("Content-Type", "application/json")
req.Header.Set("Authorization", "Bearer "+os.Getenv("VERIFIK_JWT"))
resp, _ := http.DefaultClient.Do(req)
defer resp.Body.Close()
var out map[string]interface{}
json.NewDecoder(resp.Body).Decode(&out)
fmt.Println(out)
}
curl -X POST "https://api.verifik.co/v2/smart-reports/6801a2b3c4d5e6f7a8b9c0d1/send-email" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $VERIFIK_JWT" \
-d '{
"recipients": ["compliance@example.com"],
"subject": "Background Verification Report - Applicant 42",
"language": "en",
"rowIndex": 0,
"engine": "puppeteer"
}'
Response
- 200 OK (Sent)
- 200 OK (Delivery Failed)
- 401
- 403
- 404
- 409
- 422
- 500
{
"success": true,
"message": "Email sent successfully",
"recipients": ["compliance@example.com"],
"messageId": "<message-id@example.com>"
}
{
"success": false,
"message": "Failed to send email",
"recipients": ["compliance@example.com"],
"messageId": null,
"error": "SMTP transport rejected recipient"
}
{
"message": "Unauthorized",
"code": "Unauthorized"
}
{
"message": "Shared x402 execution is forbidden on this endpoint",
"code": "Forbidden"
}
{
"message": "not_found",
"code": "NotFound"
}
{
"message": "send_all_limit",
"code": "send_all_limit"
}
{
"message": "UnprocessableEntity",
"code": "UnprocessableEntity"
}
{
"message": "invalid_pdf",
"code": "invalid_pdf"
}
Error codes
| Status | Error Code / Type | Cause |
|---|---|---|
401 | Unauthorized | Missing or invalid JWT. |
403 | Forbidden | Shared x402 execution was attempted; use your own per-client JWT. |
404 | not_found | Report ID does not exist or belongs to another client. |
404 | template_not_found | Linked template could not be found. |
409 | MissingParameter | Joi validation failed (for example, missing or invalid recipients). |
409 | send_all_limit | sendAll: true was requested on a batch with more than 50 rows (MAX_SEND_ALL_ROWS). |
409 | no_pdf_attachments | No PDF attachments could be resolved or rendered for the request. |
409 | row_not_found | The requested rowIndex does not exist in the batch. |
422 | UnprocessableEntity | Mongoose validation error. |
500 | invalid_pdf | Supplied pdfBase64 or pdfFiles payload is not a valid PDF. |
Webhooks & MCP Integration
- Webhooks: Automatically emits
smart_batch_report_sentwhen delivery succeeds orsmart_batch_report_delivery_failedwhen delivery fails, and recordsemailDeliveryon theSmartReport. See Smart Reports Webhooks. - MCP Equivalent: AI agents can send report emails via the
smart_report_send_emailMCP tool. See MCP and AI Agents.
Notes
- Always inspect
successin the200 OKbody, because email transport errors returnsuccess: falsewithmessageId: nullanderrorrather 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.