RKH

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:

  1. A Rokh vendor account. Apply on https://rokh.id/signup. The Rokh operations team gives you a user name and a temporary password.
  2. An API key. Make the key in the vendor panel. Read Authentication.
  3. A server that can send HTTPS requests. Keep the API key on this server only.

Quick start#

Do these steps to verify one customer.

  1. Sign in to the vendor panel at https://rokh.id/vendor.
  2. Open Developers. In API keys, make a key. Copy the key to the secret store of your server.
  3. 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"]}
  }'
  1. Read customer_url in the response. Give this link to your customer.
  2. Wait for the request.completed webhook. As an alternative, read the request again from time to time.
  3. Read the result: GET /api/vendor/requests/{id}/report.json.

Read Requests for all fields of a request.

Base address and format#

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 vendor API. The text follows ASD-STE100 Simplified Technical English.