Get batch status
client.batches.get(stringbatchID, RequestOptionsoptions?): BatchGetResponse { batch_count, batch_id, batch_status, 8 more }
/v1/batches/{batch_id}
Retrieve the status and progress of a batch processing job.
Parameters
batchID: string
The batch ID to retrieve
Returns
Get batch status
import Safetykit from 'safetykit';
const client = new Safetykit({
apiKey: process.env['SAFETYKIT_API_KEY'], // This is the default and can be omitted
});
const batch = await client.batches.get('batch_id');
console.log(batch.batch_id);
{
"batch_count": 2000,
"batch_id": "batch_01hf89meedvef6pc00njv3ezh0",
"batch_status": "SUCCESS",
"cancelled_count": 0,
"download_url": "https://safetykit-batch-downloads-production.s3.us-west-2.amazonaws.com/...",
"error_count": 0,
"pending_count": 540,
"success_count": 1460,
"upload_url": null,
"policy_id": "",
"policy_version": ""
}
Returns Examples
{
"batch_count": 2000,
"batch_id": "batch_01hf89meedvef6pc00njv3ezh0",
"batch_status": "SUCCESS",
"cancelled_count": 0,
"download_url": "https://safetykit-batch-downloads-production.s3.us-west-2.amazonaws.com/...",
"error_count": 0,
"pending_count": 540,
"success_count": 1460,
"upload_url": null,
"policy_id": "",
"policy_version": ""
}