> ## Documentation Index
> Fetch the complete documentation index at: https://idto.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# KYC Workflow

> Run a multi-step KYC flow (PAN, Aadhaar, bank account, face match) for an end customer using a hosted Verification Link, with no orchestration UI of your own to build.

A real onboarding check is rarely one call. You need mobile verification, a PAN check, a bank account check, a face match, maybe more, run in a fixed order for one person, with a single combined result at the end. Building that sequencing, state machine and UI yourself is real work. idto's **Verification Links** do it for you: you configure the sequence once, mint a link, hand it to the end customer, and get one result back when they finish.

> [!NOTE]
>
> This guide covers what a developer can call directly. Creating and managing a workflow template and a verification link happens in the idto merchant dashboard, authenticated with your dashboard login, not with the `X-Client-ID` / `X-API-Key` pair used everywhere else in this API. The dashboard-issued session token is a separate credential (`DashboardSession` in the API reference) scoped only to link and webhook management, it is not something your backend mints with its API key. If you need links minted entirely from your own backend without a human in the loop, that isn't available today, talk to your idto contact.

## How it fits together

**1. Build the workflow and mint a link (dashboard)**

In the dashboard's workflow builder, pick the modules that should run, in order, for example `mobile_verification`, `pan_validation`, `aadhaar_verification`, `bank_verification`, `face_match`. This becomes a workflow template. From there, mint a **verification link** against that template: give it a label, a run budget (`max_runs`), and an expiry (`expires_in_days`, capped per your account). The dashboard returns a shareable URL:

```json theme={null}
{
  "id": "8f14e45f-ceea-467e-bd93-4a2c11e0a1b2",
  "token": "lnk_8f3a2b91c4d5e6f7",
  "url": "https://try.idto.ai/v/lnk_8f3a2b91c4d5e6f7",
  "label": "Vendor onboarding KYC",
  "workflow_template_id": "b6e1f2a0-1234-4abc-9def-0123456789ab",
  "max_runs": 100,
  "runs_used": 0,
  "runs_left": 100,
  "expires_at": "2026-10-14T10:15:30Z",
  "revoked_at": null,
  "status": "active"
}
```

A link is `active` until it turns `expired` (past `expires_at`), `spent` (`runs_used` reaches `max_runs`), or `revoked`. Revoking is immediate and permanent, even a session already in progress is cut off. Letting a link expire or run out of runs only blocks *new* sessions, one already under way can still finish.

**2. Send the link to your end customer**

Send the `url` to whoever needs to complete the check, by SMS, email, WhatsApp, wherever makes sense for your product. Opening it runs the hosted flow in their browser, no SDK integration required on your side for this path.

**3. The end customer's browser drives the flow**

These three endpoints have no dashboard-session or API-key auth. They are called directly by the end customer's browser using the opaque link token as the credential, and are rate-limited per IP address instead.

`GET /links/{token}` resolves the link before starting, so the page can show what's coming and whether the link still works:

```bash theme={null}
curl https://prod.idto.ai/links/lnk_8f3a2b91c4d5e6f7
```

```json theme={null}
{
  "label": "Vendor onboarding KYC",
  "brand": {
    "businessName": "SAMPLE TECHNOLOGIES",
    "brandColor": "#111111",
    "theme": "light",
    "blurb": "Quick identity check before we onboard you as a vendor.",
    "site_url": "https://acme.example.com"
  },
  "presentation": { "displayMode": "full_screen" },
  "options": { "skippable": ["pan_validation"] },
  "module_sequence": ["mobile_verification", "pan_validation", "face_match"],
  "workflow_template_id": "b6e1f2a0-1234-4abc-9def-0123456789ab",
  "usable": true,
  "runs_left": 100
}
```

`POST /links/session` starts the actual verification session and returns a `client_token`, the short-lived token the idto SDK is initialized with client-side to run through `module_sequence` in order:

```bash theme={null}
curl --request POST \
  --url https://prod.idto.ai/links/session \
  --header "Content-Type: application/json" \
  --data '{"token": "lnk_8f3a2b91c4d5e6f7"}'
```

```json theme={null}
{
  "client_token": "eyJhbGciOiJIUzI1NiJ9.example.client-token",
  "session_token": "sess_3c9a1e2b7d4f5061",
  "workflow_template_id": "b6e1f2a0-1234-4abc-9def-0123456789ab",
  "module_sequence": ["mobile_verification", "pan_validation", "face_match"],
  "expires_in": 900
}
```

