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:
| Field | Type | Required | Notes |
|---|---|---|---|
store_id | integer | yes | Must exist in stores and belong to the auth company hierarchy (an ownership check). |
review_id | integer | yes | Must 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). |
tone | string | no | One of professional, casual, empathetic, apologetic, grateful, neutral. Defaults to professional. |
style | string | no | Free-text style hint, max 500 chars. |
owner_instructions | string | no | Free-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) — alwaystrueon 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 persistedAiReviewResponserow.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.
| Time | Status | User Agent | |
|---|---|---|---|
Retrieving recent requests… | |||
