Approve or reject reviews in bulk
const url = 'https://apibase.ecomweb.app/api/v1/stores/example/reviews/bulk-moderate';const options = { method: 'PUT', headers: {'x-api-key': '<x-api-key>', 'Content-Type': 'application/json'}, body: '{"review_ids":["example"],"action":"APPROVE","rejected_reason":"example","moderation_notes":"example"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request PUT \ --url https://apibase.ecomweb.app/api/v1/stores/example/reviews/bulk-moderate \ --header 'Content-Type: application/json' \ --header 'x-api-key: <x-api-key>' \ --data '{ "review_ids": [ "example" ], "action": "APPROVE", "rejected_reason": "example", "moderation_notes": "example" }'Approves or rejects up to 100 reviews at once. Each review is updated on its own, so one failure does not stop the others: the response counts the updates and lists a message for each failure, such as a review that does not exist. Approving records the key’s owner as the approver and clears any rejection reason. Product rating statistics are recalculated afterwards.
Required scopes: write:reviews
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”The store’s ref, as returned by GET /stores.
Request Bodyrequired
Section titled “Request Bodyrequired”object
IDs of the reviews to moderate, from 1 to 100.
APPROVE or REJECT.
Why the reviews are rejected. Used when action is REJECT.
Internal notes to store on each review.
Responses
Section titled “Responses”object
Number of reviews updated.
Number of reviews that could not be updated.
One message for each review that failed, such as one that does not exist.
Example generated
{ "updated": 1, "failed": 1, "errors": [ "example" ]}The request is malformed or failed validation.
object
The HTTP status code.
What went wrong; validation failures list one message per problem.
The HTTP status text, such as Bad Request.
object
A stable, machine-readable error code.
A human-readable explanation.
Extra context about the error, when there is any.
object
When the error happened, as an ISO 8601 timestamp.
Example generated
{ "statusCode": 1, "message": [ "example" ], "error": "example"}The key is missing, invalid, revoked or expired.
object
The HTTP status code.
What went wrong; validation failures list one message per problem.
The HTTP status text, such as Bad Request.
object
A stable, machine-readable error code.
A human-readable explanation.
Extra context about the error, when there is any.
object
When the error happened, as an ISO 8601 timestamp.
Example generated
{ "statusCode": 1, "message": [ "example" ], "error": "example"}The key may not do this: a missing scope, a readonly key, a publishable key on a Store API route, or a disallowed origin.
object
The HTTP status code.
What went wrong; validation failures list one message per problem.
The HTTP status text, such as Bad Request.
object
A stable, machine-readable error code.
A human-readable explanation.
Extra context about the error, when there is any.
object
When the error happened, as an ISO 8601 timestamp.
Example generated
{ "statusCode": 1, "message": [ "example" ], "error": "example"}