Pular para o conteúdo

Reviews

Este conteúdo não está disponível em sua língua ainda.

The Reviews resource exposes the review_requests table, records of every review solicitation (SMS, email, or other channel) that BenchKey has sent, skipped, or queued for a customer. You can list and retrieve these records, and manually trigger a new review request for any ticket or invoice.

Review requests are channel-agnostic: BenchKey chooses the delivery channel (SMS, email, etc.) based on your shop’s settings and the customer’s consent state. The POST /reviews/request endpoint kicks off that same pipeline, it respects suppression lists, opt-out flags, and channel configuration.

{
"object": "review",
"id": 1042,
"ticket_id": "23115",
"invoice_id": null,
"trigger_kind": "auto",
"status": "sent",
"carrier": null,
"tracking_number": null,
"channels": "sms",
"armed_by": null,
"customer_name": "Marcus Webb",
"customer_phone": "(617) 555-0104",
"customer_email": null,
"device_type": "iPad Air 5",
"ticket_total": "$285.76",
"sent_via": "sms",
"sent_at": "2026-09-28T16:55:06.000Z",
"skipped_at": null,
"clicked_at": null,
"destination_url": "https://g.page/r/brightfix-repair/review",
"send_after": "2026-09-28T16:55:06.000Z",
"reminder_sent_at": null,
"created_at": "2026-09-28T14:55:06.000Z"
}
FieldTypeDescription
idintegerUnique review request ID
ticket_idstring|nullTicket this request is tied to, or null for invoice-only requests
invoice_idinteger|nullInvoice ID, or null for ticket-only requests
trigger_kindstring|nullHow this request was triggered: "auto", "manual", or null
statusstringCurrent lifecycle state: pending, armed, scheduled, sending, sent, skipped, or cancelled
carrierstring|nullShipping carrier (populated when triggered by a shipment event), or null
tracking_numberstring|nullShipment tracking number, or null
channelsstring|nullDelivery channels used (e.g. "sms", "email")
armed_bystring|nullUser or system that armed the request, or null
customer_namestring|nullCustomer name at time of send
customer_phonestring|nullCustomer phone at time of send
customer_emailstring|nullCustomer email at time of send
device_typestring|nullDevice type on the ticket at time of send
ticket_totalstring|nullTicket total at time of send (formatted string)
sent_viastring|nullChannel actually used to deliver the request
sent_atstring|nullISO-8601 timestamp when the request was sent, or null
skipped_atstring|nullISO-8601 timestamp when the request was skipped, or null
clicked_atstring|nullISO-8601 timestamp when the customer clicked the review link, the conversion signal for reputation integrations
destination_urlstring|nullThe review destination the link points at (e.g. your Google review URL)
send_afterstring|nullISO-8601 timestamp a scheduled request is held until, or null
reminder_sent_atstring|nullISO-8601 timestamp the follow-up reminder went out, or null
created_atstringISO-8601 timestamp when the record was created

The status lifecycle is armed → scheduled → sending → sent (or skipped / cancelled at any point before delivery); pending is the legacy pre-lifecycle state.


GET /api/v1/reviews

Returns a cursor-paginated list of review requests ordered newest first. Requests tied to soft-deleted or hidden tickets are excluded.

Scope required: reviews.read

ParameterTypeDescription
statusstringFilter by status: pending, armed, scheduled, sending, sent, skipped, or cancelled
sent_viastringFilter by delivery channel (e.g. "sms", "email")
ticket_idstringFilter to requests tied to a specific ticket
limitintegerPage size, 1–100 (default: 20)
cursorstringOpaque cursor from a previous response’s next_cursor
Terminal window
curl "https://app.benchkey.com/api/v1/reviews?status=sent&limit=10" \
-H "Authorization: Bearer bk_live_01J8X4_kvWz9nP3mRqTs7uYeBfGhDjLa"
const res = await fetch(
"https://app.benchkey.com/api/v1/reviews?status=sent&limit=10",
{ headers: { Authorization: "Bearer bk_live_01J8X4_kvWz9nP3mRqTs7uYeBfGhDjLa" } }
);
const { data, has_more, next_cursor } = await res.json();
{
"object": "list",
"data": [
{
"object": "review",
"id": 1042,
"ticket_id": "23115",
"invoice_id": null,
"trigger_kind": "auto",
"status": "sent",
"carrier": null,
"tracking_number": null,
"channels": "sms",
"armed_by": null,
"customer_name": "Marcus Webb",
"customer_phone": "(617) 555-0104",
"customer_email": null,
"device_type": "iPad Air 5",
"ticket_total": "$285.76",
"sent_via": "sms",
"sent_at": "2026-09-28T16:55:06.000Z",
"skipped_at": null,
"clicked_at": null,
"destination_url": "https://g.page/r/brightfix-repair/review",
"send_after": "2026-09-28T16:55:06.000Z",
"reminder_sent_at": null,
"created_at": "2026-09-28T14:55:06.000Z"
}
],
"has_more": false,
"next_cursor": null
}

