Skip to Content
GuidesDevelopersResources
API actions

Verify that an action call comes from Botello

Every API action call is signed with your workspace’s secret. Verify the signature to reject any call that does not come from Botello.

On requestThe Botello team turns this feature on for your workspace. Contact us to get it.
Plans
All plans
Roles
Owner, Admin
In the admin
Integrations › Developers › Signed action calls

Your API receives Botello action calls from the internet. Authentication (key, token) proves the caller knows your secret; the signature also proves that the request was built by Botello, at that moment, for that method and route, and that it has not been modified. Every action call is signed, with no setup on your side.

Best for

An API that writes (booking, ticket, cancellation), or that exposes customer data: reject any unsigned call.

Before you start

  • You have at least one API action.
  • You are an Owner or Admin of the workspace.
  • Your server can read the method, the path with query string as received, and the raw body.

The signature headers

Every call carries:

HeaderContent
X-Botello-TimestampThe time of the call, in Unix seconds
X-Botello-Request-IdA unique ID for the call, req_ followed by 32 hexadecimal characters
X-Botello-Signaturesha256= followed by the hex-encoded HMAC-SHA256 of the signed string

The signed string is:

<timestamp>.<METHOD>.<path>?<query>.<body>
  • <timestamp>: the value of X-Botello-Timestamp;
  • <METHOD>: uppercase, GET, POST, PUT, PATCH or DELETE;
  • <path>?<query>: the path and query string of the called URL, as sent (encoding included), without the domain. With no query, the path alone, without ?;
  • <body>: the raw JSON body. For GET and DELETE, it is empty: the signed string then ends with a dot.

The HMAC key is your workspace signing secret, which starts with botsig_. It is the same for all actions in the workspace.

Example of a signed string for a call to GET https://api.exemple.ch/orders/1001?email=jeanne%40example.com:

1791364200.GET./orders/1001?email=jeanne%40example.com.

Method and route are signed

A captured request cannot be replayed on another route, with another method, or later: the timestamp is part of the signed string.

Get the secret

Open the Developers page

Open Integrations, then on the Developers card, click Configure. Scroll down to the Signed action calls section.

Show the secret

In Signed action calls, click Show the secret. Copy it into your server configuration, for example into the BOTELLO_ACTION_SECRET variable. Each reveal is recorded in the audit log.

The Signed action calls section: Show the secret and Renew buttons, Node.js verification example and Copy button
The same Node.js example is available in full further down, in Node.js, PHP and Python.

Verify in your API

Add the verification below in front of the routes Botello calls. Reject with 401 any call whose signature is missing, invalid or too old.

Verification code

botello-signature.js (Express)
import express from 'express';
import crypto from 'node:crypto';

const SECRET = process.env.BOTELLO_ACTION_SECRET; // "botsig_…"
const TOLERANCE_SECONDS = 300;

const app = express();
// Keep the raw body next to the parsed one.
app.use(express.json({ verify: (req, _res, buf) => { req.rawBody = buf.toString('utf8'); } }));

function verifyBotelloCall(req, res, next) {
  const timestamp = Number(req.get('X-Botello-Timestamp'));
  if (!Number.isFinite(timestamp) || Math.abs(Date.now() / 1000 - timestamp) > TOLERANCE_SECONDS) {
    return res.sendStatus(401);
  }
  // req.originalUrl = path + query exactly as received (not rewritten by routers).
  const signed = `${timestamp}.${req.method.toUpperCase()}.${req.originalUrl}.${req.rawBody ?? ''}`;
  const expected = 'sha256=' + crypto.createHmac('sha256', SECRET).update(signed).digest('hex');
  const given = req.get('X-Botello-Signature') ?? '';
  const a = Buffer.from(given);
  const b = Buffer.from(expected);
  if (a.length !== b.length || !crypto.timingSafeEqual(a, b)) return res.sendStatus(401);
  next();
}

app.get('/orders/:number', verifyBotelloCall, (req, res) => {
  res.json({ order: { status: 'shipped', carrier: 'La Poste' } });
});

app.post('/bookings', verifyBotelloCall, (req, res) => {
  res.status(201).json({ booking: { id: 'BK-1A2B3C', date: req.body.date, status: 'confirmed' } });
});

app.listen(3000);

Behind a proxy or gateway

If a proxy rewrites the path before it reaches your application (prefix removed, /api added), the signature no longer matches. Verify against the path as Botello called it, the one in the action’s URL.

Renew the secret

In Signed action calls, click Renew and confirm. Subsequent calls are signed immediately with the new secret: unlike webhooks, there is no overlap period. Between the click and the update of your API, calls signed with the new secret are rejected. To shrink that window:

  1. Prepare your API to accept a list of secrets: accept the call if the signature matches any of them.
  2. At a quiet time, click Renew, copy the new secret and add it to the list, next to the old one. Deploy.
  3. Remove the old secret from the list.

The secret is created automatically on the first action call: an action call is always signed.

Troubleshooting

What you seeLikely causeFix
Signature always invalid on POSTThe body was decoded then re-encodedSign the raw body (Express verify, php://input)
Signature invalid when the URL has special charactersThe path used is decoded (%40 turned into @)Use the raw target (req.originalUrl, REQUEST_URI, RAW_URI)
Signature invalid on GETThe trailing dot is missingFor an empty body, the signed string ends with .
Signature invalid after a renewalThe API still uses the old secretSet the new secret, or accept both during the switch
Signature invalid “now and then”Your server’s clock is offSynchronize the time (NTP)
The API key appears in the signed stringYour key is sent in the URL (The URL)Expected: the signature covers the final URL. Prefer a key in a header

Frequently asked questions

Learn more

Was this page helpful?
Checked against the product on 14 November 2026 Suggest a fix

On this page