Skip to content

Send many outcomes

POST
/v1/outcomes
curl --request POST \
--url https://api.pensievelabs.co/v1/outcomes \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{ "items": [ { "model": "grade-audit", "key": "rust-2291", "outcome": "lab_rejected" } ] }'

Each item names its call by call_id, or by model and your own key. An item whose call isn’t recorded yet is kept, and matched when a call with that id, or that model and key, arrives.

Idempotency-Key
string
<= 255 characters

Any unique string. Sending it again within 24 hours returns the first response.

Media typeapplication/json
object
items
required
Array<object>
>= 1 items <= 1000 items
object
call_id
string
model
string
key
string
outcome
required
string
value
number
occurred_at
string format: date-time
note
string
<= 2000 characters

Example

{
"items": [
{
"model": "grade-audit",
"key": "rust-2291",
"outcome": "lab_rejected"
}
]
}

How many were recorded.

Media typeapplication/json
object
object
required
Allowed value: receipt
received
required

How many items were recorded.

integer
ids
required

For each item in order, the call or test case it was recorded as (for a capture with decision_id, that decision’s call). For an outcome, the call it was matched to, or null while it waits for its call: it is matched when a call with that id, or that model and key, is recorded.

Array<string | null>

Example

{
"object": "receipt"
}

Something went wrong; error.type says what.

Media typeapplication/json
object
error
required
object
type
required
string
Allowed values: invalid_request authentication permission not_found conflict rate_limit not_available server
message
required
string
param

The request field the error is about.

string | null
request_id
required
string

Example

{
"error": {
"type": "invalid_request"
}
}