See Pagination for how to page through results.


GET /api/v1/reviews/:id

Returns a single review request record.

Scope required: reviews.read

Terminal window
curl "https://app.benchkey.com/api/v1/reviews/1042" \
-H "Authorization: Bearer bk_live_01J8X4_kvWz9nP3mRqTs7uYeBfGhDjLa"
const res = await fetch(
"https://app.benchkey.com/api/v1/reviews/1042",
{ headers: { Authorization: "Bearer bk_live_01J8X4_kvWz9nP3mRqTs7uYeBfGhDjLa" } }
);
const review = await res.json();

Returns the review object. Returns 404 if no review request with that ID exists, or if the associated ticket is soft-deleted or hidden.


POST /api/v1/reviews/request

Manually triggers a review request for a ticket or invoice. BenchKey runs the same pipeline as its automatic review triggers, it checks suppression lists, opt-out flags, consent state, and channel settings before sending. The endpoint returns 202 Accepted regardless of whether a message was actually delivered; check the sent and skipped fields in the response body.

Scope required: reviews.write

You must provide at least one of ticket_id or invoice_id.

  • If you supply only invoice_id, the ticket is derived automatically from the invoice’s linked ticket. If the invoice has no linked ticket, the request returns 400 invalid_field.
  • If you supply both, they must be consistent, the invoice must belong to the given ticket. A mismatch returns 400 invalid_field with code "invoice_id does not belong to ticket_id.".
FieldRequiredDescription
ticket_idconditionalTicket to send the review request for
invoice_idconditionalInvoice ID to send the review request for. If ticket_id is omitted, the ticket is derived from the invoice
Terminal window
curl -X POST https://app.benchkey.com/api/v1/reviews/request \
-H "Authorization: Bearer bk_live_01J8X4_kvWz9nP3mRqTs7uYeBfGhDjLa" \
-H "Content-Type: application/json" \
-d '{ "ticket_id": "TK-2091" }'
const res = await fetch("https://app.benchkey.com/api/v1/reviews/request", {
method: "POST",
headers: {
Authorization: "Bearer bk_live_01J8X4_kvWz9nP3mRqTs7uYeBfGhDjLa",
"Content-Type": "application/json",
},
body: JSON.stringify({ ticket_id: "TK-2091" }),
});
const result = await res.json(); // always 202
{
"object": "review_request_result",
"ok": true,
"sent": true,
"skipped": false,
"reason": null,
"ticket_id": "TK-2091",
"invoice_id": null
}
FieldTypeDescription
okbooleanAlways true when the pipeline ran without error
sentboolean|nulltrue if a message was dispatched to the customer
skippedboolean|nulltrue if the pipeline decided not to send (opt-out, suppression, etc.)
reasonstring|nullHuman-readable reason the request was skipped, or null
ticket_idstring|nullEcho of the provided ticket ID
invoice_idinteger|nullEcho of the provided invoice ID

HTTP statusCodeMeaning
400invalid_idThe :id in the URL is not a valid positive integer
400invalid_queryA list filter parameter was supplied as an array or object instead of a single scalar value
400invalid_fieldA field value is invalid, e.g. status not in the lifecycle set (pending/armed/scheduled/sending/sent/skipped/cancelled), invoice_id not a positive integer or exceeds 2,147,483,647, the invoice has no linked ticket (when ticket_id is omitted), or invoice_id does not belong to the supplied ticket_id
400invalid_sent_viasent_via filter is present but empty
400invalid_ticket_idticket_id filter is present but empty
400invalid_cursorcursor is malformed
400missing_fieldNeither ticket_id nor invoice_id was provided
404not_foundNo review request with that ID exists, or its ticket is deleted/hidden
403insufficient_scopeAPI key lacks reviews.read or reviews.write
422request_failedThe review request pipeline returned an error

See Errors for the full error envelope format.

Status do sistema