Skip to main content

파일에서 Smart Batch 생성

CSV, XLSX 또는 JSONL 페이로드를 새 SmartBatch로 수집(ingest)합니다. 서버는 원시 텍스트 또는 base64 데이터 URL을 디코딩하고, MAX_ROWS(기본값 20000)를 적용하며, BatchConfiguration 단계 종속성을 기준으로 열 헤더와 camelCase 별칭을 해석하고, 크레딧 비용 추정치를 계산합니다.

수락된 행은 pending 상태로 배치에 저장되며, 형식이 잘못된 행은 rejectedRows에 반환됩니다. 계정 엔드포인트 권한을 확인하고 즉시 처리를 시작하려면 autoStart: true를 전달하세요. 그렇지 않으면 검사가 실행되지 않으며 크레딧이 소비되지 않습니다.

엔드포인트​

POST https://api.verifik.co/v2/smart-batches/from-file

클라이언트별 Authorization: Bearer <VERIFIK_JWT>를 사용하여 Smart-Agent 프록시(https://ai.verifik.co/v2/smart-batches/from-file)를 통해서도 호출할 수 있습니다. 공유 x402 실행은 403 Forbidden으로 차단됩니다.

헤더​

이름값설명
Content-Typeapplication/json요청 페이로드 형식.
AuthorizationBearer <VERIFIK_JWT>클라이언트 범위 JWT (authUser.clientId).

본문​

이름타입필수설명
batchConfigurationstring예인증된 클라이언트가 소유한 BatchConfiguration ObjectId.
namestring예배치 표시 이름. 최대 150자.
contentstring예원시 CSV/JSONL 텍스트 또는 base64 데이터 URL (data:<mime>;base64,<payload>).
formatstring아니요입력 형식: "csv", "xlsx" 또는 "jsonl". 기본값은 batchConfiguration.inputFormat 또는 "csv"입니다.
autoStartboolean아니요수집 직후 생성된 배치를 즉시 시작하려면 true로 설정합니다.

알 수 없는 본문 키는 Joi 검증에 의해 409 MissingParameter로 거부됩니다.

요청​

import axios from "axios";

const run = async () => {
const { data } = await axios.post(
"https://api.verifik.co/v2/smart-batches/from-file",
{
batchConfiguration: "6801a2b3c4d5e6f7a8b9c0d4",
name: "November CSV Import",
format: "csv",
content: "Document Type,Document Number\nCC,1032386359\nCC,1007463534\n",
autoStart: false,
},
{
headers: {
"Content-Type": "application/json",
Authorization: `Bearer ${process.env.VERIFIK_JWT}`,
},
}
);

console.log(data);
};

run();

응답​

{
"data": {
"batch": {
"_id": "6801a2b3c4d5e6f7a8b9c0d3",
"batchConfiguration": "6801a2b3c4d5e6f7a8b9c0d4",
"client": "507f1f77bcf86cd799439013",
"name": "November CSV Import",
"status": "pending",
"executor": "browser",
"source": "smart_batch",
"headlessRun": false,
"creditsSpent": 0,
"rows": [
{
"rowIndex": 0,
"inputData": {
"Document Type": "CC",
"documentType": "CC",
"Document Number": "1032386359",
"documentNumber": "1032386359"
},
"status": "pending",
"results": {},
"errors": []
},
{
"rowIndex": 1,
"inputData": {
"Document Type": "CC",
"documentType": "CC",
"Document Number": "1007463534",
"documentNumber": "1007463534"
},
"status": "pending",
"results": {},
"errors": []
}
],
"totalRows": 2,
"completedRows": 0,
"failedRows": 0,
"partialRows": 0,
"createdAt": "2026-11-24T20:05:00.000Z",
"updatedAt": "2026-11-24T20:05:00.000Z"
},
"columns": [
"Document Type",
"documentType",
"Document Number",
"documentNumber"
],
"accepted": 2,
"rejected": 0,
"rejectedRows": [],
"estimate": {
"itemCount": 2,
"creditsPerItem": 0.04,
"totalCredits": 0.08,
"breakdown": [
{
"sequence": 1,
"featureCode": "co-cedula",
"price": 0.04,
"total": 0.08
}
]
}
}
}

참고​

  • 파일 파싱은 MAX_ROWS(기본값 20000)를 적용하며, Document Number 같은 열이 documentNumber로 해석되도록 camelCase 헤더 별칭을 자동으로 생성합니다.
  • .xlsx 통합 문서의 경우 format: "xlsx"와 함께 base64 데이터 URL(data:application/vnd.openxmlformats-officedocument.spreadsheetml.sheet;base64,<payload>)을 전달하세요.
  • 409 Conflict 오류에는 batch_file_has_no_sheets, batch_file_is_empty, batch_file_has_no_rows, batch_file_has_no_usable_rows, batch_jsonl_parse_failed_on_line_<N>, batch_configuration_has_no_steps 및 endpoints_not_in_account가 포함됩니다.
  • 유효하지 않은 행 검증(0개의 유효한 행), 지원되지 않는 형식 오류 및 MAX_ROWS 임계값 오류는 HTTP 500을 반환합니다.

관련​