Skip to content
StatusSupportDashboard

Create a batch

batches.create(BatchCreateParams**kwargs) -> BatchCreateResponse
post/v1/batches

Create a new batch processing job for up to 10,000 pieces of content. Returns a presigned S3 URL where you can upload your CSV file containing items to process.

ParametersExpand Collapse
type: str

Type of content to review

ReturnsExpand Collapse
class BatchCreateResponse:

Response containing batch ID and upload URL

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"
download_url: Optional[str]

Download URL (null until batch is complete)

upload_url: str

Presigned S3 URL for uploading the batch CSV file

Create a batch
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.create(
    type="product_review",
)
print(batch.batch_id)
{
  "batch_id": "batch_01hexzqs3n8hx83psy4ernj2zz",
  "batch_status": "WAITING_FOR_UPLOAD",
  "download_url": null,
  "upload_url": "https://safetykit-batch-uploads-production.s3.us-west-2.amazonaws.com/..."
}
Returns Examples
{
  "batch_id": "batch_01hexzqs3n8hx83psy4ernj2zz",
  "batch_status": "WAITING_FOR_UPLOAD",
  "download_url": null,
  "upload_url": "https://safetykit-batch-uploads-production.s3.us-west-2.amazonaws.com/..."
}