Creating a Message Batch
JSON
Polling for Message Batch completion
To poll a Message Batch, you’ll need itsid
, which is provided in the response when creating request or by listing batches. Example id
: msgbatch_013Zva2CMHLNnXjNJJKqJ2EF
.
Listing all Message Batches in a Workspace
Output
Retrieving Message Batch Results
Once your Message Batch status isended
, you will be able to view the results_url
of the batch and retrieve results in the form of a .jsonl
file.
Output
Canceling a Message Batch
Immediately after cancellation, a batch’sprocessing_status
will be canceling
. You can use the same polling for batch completion technique to poll for when cancellation is finalized as canceled batches also end up ended
and may contain results.
JSON