Guides
Verification sessions
A verification session is one run of one flow for one customer. You create it with the API, the customer completes it through the secure link, and its outcome tells you what to do with the customer.
Statuses
A session moves through these statuses. Only created and in_progress are open.
| Status | Meaning |
|---|---|
created | The session exists and the link is ready. The customer has not opened it yet. |
in_progress | The customer opened the link and started the steps. |
completed | The customer reached an end of the flow. outcome is set. |
expired | The link expired before the customer finished. |
cancelled | You cancelled the session. The link no longer works. |
Outcome
When the status is completed, outcome says which end of the flow the customer reached. Your flow decides which step results lead to which end.
| Outcome | What to do |
|---|---|
approved | All required checks passed. Activate the customer. |
manual_review | A check needs a person to look at it. Review it before you decide. |
rejected | A check failed. Do not activate the customer. |
Options when you create a session
| Field | Use it for |
|---|---|
externalRef | Your own id for the customer (up to 255 characters). Filter sessions by it with GET /v1/verifications?externalRef=…. |
metadata | Up to 20 keys of your own data (4 KB as JSON). It comes back on the session and in webhooks. |
locale | fa or en: the language the link opens in. Persian is the default. |
redirectUrl | An https or http address to send the customer to when they finish. |
expiresInMinutes | How long the link stays valid: 5 to 43,200 minutes (30 days). Default 1,440 (24 hours). |
Tracking a session
The webhook events tell you about every change. You can also fetch the session at any time:
curl https://api.myid.ir/v1/verifications/01JD7Z1W3J8X0V4Q9T6M2K5R8N \
-H "Authorization: Bearer $MYID_API_KEY"Cancelling
Cancel an open session with POST /v1/verifications/:id/cancel, for example when the customer closes their account. The link stops working at once and verification.cancelled is sent. A completed, expired or cancelled session cannot be cancelled.