Skip to main content
Node 20 or newer. No dependencies.

Setup

The key is your secret key from the dashboard (Settings → API). Keep it on the server.

Your first verdict

Keep verification.id on your side: the API does not echo metadata back. waitFor polls until the verification is completed, expired or failed. It backs off on rate limits and gives up after fifteen minutes unless you pass timeoutMs.

Webhooks instead of waiting

Two events arrive. verification.created carries the ids, the status, your metadata and the templateSlug when it came from a template. verification.completed adds the verdict in its detailed form (label, score, reasonCode, one entry per check), the captures and the answers. For anything else, call verifications.get(event.verificationId). Treat the event as a notification. Before you act on it, confirm with verifications.get(event.verificationId).

Reading results

list filters: status, verdict, reasonCode, from, to, mode, metadata (matches the values you sent at creation), limit, cursor.

Templates

A template is a set of steps published once, with a permanent link.
Everything in the input overrides the template for that one verification: webhookUrl, expiresInSeconds, notifyEmail (null opts out), brandSlug; metadata merges, yours wins.

One verification per row

Databases

Rows your templates compare against: a policy number the person types finds their row, and the expected location or object come from it.

Audits: a photo you already have

No link and no camera: you have the file, Rial analyses it. With no device behind the photo there is no rial flag; you get the checks that tripped.
audits.run uploads, starts the analysis and waits. audits.create does the first two and returns at once; read the result later with verifications.get or a webhook. Add checks: ['ai'] to run AI detection alone — see Only AI detection.

Errors

RialError carries status, code, fields, hint and a message that already says what was wrong: rial API responded 400 (invalid_request): steps.0.conditionAspects: must be a list, got string. Every code and what to do about it: Errors. Reads retry on network errors, 429 and 5xx; writes never retry on their own.

Reference

Inputs and results use camelCase and are typed from the same OpenAPI document as the API reference, so they never drift. Exported types: Verification, LiveVerdict, AuditVerdict, Step, LinkTemplate, ImportJob, Database, VerificationEvent, PublicVerification, WebhookEvent, WebhookVerdict, and the inputs CreateVerificationInput, PublishTemplateInput, MintFromTemplateInput, ListVerificationsFilters, AuditInput, AuditCheck.