Skip to main content

템플릿 샘플 전송

저장된 Smart Report 템플릿({id})을 sampleData로 렌더링하고 생성된 PDF를 하나 이상의 recipients에게 직접 이메일로 전송합니다. 선택적으로 printHtml을 제공하여 HTML 생성을 건너뛰거나 pdfBase64를 제공해 사전 렌더링된 PDF 버퍼를 첨부할 수 있습니다.

헤드리스 CI/CD 파이프라인, 템플릿 승인 워크플로 및 AI 에이전트 자동화에서는 자체 이메일 인프라를 구축하지 않고도 준법 검토자나 제품 이해관계자에게 서식이 적용된 리포트 미리보기를 배포할 때 이 엔드포인트를 사용하세요. 임베디드 글꼴, 로고, 사전 렌더링된 HTML 또는 base64 PDF를 수용하기 위해 최대 64MB의 JSON 요청 본문이 허용됩니다.

엔드포인트​

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

Smart-Agent 프록시(https://ai.verifik.co)도 동일한 /v2/... 경로를 제공하며 본인의 Authorization: Bearer <VERIFIK_JWT> 헤더가 필요합니다.

헤더​

이름값
Content-Typeapplication/json
Acceptapplication/json
AuthorizationBearer <VERIFIK_JWT>

매개변수​

이름타입필수설명
idstring예Smart Report 템플릿 ObjectId.

요청 본문​

최대 64MB의 JSON 페이로드를 지원합니다.

이름타입필수설명
recipientsstring[]예유효한 수신자 이메일 주소 배열(최소 1개).
sampleDataobject예inputData, results, batchName, rowIndex를 포함하는 샘플 페이로드.
subjectstring아니요사용자 지정 이메일 제목. 기본값은 템플릿의 name을 사용하는 `Sample Report: <name>`입니다.
languagestring아니요이메일 본문 언어: "en" 또는 "es". 기본값은 "es"입니다.
printHtmlstring아니요템플릿 sections에서 렌더링하는 대신 PDF로 변환할 선택적 사전 렌더링 HTML 문서.
pdfBase64string아니요서버 측 PDF 생성 없이 직접 전송할 선택적 base64 인코딩 PDF 첨부 파일.

요청​

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();

응답​

{
"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
}
}

참고 사항​

  • 페이로드를 { "data": ... }로 감싸는 다른 템플릿 엔드포인트와 달리 send-sample은 최상위 수준에서 success, message, recipients, messageId 및 delivery 필드를 반환합니다.
  • language를 생략하면 이메일 기본값은 "es"입니다. 영어 이해관계자 알림을 위해서는 "en"을 전달하세요.
  • 이메일로 전송하는 대신 렌더링된 PDF를 로컬에 저장하려면 템플릿 샘플 다운로드를 사용하세요.

관련 문서​