Create a batch
client.batches.create(BatchCreateParams { type } body, RequestOptionsoptions?): BatchCreateResponse { batch_id, batch_status, download_url, upload_url }
/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.
Parameters
Returns
Create a batch
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.create({ type: 'product_review' });
console.log(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/..."
}