HMAC sign
Try it interactively →POST /api/hmac-signCompute HMAC signatures over an HTTP API. SHA-1, SHA-256, SHA-384, or SHA-512 with a shared secret. Returns the signature in hex, standard base64, and URL-safe base64 — match whichever your verifier expects.
Inputs
| Name | Type | Default | Description |
|---|---|---|---|
| data* | string | — | Message to sign (UTF-8 string by default; base64 if dataFormat=base64). |
| secret* | string | — | Shared secret (UTF-8 string by default; base64 if secretFormat=base64). |
| algorithm | enum (SHA-1 | SHA-256 | SHA-384 | SHA-512) | "SHA-256" | Hash algorithm. |
| dataFormat | enum (text | base64) | "text" | How `data` is encoded. `text` = UTF-8; `base64` for binary inputs. |
| secretFormat | enum (text | base64) | "text" | How `secret` is encoded. `text` = UTF-8; `base64` for binary keys. |
Response
Modes: json. Cache: yes (24h TTL).
Code samples
Built from the sha256-default example.
curl -X POST https://api.xtract.bot/api/hmac-sign \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-H "X-Account-Id: $XTRACT_ACCOUNT_ID" \
-H "X-Api-Key: $XTRACT_API_KEY" \
-d '{
"data": "{\"event\":\"order.created\",\"id\":\"ord_123\"}",
"secret": "whsec_replace_me_in_production"
}'