Skip to main content

리포트 템플릿 생성

인증된 클라이언트가 소유하는 사용자 지정 Smart Report 템플릿을 생성합니다. name만 필수이며, 모든 브랜딩, 레이아웃 sections, reportTheme, sampleData 및 PDF 엔진 옵션은 선택 사항이고 나중에 리포트 템플릿 수정으로 업데이트할 수 있습니다.

헤드리스 및 AI 기반 파이프라인에서는 템플릿 레이아웃 생성으로 만든 레이아웃을 저장하거나, 테마 스타터 목록 조회의 기본 제공 스타터를 복제·브랜딩하거나, 코드에서 SmartBatch 파이프라인용 환경별 PDF 템플릿을 프로비저닝할 때 이 엔드포인트를 사용하세요. 템플릿을 저장하면 백그라운드에서 비동기 썸네일 생성이 트리거되며 { "data": ... }에 생성된 문서를 담아 HTTP 200(201이 아님)을 반환합니다.

엔드포인트​

POST https://api.verifik.co/v2/smart-report-templates

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

헤더​

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

요청 본문​

이름타입필수설명
namestring예템플릿 표시 이름. 최대 150자.
descriptionstring아니요사람이 읽을 수 있는 템플릿 설명. 최대 500자.
batchConfigurationstring아니요연결된 SmartBatch 구성의 ObjectId.
countrystring아니요국가 식별자 또는 라벨. 최대 60자.
categorystring아니요검증 도메인: "citizen", "company" 또는 "vehicle".
isActiveboolean아니요템플릿 활성 상태 여부. 기본값은 true입니다.
logostring아니요브랜드 로고 URL 또는 base64 데이터 URI.
primaryColorstring아니요기본 브랜드 강조 16진수(hex) 색상. 기본값은 "#4F46E5"입니다.
identityColorstring아니요보조/신원 강조 16진수(hex) 색상. 기본값은 "#000000"입니다.
pageBackgroundColorstring아니요페이지 배경 16진수(hex) 색상. 기본값은 "#ffffff"입니다.
headerobject아니요사용자 지정 머리글 레이아웃 및 콘텐츠 구성.
footerobject아니요사용자 지정 바닥글 레이아웃 및 콘텐츠 구성.
legendstring아니요바닥글 범례 또는 준법 고지 문구. 최대 2000자.
legendPositionstring아니요범례 정렬: "left", "center" 또는 "right".
termsAndConditionsstring아니요법적 이용 약관 텍스트. 최대 4000자.
termsPositionstring아니요약관 정렬: "left", "center" 또는 "right".
sectionsobject[]아니요콘텐츠 블록과 데이터 바인딩을 정의하는 정렬된 ReportSection 객체 배열(ReportSection 속성 참조).
pageSizestring아니요PDF 용지 크기: "A4", "Letter" 또는 "Legal". 기본값은 "A4"입니다.
layoutVersioninteger아니요레이아웃 렌더러 버전: 1 또는 2.
orientationstring아니요페이지 방향: "portrait" 또는 "landscape". 기본값은 "portrait"입니다.
marginsobject아니요여백 객체 `{ "top": 40, "right": 40, "bottom": 40, "left": 40 }`. 네 면 모두 기본값은 40입니다.
pdfEnginestring아니요PDF 렌더링 엔진: "puppeteer" 또는 "pdfkit". 기본값은 "puppeteer"입니다.
showPageNumbersboolean아니요렌더링된 PDF에 페이지 번호 표시 여부.
pageNumberPositionstring아니요페이지 번호 위치: "top-left", "top-center", "top-right", "bottom-left", "bottom-center" 또는 "bottom-right".
pageNumberDividerboolean / string아니요페이지 번호 구분선 구성.
watermarkobject아니요워터마크 오버레이 설정.
securityobject아니요PDF 암호화 설정 `{ "enabled": true, "password": "..." }`.
signatureobject아니요서명 블록 구성.
logoSettingsobject아니요로고 크기 및 배치 구성.
sheetImagesobject[]아니요템플릿에 내장된 이미지 자산. 최대 12개.
customFontsobject[]아니요사용자 지정 글꼴 선언(Google Fonts, 외부 URL 또는 업로드된 파일). 최대 6개.
headerLogosobject[]아니요머리글에 표시되는 추가 로고. 최대 16개.
bodyTopPaddingnumber아니요문서 본문에 적용할 상단 여백(0~600).
sampleDataobject아니요미리보기 및 샘플 다운로드의 폴백 데이터 세트로 사용되는 샘플 검증 페이로드(inputData, results, batchName, rowIndex).
endpointDesignobject아니요엔드포인트별 프레젠테이션 메타데이터.
reportThemestring / object아니요테마 프리셋 ID("premium_dark", "light_cards", "editorial", "dashboard") 또는 전체 테마 구성 객체(테마 구성 참조).

ReportSection 속성​

