Generate AI response

Synchronously calls the ReviewData AI provider to draft a reply for a review, persists an AiReviewResponse row, and counts 1 unit against the store's ai_response plan quota (hard-stop plans return 403 once exhausted; soft-stop plans bill the call as overage).

Auth: Both — authentication. The target store_id/review_id must sit inside your own account tree: the store (and the review's store) must resolve to a company that is the authenticated user's own person.company_id or a descendant of it. Partner (bundle_id=1) and Account (bundle_id=3) roles use the same endpoint; only the reachable part of the account tree differs.

Rate limit: No rate limit.

Request

  • Body:
FieldTypeRequiredNotes
store_idintegeryesMust exist in stores and belong to the auth company hierarchy (an ownership check).
review_idintegeryesMust be an existing review, belong to the auth company hierarchy, and its store_id must equal the given store_id (cross-field check in withValidator).
tonestringnoOne of professional, casual, empathetic, apologetic, grateful, neutral. Defaults to professional.
stylestringnoFree-text style hint, max 500 chars.
owner_instructionsstringnoFree-text instructions to the model, max 1000 chars.

The controller also pulls review_text and rating from the resolved review itself — they are not client-supplied.

Response{ data. } envelope. On success the controller returns { success: true, data: <service result> } wrapped, plus ai_response feature headers via withFeatureHeaders.

  • data.success (boolean) — always true on the happy path.
  • data.data.response_text (string) — the generated reply text.
  • data.data.model (string) — model id used, e.g. gpt-4.1-mini.
  • data.data.tokens (object) — { input, output, total } token counts (integers).
  • data.data.task_id (string) — ReviewData task id.
  • data.data.foreign_key (string) — RD foreign key.
  • data.data.ai_review_response_id (integer) — id of the persisted AiReviewResponse row.
  • data.data.remaining (integer|null) — remaining quota, null when uncapped.
  • data.data.overage (boolean) — whether this call was billed as overage.
  • data.data.usage_log_id (integer) — usage record id.

Failures: 403 quota exceeded / feature disabled, 422 validation, 502 provider unreachable; review-not-found returns an error envelope.

Errors: 422 on validation failure.

Recent Requests
Log in to see full request history
TimeStatusUser Agent
Retrieving recent requests…
LoadingLoading…
Body Params
integer
integer
string
string
string
Responses

Language
Credentials
Bearer
JWT
URL
LoadingLoading…
Response
Click Try It! to start a request and see the response here! Or choose an example:
application/json