Response
Unique ID of the batch, used to retrieve the results
The type of content to review
Status of the batch ( “WAITING_FOR_UPLOAD”, “PENDING”, “SUCCESS”, “CANCELLED”
or “ERROR”)
Presigned S3 Upload URL (null)
Presigned S3 Download URL (valid for 1 hour). Included if batch status is
SUCCESS, otherwise value is null.
Number of decisions in the batch
Number of decisions successfully completed
Number of decisions in progress
Number of decisions that failed
Number of decisions that were cancelled
curl --location --request GET 'https://api.safetykit.com/v1/batches/batch_01hexzqs3n8hx83psy4ernj2zz' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer <api_key>'
{
"batch_id": "batch_01hf89meedvef6pc00njv3ezh0",
"type": "product_review",
"batch_status": "SUCCESS",
"upload_url": null,
"download_url": "https://safetykit-batch-downloads-production.s3.us-west-2.amazonaws.com/53ee3a58-73c6-4b3d-9d57-e6fe277c8dba/batch_01hfa5f9v8j9p9y212mzfwv34z_2023-11-15T18%3A59%3A43.004Z.csv?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Content-Sha256=UNSIGNED-PAYLOAD&X-Amz-Credential=ASIAU3KITNE2NKADFBFT%2F20231115%2Fus-west-2%2Fs3%2Faws4_request&X-Amz-Date=20231115T185943Z&X-Amz-Expires=100800&X-Amz-Security-Token=IQoJb3JpZ2luX2VjEDMaCXVzLXdlc3QtMiJIMEYCIQCJJ5mZrbuGIVvcYt9Vy%2F7cfCOdS6Aug2dmssnkkS0SKAIhALLhh7zOw%2Fiy0zBAMU7smL6IMOTP1sEPX9uH2sZkF97hKskDCHwQABoMMzMzNTQ5MTAzNDEyIgyrif%2BhB7vPUwAmg%2BAqpgPVvzaq3MM%2BTigKz9PdSLSXzeqJxhMwdQICPcvXMBYn1LMUdH8cDIulwVoBm6%2BuYmqL9OU8xGLP3JQxEnRMbg54RNmpirBtVwZUZ%2Bfy1lefowQw1UwxrO4GY6e8h%2BELamQZaFl9JIvD9lt9PVA7Iev5iIjXSSff2CNLKDnvHpCA%2BN2owz9NRx303SjohFnJQ8kMEkjNeDdXMbpyA%2FH47Maj0OmV%2BexuXc3WqRJoue0CTQcl2c3ia%2FoHldK4U11Pt%2FB837mTRYRagTYFfks947Z47xak9dR%2BfHN%2Bz596%2BJb5KyQNs8sc%2BtbaCw%2B04waSclKJ6eXszZcR74XvNBzbxpZ3%2FGxjTvIOuUQiQfXFcToijxGZz1FarbKoTc06QIbOCAZR1B2QkI9bB5DjWVujcodTQlsSTQqDIbHPo29eh1ev%2FU7FCAe%2BvFEW0qTZ%2FFvafEYr2K6ZlGUntndcXwH56uD30VUXSI%2FgKRVz%2BfnoNbD6OffsR%2FKcnLJfwkXilcqxBWBBiTAX740ZJX4oXJwah%2FXC2hZ%2FTy1xHVUfnYjDx%2F64TuGFTcgAkDCcqtSqBjqdAX4u3RcmPPTvbFZiHdS0G%2FNkpF6PHiyHWOhtbiX0c7HblM9HBwzlwjgVzk5eKrq4QJSK22j1VhGz7%2FgM1v01tzu6o%2BoTMvH5%2BZup7d3FvxXhTZUHKDN%2BjC%2Fb9AjbcDNjRhQVtOqecYvKz7SKV9UJtvyoIb1Rg%2BrS2%2B0QqIzXkMNTm7CW8eVH4AHIRBi6Srw2vsCKKLNob59NK0VKrCg%3D&X-Amz-Signature=5c9274a4c612cc017e03e8fda6747a19ed289dcab71a2e6612e1f8f52c7598ab&X-Amz-SignedHeaders=host&x-id=GetObject",
"batch_count": 2000,
"success_count": 1460,
"pending_count": 540,
"error_count": 0,
"cancelled_count": 0
}
Downloading the Batch File
Once the batch processing is complete, you can download the results using the download_url
provided by the GET batch endpoint.
The downloaded CSV file will include the following headers:
Content
: The original content submitted for review.
Status
: The status of the decision (either SUCCESS or ERROR).
SafetyKit result
: The decision result from SafetyKit.
Expected result
: The expected decision result for comparison.
Labels
: Labels assigned during the decision process.
...customerHeaders
: Any additional metadata headers included in the original upload.
Downloading the CSV file
Here is an example of how to download the CSV file using the provided download_url
:
curl -o "<Local Filename>.csv" "<Your Download URL Here>"