API reference
Feedback
1 operation. Base URL https://api.scarleta.ai. Select an operation to see its parameters, samples and errors.
Jump to an operation
POST/v1/feedbackSend a thumbs up or thumbs down
Free and paid accounts
- API key required
- Free and paid accounts
- No token cost
Records whether a result was good. request_id is the id of the request you are rating, as a UUID (the part of an X-Request-ID header after req_); feedback is thumbs_up or thumbs_down; feedback_text is an optional comment of at most 4096 characters. You can rate only a request your own account made: an id that was never issued, or that belongs to another account, is 404 not_found (the record of a request is written just after its answer is sent, so rate it a moment later, not in the same instant). Sending the same rating twice stores it twice.
Every problem with the body, including text that is not valid JSON, is 400 invalid_request; the message names the field. Only an over-long comment has its own code, feedback_text_too_long. If the rating could not be stored the reply is 503 db_unavailable; send it again.
Cost. Free of charge.
curl -X POST "https://api.scarleta.ai/v1/feedback" \
-H "Authorization: Bearer $SCARLETA_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"request_id": "4e1b7c9a-2d58-4f03-8a6b-5c0d9e1f2a37",
"feedback": "thumbs_up",
"feedback_text": "Great result"
}'Request body
| Name | Type | Required | Description |
|---|---|---|---|
| request_idbody | string | Required | The id of the request you are rating, as a UUID. |
| feedbackbody | "thumbs_up" | "thumbs_down" | Required | Your verdict. |
| feedback_textbody | string | Optional | An optional comment, at most 4096 characters. |
Response fields
| Field | Type | Description |
|---|---|---|
| success | true | Always true: the rating was stored. |
| request_id | string | The id you sent. |
| feedback | "thumbs_up" | "thumbs_down" | The verdict you sent. |
| message | string | A short confirmation sentence that repeats the verdict and the comment. |
Errors
| Status | Code | Description |
|---|---|---|
| 400 | invalid_request | The body is not valid JSON, `request_id` is missing or not a UUID, `feedback` is not one of the two verdicts, or `feedback_text` is not a string (`invalid_request`); `feedback_text` is too long (`feedback_text_too_long`). |
| 401 | invalid_key | Missing, malformed, unknown or revoked API key. |
| 404 | not_found | The id was not issued to your account (it never existed, or another account made it). |
| 429 | rate_limit_exceeded | Over the account request budget or the per-minute cap of this route. Wait for the `Retry-After` header, then retry. |
| 503 | auth_unavailable | Temporary platform condition; retry shortly. |
Example responses
{
"data": {
"success": true,
"request_id": "4e1b7c9a-2d58-4f03-8a6b-5c0d9e1f2a37",
"feedback": "thumbs_up",
"message": "✓ Feedback recorded: thumbs_up - Great result"
},
"meta": {
"request_id": "req_0b7a3c2e-6f1d-4d9a-8e55-3a4b5c6d7e8f"
}
}- 200 The rating is stored.
- 400 The body is not valid JSON, `request_id` is missing or not a UUID, `feedback` is not one of the two verdicts, or `feedback_text` is not a string (`invalid_request`); `feedback_text` is too long (`feedback_text_too_long`).
- 401 Missing, malformed, unknown or revoked API key.
- 404 The id was not issued to your account (it never existed, or another account made it).
- 429 Over the account request budget or the per-minute cap of this route. Wait for the `Retry-After` header, then retry.
- 503 Temporary platform condition; retry shortly.
Try it
Sends this request from your browser to https://api.scarleta.ai with your own key. The key stays in this page only (never saved or put in the address) and is cleared when you leave. Revoke any key you have shared.
Other error codes this operation can return: db_unavailable, feedback_text_too_long, invalid_auth_format, invalid_key_format, missing_api_key, missing_auth, rate_limit_unavailable, unauthorized.