バッチ設定の入力スキーマを取得する
行を送信する前に、保存済み BatchConfiguration の正確な入力コントラクトを解決します。このエンドポイントは、preferredReportTemplate(未設定の場合は設定にリンクされた最新の有効な SmartReportTemplate にフォールバック)、webhookUrl、stepCount、estimatedCreditsPerRow、requiredFields、optionalFields、標準の jsonSchema、およびすぐに送信できる exampleInput ペイロードを返します。
リゾルバーは無効化されたステップ、非アクティブな dependencyGroup オプション、内部フラグ、および parameterDefaults や visitaFlow ステップ連鎖({{results.N.field}})によってすでに供給されているフィールドを自動的にスキップし、inputFieldMapping に従って列名を再マッピングします。このルートは /{id} より前に登録されているため /input-schema が直接解決され、smart_report_get_input_schema MCP ツールとしても利用できます。
エンドポイント
GET https://api.verifik.co/v2/batch-configurations/{id}/input-schema
クライアント単位の Authorization: Bearer <VERIFIK_JWT> ヘッダーを使用することで、Smart-Agent プロキシ(https://ai.verifik.co/v2/batch-configurations/{id}/input-schema)経由でもアクセスできます。共有 x402 実行は 403 Forbidden でブロックされます。
ヘッダー
| 名前 | 値 |
|---|---|
| Content-Type | application/json |
| Authorization | Bearer <VERIFIK_JWT> |
トークンは クライアント JWT である必要があります。認証情報がないか無効な場合は 401 Unauthorized を返します。
パラメータ
| 名前 | 型 | 必須 | 説明 |
|---|---|---|---|
id | string | はい | 確認する BatchConfiguration の ObjectId。 |
リクエスト
- Node.js
- PHP
- Python
- Go
- cURL
const fetch = require("node-fetch");
async function run() {
const id = "67d1b4a0e4f5a60718293b12";
const res = await fetch(`https://api.verifik.co/v2/batch-configurations/${id}/input-schema`, {
method: "GET",
headers: {
"Content-Type": "application/json",
Authorization: `Bearer ${process.env.VERIFIK_JWT}`,
},
});
console.log(await res.json());
}
run();
<?php
$id = "67d1b4a0e4f5a60718293b12";
$ch = curl_init("https://api.verifik.co/v2/batch-configurations/" . $id . "/input-schema");
curl_setopt($ch, CURLOPT_HTTPHEADER, [
"Content-Type: application/json",
"Authorization: Bearer " . getenv("VERIFIK_JWT")
]);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($ch);
curl_close($ch);
echo $response;
import os
import requests
config_id = "67d1b4a0e4f5a60718293b12"
url = f"https://api.verifik.co/v2/batch-configurations/{config_id}/input-schema"
headers = {
"Content-Type": "application/json",
"Authorization": f"Bearer {os.getenv('VERIFIK_JWT')}",
}
r = requests.get(url, headers=headers)
print(r.json())
package main
import (
"encoding/json"
"fmt"
"net/http"
"os"
)
func main() {
id := "67d1b4a0e4f5a60718293b12"
req, _ := http.NewRequest("GET", "https://api.verifik.co/v2/batch-configurations/"+id+"/input-schema", nil)
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 -sS "https://api.verifik.co/v2/batch-configurations/67d1b4a0e4f5a60718293b12/input-schema" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $VERIFIK_JWT"
レスポンス
- 200
- 401
- 403
- 404
{
"data": {
"configurationId": "67d1b4a0e4f5a60718293b12",
"name": "Colombia Citizen Essential",
"country": "CO",
"preferredReportTemplate": "67d1b4a1e4f5a60718293b15",
"webhookUrl": "https://example.com/webhooks/smart-reports",
"stepCount": 2,
"estimatedCreditsPerRow": 0.15,
"requiredFields": [
{
"field": "documentType",
"apiField": "documentType",
"type": "string",
"required": true,
"enum": ["CC", "CE"]
},
{
"field": "documentNumber",
"apiField": "documentNumber",
"type": "string",
"required": true
}
],
"optionalFields": [],
"jsonSchema": {
"type": "object",
"properties": {
"documentType": {
"type": "string",
"enum": ["CC", "CE"]
},
"documentNumber": {
"type": "string"
}
},
"required": ["documentType", "documentNumber"]
},
"exampleInput": {
"documentType": "CC",
"documentNumber": "123456789"
}
}
}
{
"message": "Unauthorized",
"code": "Unauthorized"
}
{
"message": "Access forbidden",
"code": "Forbidden"
}
{
"message": "not_found",
"code": "NotFound"
}
補足
- 入力スキーマを確認しても照会は実行されず、クレジットも消費されません。
- 設定上で
preferredReportTemplateが未設定の場合、サーバーは{id}にリンクされた最新の有効なSmartReportTemplateにフォールバックします(存在しない場合はnull)。 inputFieldMappingによって入力列が API パラメータにマッピングされている場合、requiredFields、optionalFields、jsonSchema、およびexampleInputは生の API パラメータ名ではなくマッピング後の入力列名を公開します。- 存在しない
{id}や他クライアントの{id}を指定した場合、HTTP200とdata: nullを返すバッチ設定を取得するとは異なり、404(not_found)が返されます。 - AI エージェントおよびヘッドレスパイプラインでは、このエンドポイントは
smart_report_get_input_schemaMCP ツールに対応します。