Retrieve a batch
GET
/v1/batches/{batch_id}
const url = 'https://api.pensievelabs.co/v1/batches/bat_5d2e81f0';const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request GET \ --url https://api.pensievelabs.co/v1/batches/bat_5d2e81f0 \ --header 'Authorization: Bearer <token>'Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”batch_id
required
string
Example
bat_5d2e81f0Responses
Section titled “Responses”The batch, with its decisions once done.
Media typeapplication/json
object
id
required
string
object
required
model
required
string
status
required
string
total
required
integer
done
required
integer
decisions
required
The decisions, in the order sent, once the batch is done.
Array<object> | null
object
id
required
The call id; send outcomes and corrections with it.
string
object
required
model
required
string
version
required
string
answer
required
One of the model’s answer values.
string
label
required
string
confidence
required
number
scores
required
The probability of each answer value.
object
key
additional properties
number
reason
required
A short reason, when the model gives one.
string | null
routed
required
fallback when your code should answer instead: routing is observe, the confidence is under the threshold, or the split sent the call to your code.
string
key
required
string | null
latency_ms
required
integer
created_at
required
string format: date-time
created_at
required
string format: date-time
completed_at
required
string | null format: date-time
Example
{ "id": "bat_5d2e81f0", "object": "batch", "status": "queued", "decisions": [ { "id": "cl_8f21c0d4", "object": "decision", "model": "grade-audit", "version": "v7", "answer": "false_pass", "label": "False pass", "routed": "model" } ]}default
Section titled “default”Something went wrong; error.type says what.
Media typeapplication/json
object
error
required
object
type
required
string
message
required
string
param
The request field the error is about.
string | null
request_id
required
string
Example
{ "error": { "type": "invalid_request" }}