sections의 각 요소는 리포트 내 하나의 블록을 설명합니다. 주요 속성에는 id, type, order, dataPath, label, staticContent, columns, columnsPerRow, keyOverrides, valueRules, chartKind, style, condition, frame이 포함됩니다.

지원되는 type 값은 다음과 같습니다.

  • 핵심 레이아웃: header, text, table, field, image, divider, spacer, shape
  • 구조화 블록: dataTable, card, badge, keyValueGrid, repeater, reportBlocks, themeBlock
  • 테마 검증 블록: coverPage, scoreGauge, categoryBreakdown, checkTable, findings, sources, sourceCards

테마 구성​

reportTheme은 프리셋 문자열("premium_dark", "light_cards", "editorial", "dashboard") 또는 다음 필드를 포함하는 객체를 허용합니다.

{ id, scoreScale, scoreEnabled, scoreProfile, locale, density, eyebrow, coverTitle, headlines, legalNote, showVerifiedBadge, showWeights, showDeductions, showFields, showHowItWorks, blocks, tokens }

템플릿 HTML 미리보기에서 테스트한 페이로드를 마이그레이션할 때는 최상위 미리보기 도우미(scoreScale, themeTokens, scoreSettings)를 저장하기 전에 reportTheme(reportTheme.scoreScale, reportTheme.tokens, reportTheme.scoreEnabled, reportTheme.scoreProfile) 내부로 옮기세요.

요청​

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

async function run() {
const res = await fetch("https://api.verifik.co/v2/smart-report-templates", {
method: "POST",
headers: {
"Content-Type": "application/json",
Accept: "application/json",
Authorization: `Bearer ${process.env.VERIFIK_JWT}`,
},
body: JSON.stringify({
name: "Colombia Driver Onboarding Report",
description: "Themed driver verification report for fleet onboarding",
country: "CO",
category: "citizen",
isActive: true,
pageSize: "A4",
layoutVersion: 2,
orientation: "portrait",
margins: { top: 40, right: 40, bottom: 40, left: 40 },
pdfEngine: "puppeteer",
primaryColor: "#4F46E5",
identityColor: "#111827",
pageBackgroundColor: "#ffffff",
showPageNumbers: true,
pageNumberPosition: "bottom-right",
reportTheme: {
id: "light_cards",
scoreEnabled: true,
scoreProfile: "cabify_driver",
scoreScale: "percent",
locale: "en",
showVerifiedBadge: true,
},
sections: [
{
id: "sec-header",
type: "header",
order: 0,
label: "Driver Verification Report",
},
{
id: "sec-score",
type: "scoreGauge",
order: 1,
label: "Verification Score",
},
{
id: "sec-subject",
type: "keyValueGrid",
order: 2,
label: "Subject Details",
dataPath: "inputData",
columnsPerRow: 2,
},
],
}),
});

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

run();

응답​

{
"data": {
"_id": "67c1f94b2d8a1c0012a4b301",
"client": "507f1f77bcf86cd799439013",
"name": "Colombia Driver Onboarding Report",
"description": "Themed driver verification report for fleet onboarding",
"country": "CO",
"category": "citizen",
"isActive": true,
"pageSize": "A4",
"layoutVersion": 2,
"orientation": "portrait",
"margins": {
"top": 40,
"right": 40,
"bottom": 40,
"left": 40
},
"pdfEngine": "puppeteer",
"primaryColor": "#4F46E5",
"identityColor": "#111827",
"pageBackgroundColor": "#ffffff",
"showPageNumbers": true,
"pageNumberPosition": "bottom-right",
"reportTheme": {
"id": "light_cards",
"scoreEnabled": true,
"scoreProfile": "cabify_driver",
"scoreScale": "percent",
"locale": "en",
"showVerifiedBadge": true
},
"sections": [
{
"id": "sec-header",
"type": "header",
"order": 0,
"label": "Driver Verification Report"
},
{
"id": "sec-score",
"type": "scoreGauge",
"order": 1,
"label": "Verification Score"
},
{
"id": "sec-subject",
"type": "keyValueGrid",
"order": 2,
"label": "Subject Details",
"dataPath": "inputData",
"columnsPerRow": 2
}
],
"createdAt": "2026-09-10T03:32:00.000Z",
"updatedAt": "2026-09-10T03:32:00.000Z"
}
}

참고 사항​

  • 생성에 성공하면 HTTP 200(201이 아님)을 반환하며 백그라운드에서 비동기 썸네일 생성을 트리거합니다.
  • 템플릿 HTML 미리보기에서 사용하는 최상위 미리보기 도우미(scoreScale, themeTokens, scoreSettings)는 최상위 템플릿 필드로 저장되지 않습니다. 템플릿을 영구 저장할 때는 reportTheme(scoreScale, tokens, scoreEnabled/scoreProfile) 내부에 배치하세요.
  • 반환된 _id를 저장하여 샘플 PDF 렌더링, 이해관계자 미리보기 전송 또는 자동화된 SmartBatch 작업에 템플릿을 연결하는 데 사용하세요.

관련 문서​