TrustReviews.io

Developers

Build on TrustReviews.

Read and reply to reviews, send invitations, import reviews, and show verified customer activity on your site with TrustReview Events. The API is part of the Premium plan ($129/mo).

Getting started

  1. Upgrade to Premium.
  2. Create an API key in the business dashboard (coming soon).
  3. Call the API at the base URL below with the key as a Bearer token.

Authentication

Send your key in the Authorization header: Authorization: Bearer YOUR_API_KEY. Keep keys on your server and never put them in browser code. Base URL: https://trustreviews.io/api/v2/

Status: API keys aren’t issued yet, so every endpoint currently answers 401 unauthorized.

Rate limits

Requests are rate limited per API key. If you go over, you get 429 rate_limited with a Retry-After header. Back off and retry. Batch endpoints have their own size limit.

Errors

Every error returns JSON with error.code, error.message and error.status. Common codes: unauthorized (401), plan_required (403), not_found (404), validation_failed (422) and rate_limited (429).

Versioning

The version is in the path (/api/v2). We add fields without a new version, so ignore fields you don’t know. Breaking changes get a new version and advance notice.

SDKs

For the browser, use trustreviews.js, our frontend SDK for review badges and event notices. Server SDKs for JavaScript, Python and PHP are coming soon. Until then, any HTTP client works.

TrustReview Events guide

The quickest way to send and show events is trustreviews.js: TrustReviews.track("purchase", {...}) sends an event and TrustReviews.events.start() shows them. The details below are for sending from your own server.

Send every event you want shown, like a purchase, to POST /api/v2/events. We screen each one with TrustEvent™, then show it as a small notice in the bottom-left corner of your site, like “Sarah K. from London purchased Pro Plan 3 mins ago”. Each notice links to a public page on our domain where anyone can check it: the verify_url in the response. See a sample verify page.

Hash the user ID

Never send your raw user ID. Send sha256(salt + user_id) as hex, using the per-account salt shown in your dashboard. Use the same hash later to delete a customer’s events.

import { createHash } from "node:crypto";

// Per-account salt from your TrustReviews dashboard. Keep it secret.
const SALT = process.env.TRUSTREVIEWS_SALT;
const idHash = createHash("sha256").update(SALT + String(userId)).digest("hex");

Mask the IP address

Send IPv4 with the last block removed (123.123.123.xxx) and IPv6 cut to /48. Never send a full IP address. We only use it to estimate a city when you don’t send one.

// Keep only the network part of the IP before sending it.
function maskIp(ip) {
  if (ip.includes(".")) return ip.split(".").slice(0, 3).join(".") + ".xxx"; // 123.123.123.xxx
  return ip.split(":").slice(0, 3).join(":") + "::/48";                       // IPv6 → /48
}

Add the notice script

Add the script once to every page where notices should appear. Position, theme and frequency come from notice settings.

<!-- TrustReview Events: add once, before </body> -->
<script src="https://trustreviews.io/widget/events.js"
        data-business="biz_31x9" async></script>

Privacy and consent

  • You are the data controller for the customer data you send. We process it to show and verify notices.
  • Only send events for customers who agreed to be shown, and set consent.consent_given to true. Events without consent are rejected.
  • Send masked IPs only. Photos are optional.
  • Honour erasure requests with DELETE /events/{id} or DELETE /events/by-user/{id_hash}.