Starting fresh spends one run against the link's budget. If the page reloads mid-flow, pass the `session_token` you already have back into the same call to resume without spending another run:

```json theme={null}
{ "token": "lnk_8f3a2b91c4d5e6f7", "session_token": "sess_3c9a1e2b7d4f5061" }
```

`POST /links/token` re-mints just the `client_token` for an existing session, useful when only the token expired (`expires_in` seconds, 900 in the examples above) but the flow itself is still live:

```bash theme={null}
curl --request POST \
  --url https://prod.idto.ai/links/token \
  --header "Content-Type: application/json" \
  --data '{"token": "lnk_8f3a2b91c4d5e6f7", "session_token": "sess_3c9a1e2b7d4f5061"}'
```

> [!NOTE]
>
> If you call these three endpoints from your own backend on the end customer's behalf, for example to embed the link inside your own app shell, set the `X-idto-End-Customer-IP` header to the real end customer's IP. Otherwise every one of your customers is rate-limited as if they shared one IP address, your server's.

**4. Get the combined result**

Configure a webhook URL and signing secret for your account in the dashboard (**Webhooks** section). Set the secret first: until one exists, deliveries fail. When the session finishes, whatever the outcome, idto POSTs a signed payload to that URL:

```json theme={null}
{
  "session_id": "b6e1f2a0-1234-4abc-9def-0123456789ab",
  "session_token": "sess_3c9a1e2b7d4f5061",
  "status": "completed",
  "outcome": "verified",
  "partial": false,
  "completed_steps": ["mobile_verification", "pan_validation", "face_match"],
  "skipped_steps": [],
  "fallback_steps": [],
  "branch_excluded_steps": [],
  "consents": [
    { "consent_type": "dpdp_processing", "consent_version": "v1", "consented_at": "2026-09-14T10:22:11Z" }
  ],
  "event_id": "evt_b6e1f2a0-1234-4abc-9def-0123456789ab_completed"
}
```

`outcome` is the verdict once `status` reaches `completed`: `verified`, `needs_review`, or `not_verified`. If your webhook is configured to include the report, a `report` object is added once it's ready, with a short-lived presigned `url`, `expires_at`, `content_type` and `filename`, minted fresh on every delivery attempt so it never arrives already expired.

Every webhook carries three headers you should verify before trusting the body:

| Header | Meaning |
| - | - |
| `X-idto-Event-Id` | Stable per-session-completion id, safe to use as an idempotency key on your side. |
| `X-idto-Timestamp` | Unix timestamp the signature was computed over. |
| `X-idto-Signature` | `sha256=<hex>`, an HMAC-SHA256 over `"{timestamp}.{raw_body}"` using your signing secret. |

```python theme={null}
import hashlib
import hmac

def verify_idto_webhook(secret, raw_body, timestamp, signature_header):
    expected = hmac.new(
        secret.encode(),
        (timestamp + ".").encode() + raw_body,
        hashlib.sha256,
    ).hexdigest()
    return hmac.compare_digest("sha256=" + expected, signature_header)
```

Retry your signing secret against both the current and, during a rotation window, the previous secret, since a rotation does not invalidate deliveries already in flight.

## What this guide is not

The SDKs talk to idto through their own session protocol once a `client_token` is in hand, and that protocol is not a public API. Two pieces of it are documented for server use: [Mint an SDK token](https://idto.mintlify.site/api-reference/integration/sdk-token.md) and [Get session state](https://idto.mintlify.site/api-reference/integration/session-state.md). If you are embedding verification in your own app rather than sending customers to a hosted link, integrate the relevant [SDK](https://idto.mintlify.site/sdks/web.md). The full completion payload and its headers are on [Session completed](https://idto.mintlify.site/api-reference/webhooks/session-completed.md).

> [!WARNING]
>
> `mobile_verification` can never be included in a link's `skippable` list, it's how the end customer is identified for the session. Any other module in the sequence can be marked skippable if your workflow allows completing it later.

Was this page helpful? Email us at [tech@idto.ai](mailto:tech@idto.ai?subject=Docs%20feedback%3A%20KYC%20Workflow) with the page link.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.