X-SmartAlex-Signature header. You compute the same signature from the raw body and your workspace’s signing secret, and reject the request if they differ. A Custom request is not signed, so this page does not apply to it.
In the app: Sidebar → Agent Settings → APIs → API actions → Signing secret and limits (
/home?settings=http_tools). The secret starts with shs_. Reveal shows it and Rotate replaces it.How is the signature built and checked?
The diagram shows SmartAlex building the signature and your endpoint recomputing it from the raw body.- Take the raw request body exactly as received. Do not parse and re-serialise it.
- Read
t=(epoch milliseconds) andv1=from the header:X-SmartAlex-Signature: t=1733839200123,v1=4a7c...d6. - Compute
HMAC-SHA256(secret, t + "." + rawBody)and write it as lowercase hex. - Compare it with
v1in constant time (timingSafeEqual,compare_digest,hash_equalsorhmac.Equal, never==). - We recommend rejecting a
tmore than 5 minutes old or more than 1 minute in the future, to stop replays. SmartAlex does not enforce this for you.
shs_ prefix. Use the whole value, prefix included, as the HMAC key.
What do the verify functions look like?
Each function takes the raw body and returns true or false. Code samples shows them inside full handlers.How do I show or rotate the signing secret?
1
Open the secret controls
On the API actions tab, open Signing secret and limits.
2
Reveal it
Click Reveal and confirm “Reveal the signing secret?”. Anyone who sees it can sign requests to your endpoints as SmartAlex, so keep it in your secrets store.
3
Or rotate it
Click Rotate and confirm “Rotate the signing secret?”. The old secret stops working at once, so your endpoint refuses our requests until you update it. There is no grace period.
Why does the signature never match?
Questions people ask
Do I need to verify signatures?
Do I need to verify signatures?
It is the only proof a request came from SmartAlex. Anyone who learns your URL can call it, so verify, and also protect the endpoint with the key from API key.
Does a Custom request carry a signature?
Does a Custom request carry a signature?
No. A custom request is sent as written, so your endpoint relies on the key you place in it.
Related
Code samples
Full handlers for Node, Python, PHP and Go.
Request and response
The body you are signing.

