Send what really happened
POST
/v1/calls/{call_id}/outcome
const url = 'https://api.pensievelabs.co/v1/calls/cl_seed_grade_01/outcome';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"outcome":"lab_rejected","note":"Lab found the edited test."}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://api.pensievelabs.co/v1/calls/cl_seed_grade_01/outcome \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "outcome": "lab_rejected", "note": "Lab found the edited test." }'Outcomes check every version against reality and catch drift. A later outcome replaces an earlier one. An outcome can arrive before its call: it is kept, and matched when a call with that id is recorded.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”call_id
required
string
Example
cl_seed_grade_01Header Parameters
Section titled “Header Parameters”Idempotency-Key
string
Any unique string. Sending it again within 24 hours returns the first response.
Request Bodyrequired
Section titled “Request Bodyrequired”Media typeapplication/json
object
outcome
required
One of the model’s outcomes, such as lab_rejected.
string
value
An amount that goes with it, such as money lost.
number
occurred_at
string format: date-time
note
string
Example
{ "outcome": "lab_rejected", "note": "Lab found the edited test."}Responses
Section titled “Responses”The outcome as recorded.
Media typeapplication/json
object
object
required
call_id
required
string
outcome
required
string
value
required
number | null
occurred_at
required
string format: date-time
note
required
string | null
received_at
required
string format: date-time
Example
{ "object": "outcome"}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" }}