Rokh API documentation#
Rokh does live identity verification for Iranian documents. Your customer uses the camera of a phone. Rokh examines a document, the face and, if you ask for it, a spoken declaration. Your server then receives the decision, the score and the evidence.
This documentation tells you how to connect your service to Rokh.
What you can do#
You can use Rokh in four ways. All four use the same requests and the same results.
| Way | What the customer sees | Use it when |
|---|---|---|
| Customer link | The Rokh page on https://rokh.id |
You send a link by SMS, email or chat. |
| Your own site | The Rokh steps inside a page of your site, on your domain | You want the customer to stay on your site. |
| Return to your site | The Rokh page, then your page again | Your site opens the Rokh page and expects the customer back. |
| Your domain | The Rokh page on a hostname of your domain, for example https://kyc.example.com |
You want your address in the address bar of the customer. |
Read Your own site for the second and the third way. Read Your domain for the fourth way.
Before you start#
You must have these items:
- A Rokh vendor account. Apply on
https://rokh.id/signup. The Rokh operations team gives you a user name and a temporary password. - An API key. Make the key in the vendor panel. Read Authentication.
- A server that can send HTTPS requests. Keep the API key on this server only.
Quick start#
Do these steps to verify one customer.
- Sign in to the vendor panel at
https://rokh.id/vendor. - Open Developers. In API keys, make a key. Copy the key to the secret store of your server.
- Send a request from your server:
curl -X POST https://rokh.id/api/vendor/requests \
-H "Authorization: Bearer $ROKH_API_KEY" \
-H "Idempotency-Key: order-10493" \
-H "Content-Type: application/json" \
-d '{
"customer_label": "order-10493",
"expires_in_hours": 72,
"expected_fields": {"full_name": "سارا محمدی", "birthday": "1372/05/14", "birthday_calendar": "jalali"},
"flow_policy": {"allowed_document_types": ["smart_id", "passport"]}
}'
- Read
customer_urlin the response. Give this link to your customer. - Wait for the
request.completedwebhook. As an alternative, read the request again from time to time. - Read the result:
GET /api/vendor/requests/{id}/report.json.
Read Requests for all fields of a request.
Base address and format#
- The base address is
https://rokh.id. - All request and response bodies use JSON in UTF-8, unless the page tells you a different format.
- All times use ISO 8601 with a time zone, for example
2026-10-12T08:30:00+00:00. - Persian text stays in Persian script. Rokh does not change the spelling of names that you send.
Pages of this documentation#
| Page | Contents |
|---|---|
| Authentication | API keys, the panel session, security rules |
| Requests | Make, find, revoke and reissue a request. All request settings. |
| Customer flow | The steps that the customer does, time limits, attempts, supported phones |
| Your own site | Show the steps in your site. The SDK, events, the return address. |
| Your domain | Show the steps on a hostname of your domain. DNS records, certificate, status. |
| Results and evidence | The report, the decision, the score, recordings and photos |
| Webhooks | Events, signatures, retries |
| Account | Profile, colours of the customer page, password |
| Errors | Error format and status codes |
| API reference | All endpoints in one table. The OpenAPI file. |
| Glossary | Technical names, and the rules for the text of this documentation |
| Changes | Changes to the API |
Important rules#
- Rokh does not have access to an Iranian registry. The report always shows
issuer_verification.statusasnot_performed. - The customer never sees the decision, the score or a reason for a mismatch. Only you receive them.
- The decision comes from the required checks only. The score does not change the decision.
- The score is not a probability that an identity is genuine.