Smart Batch 생성
기존 BatchConfiguration에 연결된 SmartBatch를 생성합니다. 표시용 name과 rows에 최소 하나의 입력 행을 제공하세요. 배치를 생성하면 입력 행이 status: "draft" 상태로 저장되며, 실행이 시작될 때까지 카탈로그 단계를 실행하거나 크레딧을 소비하지 않습니다.
rows의 각 항목은 래핑된 객체({ rowIndex?, inputData }) 또는 평면 객체({ rowIndex?, ...inputFields }) 중 하나를 허용하며, 검증 계층이 이를 { rowIndex, inputData }로 정규화합니다. 생성 시 status, results 또는 errors를 포함하지 마세요.
엔드포인트
POST https://api.verifik.co/v2/smart-batches
클라이언트별 Authorization: Bearer <VERIFIK_JWT>를 사용하여 Smart-Agent 프록시(https://ai.verifik.co/v2/smart-batches)를 통해서도 호출할 수 있습니다. 공유 x402 실행은 403 Forbidden으로 차단됩니다.
헤더
| 이름 | 값 | 설명 |
|---|---|---|
Content-Type | application/json | 요청 페이로드 형식. |
Authorization | Bearer <VERIFIK_JWT> | 클라이언트 범위 JWT (authUser.clientId). |
본문
| 이름 | 타입 | 필수 | 설명 |
|---|---|---|---|
batchConfiguration | string | 예 | 워크플로우 단계를 정의하는 BatchConfiguration ObjectId. |
name | string | 예 | 배치 표시 이름. 최대 150자. |
executor | string | 아니요 | 실행 모드: "queue", "featureRunner" 또는 "browser". batchConfiguration에서 파생될 때는 "queue" 또는 "browser"로 정규화됩니다. |
source | string | 아니요 | 원본 제품 식별자: "smart_batch"(기본값) 또는 "smart_fleet". |
rows | object[] | 예 | 최소 1개의 행 배열(min 1). 래핑된 { rowIndex?, inputData } 또는 평면 { rowIndex?, ...inputFields } 형식을 허용합니다. 생성 시 status, results 또는 errors를 전송하지 마세요. |
알 수 없는 키와 허용되지 않는 행 속성(status, results, errors)은 Joi 검증에 의해 409 MissingParameter로 거부됩니다.
요청
- Node.js
- PHP
- Python
- Go
- cURL
import axios from "axios";
const run = async () => {
const { data } = await axios.post(
"https://api.verifik.co/v2/smart-batches",
{
batchConfiguration: "6801a2b3c4d5e6f7a8b9c0d4",
name: "Colombia Onboarding — November",
source: "smart_batch",
rows: [
{
rowIndex: 0,
inputData: {
documentType: "CC",
documentNumber: "1032386359",
},
},
{
documentType: "CC",
documentNumber: "1007463534",
},
],
},
{
headers: {
"Content-Type": "application/json",
Authorization: `Bearer ${process.env.VERIFIK_JWT}`,
},
}
);
console.log(data);
};
run();
<?php
$payload = [
"batchConfiguration" => "6801a2b3c4d5e6f7a8b9c0d4",
"name" => "Colombia Onboarding — November",
"source" => "smart_batch",
"rows" => [
[
"rowIndex" => 0,
"inputData" => [
"documentType" => "CC",
"documentNumber" => "1032386359",
],
],
[
"documentType" => "CC",
"documentNumber" => "1007463534",
],
],
];
$ch = curl_init("https://api.verifik.co/v2/smart-batches");
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($payload));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($ch);
curl_close($ch);
echo $response;
import os
import requests
url = "https://api.verifik.co/v2/smart-batches"
headers = {
"Content-Type": "application/json",
"Authorization": f"Bearer {os.getenv('VERIFIK_JWT')}",
}
payload = {
"batchConfiguration": "6801a2b3c4d5e6f7a8b9c0d4",
"name": "Colombia Onboarding — November",
"source": "smart_batch",
"rows": [
{
"rowIndex": 0,
"inputData": {
"documentType": "CC",
"documentNumber": "1032386359",
},
},
{
"documentType": "CC",
"documentNumber": "1007463534",
},
],
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
package main
import (
"bytes"
"encoding/json"
"fmt"
"net/http"
"os"
)
func main() {
body, _ := json.Marshal(map[string]interface{}{
"batchConfiguration": "6801a2b3c4d5e6f7a8b9c0d4",
"name": "Colombia Onboarding — November",
"source": "smart_batch",
"rows": []map[string]interface{}{
{
"rowIndex": 0,
"inputData": map[string]string{
"documentType": "CC",
"documentNumber": "1032386359",
},
},
{
"documentType": "CC",
"documentNumber": "1007463534",
},
},
})
req, _ := http.NewRequest("POST", "https://api.verifik.co/v2/smart-batches", 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-batches" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $VERIFIK_JWT" \
-d '{
"batchConfiguration": "6801a2b3c4d5e6f7a8b9c0d4",
"name": "Colombia Onboarding — November",
"source": "smart_batch",
"rows": [
{
"rowIndex": 0,
"inputData": {
"documentType": "CC",
"documentNumber": "1032386359"
}
},
{
"documentType": "CC",
"documentNumber": "1007463534"
}
]
}'
응답
- 200 OK
- 401
- 403
- 409
- 422
{
"data": {
"_id": "6801a2b3c4d5e6f7a8b9c0d3",
"batchConfiguration": "6801a2b3c4d5e6f7a8b9c0d4",
"client": "507f1f77bcf86cd799439013",
"name": "Colombia Onboarding — November",
"status": "draft",
"executor": "browser",
"source": "smart_batch",
"headlessRun": false,
"creditsSpent": 0,
"rows": [
{
"rowIndex": 0,
"inputData": {
"documentType": "CC",
"documentNumber": "1032386359"
},
"status": "pending",
"results": {},
"errors": [],
"creditsSpent": 0,
"attemptCount": 0,
"attempts": []
},
{
"rowIndex": 1,
"inputData": {
"documentType": "CC",
"documentNumber": "1007463534"
},
"status": "pending",
"results": {},
"errors": [],
"creditsSpent": 0,
"attemptCount": 0,
"attempts": []
}
],
"totalRows": 2,
"completedRows": 0,
"failedRows": 0,
"partialRows": 0,
"createdAt": "2026-11-24T20:00:00.000Z",
"updatedAt": "2026-11-24T20:00:00.000Z"
}
}
{
"message": "Unauthorized",
"code": "Unauthorized"
}
{
"message": "Shared x402 execution is forbidden on this endpoint",
"code": "Forbidden"
}
{
"message": "\"rows[0].status\" is not allowed",
"code": "MissingParameter"
}
{
"message": "UnprocessableEntity",
"code": "UnprocessableEntity"
}
참고
- 배치를 생성할 때
rows내부에status,results또는errors를 절대 전달하지 마세요. 새로 생성된 행은 항상pending상태로 시작합니다. executor가 생략되면batchConfiguration.executor에서 확인되어"queue"또는"browser"로 정규화됩니다.- 생성 후에는 Smart Batch 비용 추정을 호출하여 예상 크레딧 요금을 미리 확인하고 Smart Batch 시작으로 처리를 시작하세요.
- 종속성 검증 및 선택적 즉시 실행을 지원하는 대량 CSV, XLSX 또는 JSONL 가져오기의 경우 파일에서 Smart Batch 생성을 사용하세요.