Pochuto API
Public API for integrating Pochuto with your CRM and your own systems: reviews, statistics and webhooks.
Authentication
Send the key in the Authorization: Bearer <key> header of every request. Create a key in
the Pochuto business dashboard, in your profile, under "API". The key is shown only once: store it like a
password and never put it in code that reaches a browser or a mobile app.
Limits
Per-key request limits per minute and trial restrictions are described in the "Limits" section of the API
description below. When a limit is exceeded the API returns 429 rate_limited.
Verifying a webhook signature
Every webhook is signed. The X-Pochuto-Timestamp header holds the send time (Unix seconds),
and X-Pochuto-Signature holds v1=<hex>, where hex is the HMAC-SHA256 of the
string <timestamp>.<raw request body> keyed with the subscription secret
(whsec_...). Verify the signature over the raw body before parsing JSON, compare with
timingSafeEqual, and reject requests whose timestamp differs from your clock by more than
5 minutes.
import { createHmac, timingSafeEqual } from "node:crypto";
const TOLERANCE_SECONDS = 5 * 60;
export function verifyWebhook(secret, headers, rawBody) {
const timestamp = Number(headers["x-pochuto-timestamp"]);
if (!Number.isInteger(timestamp)) return false;
if (Math.abs(Date.now() / 1000 - timestamp) > TOLERANCE_SECONDS) return false;
const expected = Buffer.from(
"v1=" + createHmac("sha256", secret).update(`${timestamp}.`).update(rawBody).digest("hex"),
);
const received = Buffer.from(String(headers["x-pochuto-signature"] ?? ""));
return expected.length === received.length && timingSafeEqual(expected, received);
}
Warning. Do not offer customers a reward, discount or bonus for a review: Google's policies prohibit it, incentivized reviews can be removed, and the business can be penalized.