Smart Batch 수정
인증된 클라이언트가 소유한 기존 SmartBatch의 필드를 수정합니다. name, status, executor를 수정하거나 rows를 교체할 수 있습니다. rows를 제공하면 서버는 totalRows, completedRows, failedRows, partialRows를 다시 계산하고 외부 행 스냅샷을 동기화합니다.
배치를 "paused" 상태로 전환하려면 전용 Smart Batch 일시 중지 엔드포인트를 사용하세요. executor 변경은 배치가 현재 "draft", "pending" 또는 "cancelled" 상태일 때만 적용됩니다.
엔드포인트
PUT https://api.verifik.co/v2/smart-batches/{id}
클라이언트별 Authorization: Bearer <VERIFIK_JWT>를 사용하여 Smart-Agent 프록시(https://ai.verifik.co/v2/smart-batches/{id})를 통해서도 호출할 수 있습니다. 공유 x402 실행은 403 Forbidden으로 차단됩니다.
헤더
| 이름 | 값 | 설명 |
|---|---|---|
Content-Type | application/json | 요청 페이로드 형식. |
Authorization | Bearer <VERIFIK_JWT> | 클라이언트 범위 JWT (authUser.clientId). |
매개변수
| 이름 | 타입 | 필수 | 설명 |
|---|---|---|---|
id | string | 예 | 수정할 SmartBatch ObjectId. |
본문
| 이름 | 타입 | 필수 | 설명 |
|---|---|---|---|
name | string | 아니요 | 수정된 배치 표시 이름. 최대 150자. |
status | string | 아니요 | 허용 값: "draft", "pending", "processing", "completed", "failed" 또는 "cancelled". "paused" 상태로 변경하려면 POST /v2/smart-batches/{id}/pause를 사용하세요. |
executor | string | 아니요 | 허용 값: "queue", "featureRunner" 또는 "browser". 현재 배치 상태가 "draft", "pending" 또는 "cancelled"일 때만 적용됩니다. |
rows | object[] | 아니요 | 교체할 행 목록. 래핑된 형식에는 rowIndex와 inputData가 필요하며 선택적으로 status, results, errors, processedAt을 허용합니다. 평면 행은 자동으로 정규화됩니다. |
알 수 없는 본문 키는 Joi 검증에 의해 409 MissingParameter로 거부됩니다.
요청
- Node.js
- PHP
- Python
- Go
- cURL
import axios from "axios";
const run = async () => {
const batchId = "6801a2b3c4d5e6f7a8b9c0d3";
const { data } = await axios.put(
`https://api.verifik.co/v2/smart-batches/${batchId}`,
{
name: "Colombia Onboarding — Updated",
executor: "queue",
rows: [
{
rowIndex: 0,
inputData: {
documentType: "CC",
documentNumber: "1032386359",
},
status: "pending",
},
],
},
{
headers: {
"Content-Type": "application/json",
Authorization: `Bearer ${process.env.VERIFIK_JWT}`,
},
}
);
console.log(data);
};
run();
<?php
$batchId = "6801a2b3c4d5e6f7a8b9c0d3";
$payload = [
"name" => "Colombia Onboarding — Updated",
"executor" => "queue",
"rows" => [
[
"rowIndex" => 0,
"inputData" => [
"documentType" => "CC",
"documentNumber" => "1032386359",
],
"status" => "pending",
],
],
];
$ch = curl_init("https://api.verifik.co/v2/smart-batches/" . $batchId);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "PUT");
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
batch_id = "6801a2b3c4d5e6f7a8b9c0d3"
url = f"https://api.verifik.co/v2/smart-batches/{batch_id}"
headers = {
"Content-Type": "application/json",
"Authorization": f"Bearer {os.getenv('VERIFIK_JWT')}",
}
payload = {
"name": "Colombia Onboarding — Updated",
"executor": "queue",
"rows": [
{
"rowIndex": 0,
"inputData": {
"documentType": "CC",
"documentNumber": "1032386359",
},
"status": "pending",
}
],
}
response = requests.put(url, json=payload, headers=headers)
print(response.json())
package main
import (
"bytes"
"encoding/json"
"fmt"
"net/http"
"os"
)
func main() {
batchID := "6801a2b3c4d5e6f7a8b9c0d3"
body, _ := json.Marshal(map[string]interface{}{
"name": "Colombia Onboarding — Updated",
"executor": "queue",
"rows": []map[string]interface{}{
{
"rowIndex": 0,
"inputData": map[string]string{
"documentType": "CC",
"documentNumber": "1032386359",
},
"status": "pending",
},
},
})
req, _ := http.NewRequest("PUT", "https://api.verifik.co/v2/smart-batches/"+batchID, 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 PUT "https://api.verifik.co/v2/smart-batches/6801a2b3c4d5e6f7a8b9c0d3" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $VERIFIK_JWT" \
-d '{
"name": "Colombia Onboarding — Updated",
"executor": "queue",
"rows": [
{
"rowIndex": 0,
"inputData": {
"documentType": "CC",
"documentNumber": "1032386359"
},
"status": "pending"
}
]
}'
응답
- 200 OK
- 401
- 403
- 404
- 409
- 422
{
"data": {
"_id": "6801a2b3c4d5e6f7a8b9c0d3",
"batchConfiguration": "6801a2b3c4d5e6f7a8b9c0d4",
"client": "507f1f77bcf86cd799439013",
"name": "Colombia Onboarding — Updated",
"status": "draft",
"executor": "queue",
"source": "smart_batch",
"headlessRun": false,
"creditsSpent": 0,
"rows": [
{
"rowIndex": 0,
"inputData": {
"documentType": "CC",
"documentNumber": "1032386359"
},
"status": "pending",
"results": {},
"errors": []
}
],
"totalRows": 1,
"completedRows": 0,
"failedRows": 0,
"partialRows": 0,
"createdAt": "2026-11-24T19:58:00.000Z",
"updatedAt": "2026-11-24T20:06:00.000Z"
}
}
{
"message": "Unauthorized",
"code": "Unauthorized"
}
{
"message": "Shared x402 execution is forbidden on this endpoint",
"code": "Forbidden"
}
{
"message": "not_found",
"code": "NotFound"
}
{
"message": "\"status\" must be one of [draft, pending, processing, completed, failed, cancelled]",
"code": "MissingParameter"
}
{
"message": "UnprocessableEntity",
"code": "UnprocessableEntity"
}
참고
PUT /v2/smart-batches/{id}에서는"paused"가 허용되지 않습니다. 대신 Smart Batch 일시 중지를 호출하세요.- 배치가 현재
"draft","pending"또는"cancelled"상태가 아니면executor수정은 무시됩니다. - 기존 행을 교체하지 않고 기존 배치에 새 행을 추가하려면 Smart Batch에 행 추가를 사용하세요.