Guides
Webhooks
myid sends an HTTP POST to your server when something happens to a session. This is how you learn the result without polling.
Add an endpoint
- In the panel, open Developers → Webhooks and add your URL. It must be a public https address.
- Choose the events the endpoint receives.
- Copy the signing secret (
whsec_…). It is shown only once; you can rotate it later. - Press Send test event to check your receiver. A company can have up to 10 endpoints.
Events
| Event | Sent when |
|---|---|
verification.created | A session was created. |
verification.started | The customer opened the link and started. |
verification.step_completed | One step of the flow has a result. |
verification.completed | The customer reached an end of the flow. outcome is set. |
verification.expired | The session expired before it was completed. |
verification.cancelled | You cancelled the session. |
webhook.ping | You pressed Send test event. Every endpoint receives it. |
Payload
The body is JSON with id, type, createdAt and data. For session events, data is the session in the same shape the API returns.
{
"id": "01JD7Z4C9QW2N8B5X3R6T1M7KD",
"type": "verification.completed",
"createdAt": "2026-11-30T09:42:33.512Z",
"data": {
"id": "01JD7Z1W3J8X0V4Q9T6M2K5R8N",
"flowCode": "01JD7YQK2D1C4M2V7R9T3B6N8P",
"externalRef": "customer-1042",
"metadata": {
"plan": "gold"
},
"locale": "fa",
"status": "completed",
"outcome": "approved",
"currentNodeId": null,
"steps": [
{
"nodeId": "n_shahkar",
"serviceCode": "shahkar_match",
"status": "completed",
"outcome": "match",
"result": {
"provider": "jibit",
"score": null,
"reasons": [],
"data": {
"nationalCode": "00******48",
"mobile": "0912*****67",
"cached": false
}
},
"submittedAt": "2026-11-30T09:41:07.000Z",
"completedAt": "2026-11-30T09:41:08.000Z"
},
{
"nodeId": "n_face",
"serviceCode": "registry_face_match",
"status": "completed",
"outcome": "match",
"result": {
"provider": "ai_engine",
"providerVersion": "face-v2",
"reference": "req_8f2c1a",
"score": 0.932,
"reasons": [],
"data": {
"nationalCode": "00******48",
"referenceSource": "civil_registry",
"similarity": 93.2,
"thresholds": {
"match": 80,
"suspicious": 60
}
}
},
"submittedAt": "2026-11-30T09:42:31.000Z",
"completedAt": "2026-11-30T09:42:33.000Z"
}
],
"expiresAt": "2026-12-01T09:40:00.000Z",
"startedAt": "2026-11-30T09:41:02.000Z",
"completedAt": "2026-11-30T09:42:33.000Z",
"createdAt": "2026-11-30T09:40:00.000Z"
}
}Headers
| Header | Value |
|---|---|
myid-signature | t=unix seconds,v1=hex signature. See below. |
myid-event | The event type, same as type. |
myid-delivery | The delivery id, same as id. It stays the same across retries. |
user-agent | myid-webhooks/1 |
Checking the signature
Check every request before you trust it. The signature is an HMAC-SHA256 of the timestamp and the raw body, keyed with your endpoint secret:
- Read the raw request body as bytes, before any JSON parsing.
- Split the
myid-signatureheader intotandv1. - Compute
HMAC_SHA256(secret, t + "." + body)as hex and compare it withv1in constant time. - Reject the request if
tis more than 300 seconds away from your clock.
import crypto from 'node:crypto';
import express from 'express';
const app = express();
const secret = process.env.MYID_WEBHOOK_SECRET; // whsec_…
// Keep the raw bytes: the signature is computed over the body exactly as sent.
app.post('/webhooks/myid', express.raw({ type: 'application/json' }), (req, res) => {
const header = req.get('myid-signature') ?? '';
const parts = Object.fromEntries(header.split(',').map((p) => p.split('=')));
const expected = crypto
.createHmac('sha256', secret)
.update(`${parts.t}.${req.body}`)
.digest('hex');
const fresh = Math.abs(Date.now() / 1000 - Number(parts.t)) < 300;
const valid =
fresh &&
typeof parts.v1 === 'string' &&
parts.v1.length === expected.length &&
crypto.timingSafeEqual(Buffer.from(parts.v1), Buffer.from(expected));
if (!valid) return res.sendStatus(400);
const event = JSON.parse(req.body);
// Answer fast; do the work in a queue. Ignore ids you have already handled.
res.sendStatus(200);
});Responses and retries
Answer with any 2xx status within 10 seconds. Do slow work in the background. If your server answers with another status or times out, myid retries up to 8 times with exponential backoff starting at 30 seconds (about 30 s, 1 min, 2 min and so on). Every delivery is in the panel log, where you can also send it again.
Duplicates and order
A delivery can arrive more than once, and events can arrive out of order. Save the id of each handled delivery and skip ids you have seen. For decisions, use the session in the payload or fetch the latest one with GET /v1/verifications/:id.
Testing
The test event webhook.ping is signed like every other event. Its data holds the endpoint code:
{
"id": "01JD7Z5H0KX1C7V3B9N2M4Q6RS",
"type": "webhook.ping",
"createdAt": "2026-11-30T09:30:00.000Z",
"data": {
"endpoint": "01JD7Y8M3F6P1Q9R2S5T4V7W0X"
}
}