Skip to main content

Batch API

GET /api/batch/[batchId]

Fetch all uploads in a batch, grouped by the shared batchId.

Auth: Required

URL Parameters:

ParameterTypeDescription
batchIdstringBatch CUID (assigned during upload)

Success Response (200):

{
"uploads": [
{
"id": "clxx1111111111",
"fileName": "1712345678-conversation1.json",
"fileSize": 1024,
"uploadedAt": "2026-04-08T12:00:00.000Z",
"status": "completed",
"analysisMode": "gemini",
"selectedAnalyses": "hallucination,bias,toxicity",
"batchId": "clxxbatch123456",
"analyses": [
{
"id": "clxx...",
"analysisType": "hallucination-gemini",
"result": "{...}",
"confidence": 0.85,
"detectedIssues": 2,
"createdAt": "2026-04-08T12:00:30.000Z"
}
]
},
{
"id": "clxx2222222222",
"fileName": "1712345679-conversation2.json",
"fileSize": 2048,
"uploadedAt": "2026-04-08T12:00:05.000Z",
"status": "completed",
"analysisMode": "gemini",
"selectedAnalyses": "hallucination,bias,toxicity",
"batchId": "clxxbatch123456",
"analyses": [...]
}
]
}

Error Responses:

StatusCause
401Not authenticated
403Batch belongs to another user
404No uploads found with this batchId

Notes:

  • All uploads in the batch must belong to the authenticated user
  • Uploads are returned with their full analyses relations
  • The frontend uses this to render the batch report at /batch/[batchId]