Skip to content
StatusSupportDashboard

Get batch status

client.batches.get(stringbatchID, RequestOptionsoptions?): BatchGetResponse { batch_count, batch_id, batch_status, 8 more }
get/v1/batches/{batch_id}

Retrieve the status and progress of a batch processing job.

ParametersExpand Collapse
batchID: string

The batch ID to retrieve

ReturnsExpand Collapse
BatchGetResponse { batch_count, batch_id, batch_status, 8 more }

Batch status and progress information

batch_count: number

Total number of decisions in the batch

batch_id: string

Unique identifier for the batch

batch_status: "WAITING_FOR_UPLOAD" | "PENDING" | "SUCCESS" | 2 more

Status of the batch

Accepts one of the following:
"WAITING_FOR_UPLOAD"
"PENDING"
"SUCCESS"
"ERROR"
"CANCELLED"
cancelled_count: number

Number of decisions that were cancelled

download_url: string | null

URL to download results when complete

error_count: number

Number of decisions that failed

pending_count: number

Number of decisions in progress

success_count: number

Number of decisions successfully completed

upload_url: string | null

Upload URL (null after batch is created)

policy_id?: string

Policy ID applied to batch items

policy_version?: string

Policy version applied to batch items

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