Skip to main content

バッチ設定の入力スキーマを取得する

行を送信する前に、保存済み 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-Typeapplication/json
AuthorizationBearer <VERIFIK_JWT>

トークンは クライアント JWT である必要があります。認証情報がないか無効な場合は 401 Unauthorized を返します。

パラメータ​

名前型必須説明
idstringはい確認する BatchConfiguration の ObjectId。

リクエスト​

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();

レスポンス​

{
"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"
}
}
}

補足​

  • 入力スキーマを確認しても照会は実行されず、クレジットも消費されません。
  • 設定上で preferredReportTemplate が未設定の場合、サーバーは {id} にリンクされた最新の有効な SmartReportTemplate にフォールバックします(存在しない場合は null)。
  • inputFieldMapping によって入力列が API パラメータにマッピングされている場合、requiredFields、optionalFields、jsonSchema、および exampleInput は生の API パラメータ名ではなくマッピング後の入力列名を公開します。
  • 存在しない {id} や他クライアントの {id} を指定した場合、HTTP 200 と data: null を返すバッチ設定を取得するとは異なり、404(not_found)が返されます。
  • AI エージェントおよびヘッドレスパイプラインでは、このエンドポイントは smart_report_get_input_schema MCP ツールに対応します。

関連​