What you need
Think of it in three plain pieces:| Piece | What it is |
|---|---|
| Secret key | A password-like string Suki puts on your partner record and shares with you during partner onboarding. Only your server should know it. |
generated-at header | A number: Unix time in milliseconds when Suki built this request. You need it as part of the signed text. |
X-API-Key header | The expected signature for this request, already turned into hex text. Your job is to compute the same hex and see if they are equal. |
Content-Type: application/json. Your handler reads the raw body and the two headers above before you trust the payload.
How to verify on your server
Perform the following steps on your server:Read the raw body first
Read the request body before you parse JSON. Keep the exact bytes or string Suki sent (no pretty-printing, no trimming, no changing spaces).
Read the generated-at header
Read the
generated-at header exactly as the string Suki sent (the millisecond timestamp).Build the string to sign
Join
generated-at + : + raw body into one long string. Example shape: 1765977748432:{"status":"success",...} (your timestamp and JSON will differ).Run HMAC-SHA-256
Run HMAC-SHA-256 using your secret key as the key and that long string as the data. HMAC-SHA-256 is a standard “sign this text with this secret” operation; every language has a library for it.
Encode the digest as hex
Turn the HMAC output into hex the same way Suki does (usually lowercase hex; if your comparison fails, ask your Suki contact whether casing matters).
Code examples
The examples below follow the pseudocode above line for line.- Python
- TypeScript
status and processes _links, refer to the Asynchronous notifications (webhook) API reference.
After verification
Once the signature matches:- Parse the JSON body.
- Read the top-level
statusfield and branch on"success"or"failure". - Use
session_id,encounter_id, and_linksas described in Payload & Response.
Security best practices
Verify requests are from Suki
Verify requests are from Suki
Implement HMAC-SHA-256 verification using your secret key, the
generated-at header, the raw body, and the X-API-Key header as described above.Validate the payload
Validate the payload
After the signature matches, check the JSON shape and
status. Reject malformed or unverified requests with an appropriate 4xx response.Store the secret key securely
Store the secret key securely
Keep the partner secret key in a secrets manager (for example AWS Secrets Manager or Azure Key Vault), not in source control.
Use HTTPS only
Use HTTPS only
Your callback URL must use HTTPS with TLS 1.2 or higher. Suki will not send webhooks to HTTP URLs. See Configuration.