Skip to content
StatusSupportDashboard

Get batch status

batches.get(strbatch_id) -> BatchGetResponse
get/v1/batches/{batch_id}

Retrieve the status and progress of a batch processing job.

ParametersExpand Collapse
batch_id: str

The batch ID to retrieve

ReturnsExpand Collapse
class BatchGetResponse:

Batch status and progress information

batch_count: int

Total number of decisions in the batch

batch_id: str

Unique identifier for the batch

batch_status: Literal["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: int

Number of decisions that were cancelled

download_url: Optional[str]

URL to download results when complete

error_count: int

Number of decisions that failed

pending_count: int

Number of decisions in progress

success_count: int

Number of decisions successfully completed

upload_url: Optional[str]

Upload URL (null after batch is created)

policy_id: Optional[str]

Policy ID applied to batch items

policy_version: Optional[str]

Policy version applied to batch items

Get batch status
import os
from safetykit import Safetykit

client = Safetykit(
    api_key=os.environ.get("SAFETYKIT_API_KEY"),  # This is the default and can be omitted
)
batch = client.batches.get(
    "batch_id",
)
print(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": ""
}