Retry a failed result
const url = 'https://api.prismlet.com/v1/results/0192f5c1-7c1a-7b3e-9f55-3c1d2e4a5b6c/retry?format=json';const options = {method: 'POST', 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 POST \ --url 'https://api.prismlet.com/v1/results/0192f5c1-7c1a-7b3e-9f55-3c1d2e4a5b6c/retry?format=json' \ --header 'Authorization: Bearer <token>'Sends a failed result’s fields to the model again, against the same prism version, and saves the answer as a new result with its own id. The response is that new result, on 200 or 502. Send no body.
Only a failed result can be retried, and only once. A second retry answers 409 and names the result that retried it. If that retry failed too, retry it in turn. An idempotency key held by the failed result moves to the new one. A result of an archived prism cannot be retried and answers 404.
Authorizations
Section titled “Authorizations”Parameters
Section titled “ Parameters ”Path Parameters
Section titled “Path Parameters”The result’s id.
Example
0192f5c1-7c1a-7b3e-9f55-3c1d2e4a5b6cQuery Parameters
Section titled “Query Parameters”What the response body holds.
json: the result, withanswersshaped by the prism’s Lens.raw: the result, with the stored answers and every probability.csv,tsv: a header row and one row for the result.jsonl: one line holding the same row as a JSON object.
Defaults to json, also when sent empty. An unknown value answers 400. Errors are JSON in every format.
Responses
Section titled “ Responses ”The retry was answered and saved as a new result.
A result in the default json format. answers is shaped by the prism’s current Lens, so editing the Lens changes what an old result returns.
object
The result id. Use it to read or retry the result.
The ref sent with the call, or null.
The prism’s slug.
The prism version that answered.
ok, or failed when the model gave no usable answer.
Why the result failed, in words. Null when status is ok.
How long the call to the model took, in milliseconds.
When the result was saved, ISO 8601 in UTC.
One entry per column of the prism’s Lens, keyed by column name, in Lens order. Null when the result failed.
A result in raw format, with the stored answers and every probability. Lens edits never change it.
object
The result id. Use it to read or retry the result.
The ref sent with the call, or null.
The prism’s slug.
The prism version that answered.
ok, or failed when the model gave no usable answer.
Why the result failed, in words. Null when status is ok.
How long the call to the model took, in milliseconds.
When the result was saved, ISO 8601 in UTC.
The stored answer to every question, keyed by question key. Null when the result failed.
Examples
Answered on retry, format=json
{ "id": "0192f5c4-9e27-7c55-b3d8-41a6f0e8c9b2", "ref": "TCK-8812", "prism": "support-routing", "version": 3, "status": "ok", "error": null, "took_ms": 640, "created_at": "2026-09-23T09:16:05.931Z", "answers": { "team": "billing", "team_probability": 0.91, "urgent": "yes", "tone": "annoyed", "tone_average": 2.05 }}Answered on retry, format=raw
{ "id": "0192f5c4-9e27-7c55-b3d8-41a6f0e8c9b2", "ref": "TCK-8812", "prism": "support-routing", "version": 3, "status": "ok", "error": null, "took_ms": 640, "created_at": "2026-09-23T09:16:05.931Z", "answers": { "team": { "type": "choice", "value": "billing", "probabilities": { "billing": 0.91, "technical": 0.05, "other": 0.03, "insufficient_information": 0.01 }, "confidence": 0.88 }, "urgent": { "type": "yes_no", "probability": 0.83 }, "tone": { "type": "scale", "level": "annoyed", "probabilities": { "calm": 0.12, "annoyed": 0.71, "angry": 0.17 } } }}A header row, then one row. The columns are result_id, ref, version, status, error, created_at, one per field of the latest prism version, then the Lens columns. Cells hold option labels and Yes, No or Unsure. Lines end in CRLF. A cell holding a comma, a quote or a line break is quoted, with quotes doubled. An empty value is an empty cell.
Examples
Answered on retry, format=csv
result_id,ref,version,status,error,created_at,subject,text,team,team_probability,urgent,tone,tone_average0192f5c4-9e27-7c55-b3d8-41a6f0e8c9b2,TCK-8812,3,ok,,2026-09-23T09:16:05.931Z,Charged twice this month,"Hi, I was billed twice for September. Please refund the second charge before Friday.",Billing,0.91,Yes,Annoyed,2.05The csv columns, separated by tabs, with lines ending in LF. Tabs and line breaks inside a cell become spaces.
Examples
Answered on retry, format=tsv
result_id ref version status error created_at subject text team team_probability urgent tone tone_average0192f5c4-9e27-7c55-b3d8-41a6f0e8c9b2 TCK-8812 3 ok 2026-09-23T09:16:05.931Z Charged twice this month Hi, I was billed twice for September. Please refund the second charge before Friday. Billing 0.91 Yes Annoyed 2.05One line ending in LF, holding the csv row as a JSON object, with option keys and yes, no or unsure instead of labels, and all columns as objects.
Examples
Answered on retry, format=jsonl
{"result_id":"0192f5c4-9e27-7c55-b3d8-41a6f0e8c9b2","ref":"TCK-8812","version":3,"status":"ok","error":null,"created_at":"2026-09-23T09:16:05.931Z","subject":"Charged twice this month","text":"Hi, I was billed twice for September. Please refund the second charge before Friday.","team":"billing","team_probability":0.91,"urgent":"yes","tone":"annoyed","tone_average":2.05}The result id or the format is invalid, or the body is not valid JSON.
Every error has this body, in JSON, whatever format asked for.
object
object
validation_failed, bad_request, unauthorized, not_found, conflict or internal_error.
What went wrong, in words. A validation message names the failing paths and never repeats a value sent. Unknown fields lists the keys sent.
Examples
Result id is not a UUID
{ "error": { "code": "validation_failed", "message": "Invalid request: result_id: Invalid uuid" }}Unknown format
{ "error": { "code": "validation_failed", "message": "Invalid request: format: Expected 'json' | 'raw' | 'csv' | 'tsv' | 'jsonl'" }}Body is not valid JSON
{ "error": { "code": "bad_request", "message": "Malformed request" }}No API key, or one that is unknown or revoked.
Every error has this body, in JSON, whatever format asked for.
object
object
validation_failed, bad_request, unauthorized, not_found, conflict or internal_error.
What went wrong, in words. A validation message names the failing paths and never repeats a value sent. Unknown fields lists the keys sent.
Examples
No Authorization header
{ "error": { "code": "unauthorized", "message": "Authentication required" }}Unknown or revoked key
{ "error": { "code": "unauthorized", "message": "Invalid API key" }}No result with this id in this account, or its prism is archived.
Every error has this body, in JSON, whatever format asked for.
object
object
validation_failed, bad_request, unauthorized, not_found, conflict or internal_error.
What went wrong, in words. A validation message names the failing paths and never repeats a value sent. Unknown fields lists the keys sent.
Examples
Unknown result
{ "error": { "code": "not_found", "message": "Result not found" }}Archived prism
{ "error": { "code": "not_found", "message": "This prism is archived, so it cannot answer." }}The result succeeded, or it was already retried.
Every error has this body, in JSON, whatever format asked for.
object
object
validation_failed, bad_request, unauthorized, not_found, conflict or internal_error.
What went wrong, in words. A validation message names the failing paths and never repeats a value sent. Unknown fields lists the keys sent.
Examples
Result succeeded
{ "error": { "code": "conflict", "message": "Only a failed result can be retried." }}Already retried
{ "error": { "code": "conflict", "message": "This result was already retried as 0192f5c4-9e27-7c55-b3d8-41a6f0e8c9b2." }}A body over 1 MiB was sent. Send no body.
Every error has this body, in JSON, whatever format asked for.
object
object
validation_failed, bad_request, unauthorized, not_found, conflict or internal_error.
What went wrong, in words. A validation message names the failing paths and never repeats a value sent. Unknown fields lists the keys sent.
Examples
Body too large
{ "error": { "code": "bad_request", "message": "Malformed request" }}A body was sent with a content type the server does not parse. Send no body.
Every error has this body, in JSON, whatever format asked for.
object
object
validation_failed, bad_request, unauthorized, not_found, conflict or internal_error.
What went wrong, in words. A validation message names the failing paths and never repeats a value sent. Unknown fields lists the keys sent.
Examples
Unsupported content type
{ "error": { "code": "bad_request", "message": "Malformed request" }}A bug on our side. The message is always the same.
Every error has this body, in JSON, whatever format asked for.
object
object
validation_failed, bad_request, unauthorized, not_found, conflict or internal_error.
What went wrong, in words. A validation message names the failing paths and never repeats a value sent. Unknown fields lists the keys sent.
Examples
Unexpected error
{ "error": { "code": "internal_error", "message": "Internal server error" }}The model failed again. The new failed result is saved and returned, and can be retried in turn.
A result in the default json format. answers is shaped by the prism’s current Lens, so editing the Lens changes what an old result returns.
object
The result id. Use it to read or retry the result.
The ref sent with the call, or null.
The prism’s slug.
The prism version that answered.
ok, or failed when the model gave no usable answer.
Why the result failed, in words. Null when status is ok.
How long the call to the model took, in milliseconds.
When the result was saved, ISO 8601 in UTC.
One entry per column of the prism’s Lens, keyed by column name, in Lens order. Null when the result failed.
A result in raw format, with the stored answers and every probability. Lens edits never change it.
object
The result id. Use it to read or retry the result.
The ref sent with the call, or null.
The prism’s slug.
The prism version that answered.
ok, or failed when the model gave no usable answer.
Why the result failed, in words. Null when status is ok.
How long the call to the model took, in milliseconds.
When the result was saved, ISO 8601 in UTC.
The stored answer to every question, keyed by question key. Null when the result failed.
Examples
Model timed out again, format=json
{ "id": "0192f5c5-4d81-7a02-9c3e-6b27d1f0a845", "ref": "TCK-8812", "prism": "support-routing", "version": 3, "status": "failed", "error": "The model took too long to answer, so we stopped after 15 seconds.", "took_ms": 15012, "created_at": "2026-09-23T09:16:38.644Z", "answers": null}Model timed out again, format=raw
{ "id": "0192f5c5-4d81-7a02-9c3e-6b27d1f0a845", "ref": "TCK-8812", "prism": "support-routing", "version": 3, "status": "failed", "error": "The model took too long to answer, so we stopped after 15 seconds.", "took_ms": 15012, "created_at": "2026-09-23T09:16:38.644Z", "answers": null}A header row, then one row. The columns are result_id, ref, version, status, error, created_at, one per field of the latest prism version, then the Lens columns. Cells hold option labels and Yes, No or Unsure. Lines end in CRLF. A cell holding a comma, a quote or a line break is quoted, with quotes doubled. An empty value is an empty cell.
Examples
Model timed out again, format=csv
result_id,ref,version,status,error,created_at,subject,text,team,team_probability,urgent,tone,tone_average0192f5c5-4d81-7a02-9c3e-6b27d1f0a845,TCK-8812,3,failed,"The model took too long to answer, so we stopped after 15 seconds.",2026-09-23T09:16:38.644Z,Charged twice this month,"Hi, I was billed twice for September. Please refund the second charge before Friday.",,,,,The csv columns, separated by tabs, with lines ending in LF. Tabs and line breaks inside a cell become spaces.
Examples
Model timed out again, format=tsv
result_id ref version status error created_at subject text team team_probability urgent tone tone_average0192f5c5-4d81-7a02-9c3e-6b27d1f0a845 TCK-8812 3 failed The model took too long to answer, so we stopped after 15 seconds. 2026-09-23T09:16:38.644Z Charged twice this month Hi, I was billed twice for September. Please refund the second charge before Friday.One line ending in LF, holding the csv row as a JSON object, with option keys and yes, no or unsure instead of labels, and all columns as objects.
Examples
Model timed out again, format=jsonl
{"result_id":"0192f5c5-4d81-7a02-9c3e-6b27d1f0a845","ref":"TCK-8812","version":3,"status":"failed","error":"The model took too long to answer, so we stopped after 15 seconds.","created_at":"2026-09-23T09:16:38.644Z","subject":"Charged twice this month","text":"Hi, I was billed twice for September. Please refund the second charge before Friday.","team":null,"team_probability":null,"urgent":null,"tone":null,"tone_average":null}