API reference
Verifications API
A verification session runs one published flow for one customer. Create it, send the customer to its link, and read its outcome.
Read the Verification sessions guide for the lifecycle and the Reading results guide for the steps array.
The verification session object
One run of a flow for one customer. Webhooks carry the same object in data.
Attributes
idstringUnique id of the session.
flowCodestringCode of the flow the session runs.
statusenumWhere the session is in its lifecycle. See Verification sessions.
Values
createdin_progresscompletedexpiredcancelledoutcomeenumnullableThe end of the flow the customer reached. Set when
statusiscompleted.Values
approvedmanual_reviewrejectedexternalRefstringnullableYour id for the customer.
metadataobjectnullableThe data you sent when you created the session.
localestringnullableLanguage of the link.
currentNodeIdstringnullableThe step the customer is on.
nullbefore the start and after the end.stepsarrayThe steps the customer went through, in order. See Reading results.
Show child attributes
nodeIdstringId of the step in the flow.
serviceCodestringThe service of the step. See Services.
statusenumpendingwhile the result is not known yet, thencompleted.Values
pendingcompletedoutcomestringnullableThe outcome key of the service, such as
match.resultobjectnullableWhat the check engine reported.
Show child attributes
providerstringThe engine that checked the step.
providerVersionstringnullableEngine or model version, where reported.
referencestringnullableThe engine id of this check.
scorenumbernullableFrom 0 to 1, where the engine gives a score.
reasonsstring[]Machine-readable reasons, empty when the check passed.
dataobjectWhat the check found. Fields differ per service.
submittedAtdatetimeWhen the customer submitted the step.
completedAtdatetimenullableWhen the result arrived.
expiresAtdatetimeWhen the link stops working.
startedAtdatetimenullableWhen the customer started.
completedAtdatetimenullableWhen the session reached an end or was cancelled.
createdAtdatetimeWhen the session was created.
{
"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"
}Create a verification session
POST/v1/verifications
Starts a session for a published flow and returns it with the one-time url for the customer. Sends verification.created.
Headers
Idempotency-KeystringMakes the request safe to retry: the same key and body return the first response for 24 hours. 8 to 128 characters. See Idempotent requests.
Body parameters
flowCodestringrequiredThe
codeof a published flow.externalRefstringYour own id for the customer, up to 255 characters.
localeenumLanguage of the link. Persian when not set.
Values
faenredirectUrlstringWhere the final screen sends the customer when the session is completed. http or https, up to 2048 characters.
metadataobjectYour own data, up to 20 keys and 4 KB as JSON. Returned on the session and in webhooks.
expiresInMinutesintegerLink lifetime in minutes, from 5 to 43200 (30 days).
Default
1440
Returns
The session object with url, HTTP 201. url is not returned again by any other endpoint.
Errors
400A field is invalid. Seeresponse.fields.400The flow is not published.404No flow with this code in your company.400TheIdempotency-Keyis invalid, was used with another body or is still running.
curl -X POST https://api.myid.ir/v1/verifications \
-H "Authorization: Bearer $MYID_API_KEY" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: signup-customer-1042" \
-d '{
"flowCode": "01JD7YQK2D1C4M2V7R9T3B6N8P",
"externalRef": "customer-1042",
"locale": "fa",
"redirectUrl": "https://shop.example/kyc/done",
"metadata": {
"plan": "gold"
},
"expiresInMinutes": 1440
}'{
"response": {
"status": "success"
},
"data": {
"id": "01JD7Z1W3J8X0V4Q9T6M2K5R8N",
"flowCode": "01JD7YQK2D1C4M2V7R9T3B6N8P",
"externalRef": "customer-1042",
"metadata": {
"plan": "gold"
},
"locale": "fa",
"status": "created",
"outcome": null,
"currentNodeId": null,
"steps": [],
"expiresAt": "2026-12-01T09:40:00.000Z",
"startedAt": null,
"completedAt": null,
"createdAt": "2026-11-30T09:40:00.000Z",
"url": "https://verify.myid.ir/v/2lKq0bX4mN8wVr7cT1yHs9fJdE3uPa6zQo5gLi2kRxM"
}
}{
"response": {
"status": "validation-error",
"message": "Validation failed.",
"fields": [
{
"property": "flowCode",
"constraints": [
"This field is required."
]
},
{
"property": "expiresInMinutes",
"constraints": [
"Must be at most 43200."
]
}
]
}
}List verification sessions
GET/v1/verifications
Returns the sessions of your company, newest first. Filter by status, by your own id or by flow.
Query parameters
pageintegerPage number, from
1.Default
1pageSizeintegerRows per page.
Values
102050Default10sortstringSort field; prefix
-for descending, such as-createdAt.statusenumOnly sessions with this status.
Values
createdin_progresscompletedexpiredcancelledexternalRefstringOnly sessions with this
externalRef.flowCodestringOnly sessions of this flow.
Returns
A paginated list of session objects.
curl "https://api.myid.ir/v1/verifications?status=completed&externalRef=customer-1042&pageSize=20" \
-H "Authorization: Bearer $MYID_API_KEY"{
"response": {
"status": "success"
},
"data": {
"list": [
{
"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"
}
],
"count": 1,
"page": 1,
"pageSize": 20,
"pageCount": 1
}
}Retrieve a verification session
GET/v1/verifications/{id}
Returns a session with its status, outcome and the result of every step.
Path parameters
idstringrequiredThe
idof the session.
Returns
The session object.
Errors
404No session with this id in your company.
curl https://api.myid.ir/v1/verifications/01JD7Z1W3J8X0V4Q9T6M2K5R8N \
-H "Authorization: Bearer $MYID_API_KEY"{
"response": {
"status": "success"
},
"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"
}
}Cancel a verification session
POST/v1/verifications/{id}/cancel
Cancels an open session. The link stops working at once and verification.cancelled is sent.
Path parameters
idstringrequiredThe
idof the session.
Returns
The session object with status: "cancelled".
Errors
400The session is already completed, expired or cancelled.404No session with this id in your company.
curl -X POST https://api.myid.ir/v1/verifications/01JD7Z1W3J8X0V4Q9T6M2K5R8N/cancel \
-H "Authorization: Bearer $MYID_API_KEY"{
"response": {
"status": "success"
},
"data": {
"id": "01JD7Z1W3J8X0V4Q9T6M2K5R8N",
"flowCode": "01JD7YQK2D1C4M2V7R9T3B6N8P",
"externalRef": "customer-1042",
"metadata": {
"plan": "gold"
},
"locale": "fa",
"status": "cancelled",
"outcome": null,
"currentNodeId": null,
"steps": [],
"expiresAt": "2026-12-01T09:40:00.000Z",
"startedAt": null,
"completedAt": "2026-11-30T09:55:12.000Z",
"createdAt": "2026-11-30T09:40:00.000Z"
}
}