rating
Your app's own question about how something went, answered with a tap.
How did it go? rating asks the user to score something — the delivery, the visit, the help they just had — on five stars, a thumb, or a 0–10 scale, with a few words if they want.
The answer is recorded at once, without coming back to the model: the SDK sends POST /v1/ratings with the block's id and the score, and the server checks the score against the block's own scale. One answer per device per block; a second tap changes it.
Drawn live in your browser with the SDK’s own sizes and colours, not a screenshot.
Rendered natively by the Flutter SDK since 0.42.0 and the web SDK since 0.19.0. A build that does not declare it is never offered it.
When Rendel asks
At most once in a conversation, only once the user's job is done, and never as the whole answer. The server holds it to that: a second rating in a conversation or in the same answer, or one on a page that still asks the user for something (a form, a choice, a variant picker, time slots), is drawn as its fallback_text instead.
Props
Every block also carries type and a required fallback_text of 1 to 300 characters.
| Prop | Type | Required | Constraints |
|---|---|---|---|
question | string | Yes | 1 to 120 characters. |
scale | stars_5 | thumbs | nps_11 | Yes | None |
low_label | string | No | Up to 30 characters. |
high_label | string | No | Up to 30 characters. |
comment | object | No | None |
comment.placeholder | string | No | Up to 80 characters. |
On the wire
{
"id": "blk_85",
"type": "rating",
"fallback_text": "How did we do with your return today?",
"props": {
"question": "How did we do with your return today?",
"scale": "stars_5",
"low_label": "Poor",
"high_label": "Great",
"comment": { "placeholder": "Anything we could do better?" }
}
}Recording the answer
POST /v1/ratings with X-Rendel-Key and X-Rendel-Device, body { message_id, block_id, score, comment? }. score is 1–5 for stars_5, 0 or 1 for thumbs (down, up) and 0–10 for nps_11. comment is up to 500 characters and is redacted like the conversation. A later answer from the same device replaces the score and keeps the earlier comment if it sends none. An unknown device, message or block gets 404 invalid_request; a score off the scale gets 400 invalid_request. The built-in renderers do all of this, and a Flutter replacement renderer calls dispatch.onRate; you need the endpoint only when you call the API without an SDK.
Answers are kept with the conversation's messages and deleted with them. That 404 is the same for an unknown device, message or block, so the endpoint cannot be used to probe for ids.