Developers
Documentation
Verify your users with one API call, a hosted page or SDK for the flow, and a signed webhook with the result.
https://api.xiomid.com/v1Get started
Quickstart
Three steps from a new account to a decision. Start with a test key: nothing is checked for real and nothing is billed.
Get your API key
Sign up, then open Dashboard → Developers → API keys and create a test key. Keep it in an environment variable on your server.
Check the keyexport XIOMID_API_KEY=xsk_test_… # Dashboard → Developers → API keys curl https://api.xiomid.com/v1/me \ -H "Authorization: Bearer $XIOMID_API_KEY"Create an applicant
When a user needs to verify, your server creates an applicant and gets a verification link back. Send the user to
session.url.Create an applicantcurl https://api.xiomid.com/v1/applicants \ -H "Authorization: Bearer $XIOMID_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "externalUserId": "10482", "email": "jane@example.com" }' # The answer: the case and its link # { "applicant": { "id": "apl_7Kq2mX4p", … }, # "session": { "url": "https://verify.xiomid.com/Hx4mP9rT2c", … } }Receive the webhook
Add your endpoint under Developers → Webhooks. When the checks finish, xiomid posts the decision to it, signed with the endpoint’s secret.
The webhook you receivePOST /webhooks/xiomid X-Xiomid-Event: applicant.reviewed X-Xiomid-Signature: t=1794821500,v1=5f2b9c0e… { "type": "applicant.reviewed", "externalUserId": "10482", "decision": "approved", … }Next: verify the signature, then read the report. Prefer to hand it off? Use an AI agent.
Authentication
Every request needs a secret key, sent as a Bearer token in the Authorization header.
Authorization: Bearer xsk_live_…- Each key belongs to one mode. Test keys start
xsk_test_, live keys startxsk_live_. See Test mode. - Create and copy keys at app.xiomid.com/developers (Developers → API keys). Reveal and copy the key there any time. If it leaks, use Roll key: you get a new key and the old one stops working at once.
- Keep keys on your server, in an environment variable such as
XIOMID_API_KEY. Never put one in a browser, a mobile app or a repository. - Call the API from your server only. The browser gets a session link or token, never a key.
/v1/meReturns the key’s organization and mode. A quick way to test your setup.
curl https://api.xiomid.com/v1/me \
-H "Authorization: Bearer $XIOMID_API_KEY"{
"organization": { "id": "org_3fq8k2", "name": "Acme Markets" },
"mode": "sandbox",
"keyName": "CRM staging"
}Test mode
Test mode runs the whole integration without real checks or charges. It is the same API and the same webhooks: you switch between test and live by swapping the key.
| Test mode | Live | |
|---|---|---|
| Key | xsk_test_… | xsk_live_… |
| Data | Test applicants only | Live applicants only |
| Checks | Nothing is checked for real: you pick the result | Real document, face and AML checks |
| Billing | Never billed | Billed from your credit, then your wallet |
| Webhooks | Sent to test-mode endpoints | Sent to live endpoints |
- A test key never sees live data and a live key never sees test data: an id from the other mode answers
404 not_found. - Test data is marked
"sandbox": truein API responses and webhooks, andGET /v1/meanswers"mode": "sandbox"for a test key. - The dashboard has a Live / Test switch, so test applicants never mix with real ones.
- When you go live, swap
xsk_test_…forxsk_live_…and add a live webhook endpoint with its own signing secret. Nothing else changes.
In test mode the verification page shows a Simulated result picker before the applicant submits, so you can test every branch of your webhook handler without real documents. Live checks always decide for real.
- ApproveEvery check passes.
applicant.reviewedarrives withdecision: approved. - ReviewThe case lands in the review queue:
decision: review. - RejectA hard fail:
decision: rejected, with reason codes. - RetakeThe applicant is asked to redo a step:
applicant.action_required.
Integrate
Choose a flow
/v1/flowsA flow is the list of steps an applicant goes through, for example an ID document and a liveness selfie. Build flows in the dashboard, then pass a published flow’s id as flowId when you create an applicant. Without flowId, your organization’s first published flow runs.
curl https://api.xiomid.com/v1/flows \
-H "Authorization: Bearer $XIOMID_API_KEY"[
{ "id": "flw_3k9d2", "name": "Standard KYC", "published": true, "steps": ["id_document", "liveness"] },
{ "id": "flw_8m2q7", "name": "Proof of address", "published": false, "steps": ["proof_of_address"] }
]Create an applicant
/v1/applicantsCreates a case on a published flow and its verification link. Call it from your server when one of your users needs to verify.
- externalUserIdstring, requiredYour user’s id, up to 200 characters. Webhooks carry it back.
- flowIdstringWhich flow to run. Default: your organization’s first published flow.
- emailstringPrefills the flow and receives reminders.
- phonestringIn international format, +905551234567.
- languagestringThe flow’s language: en, tr, de. Default: the browser’s.
- returnUrlhttps URLWhere the hosted page sends the applicant after the result.
- metadataobjectFlat JSON up to 4 KB, echoed in the API and every webhook.
curl https://api.xiomid.com/v1/applicants \
-H "Authorization: Bearer $XIOMID_API_KEY" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: kyc-10482" \
-d '{
"externalUserId": "10482",
"email": "jane@example.com",
"language": "en",
"returnUrl": "https://crm.example.com/kyc/done",
"metadata": { "accountId": "MT5-200481" }
}'The answer (201) has the applicant and its session. Save applicant.id next to your user, then send the user to session.url.
{
"applicant": {
"id": "apl_7Kq2mX4p",
"externalUserId": "10482",
"flowId": "flw_3k9d2",
"flowName": "Standard KYC",
"status": "init",
"decision": null,
"score": null,
"riskLevel": null,
"reasonCodes": [],
"identity": null,
"email": "jane@example.com",
"phone": null,
"sandbox": true,
"metadata": { "accountId": "MT5-200481" },
"createdAt": "2026-11-16T09:24:11Z",
"submittedAt": null,
"decidedAt": null,
"session": { "token": "Hx4mP9rT2c", "url": "https://verify.xiomid.com/Hx4mP9rT2c?returnUrl=…", "expiresAt": "2026-11-23T09:24:11Z", "status": "active" }
},
"session": {
"token": "Hx4mP9rT2c",
"url": "https://verify.xiomid.com/Hx4mP9rT2c?returnUrl=https%3A%2F%2Fcrm.example.com%2Fkyc%2Fdone",
"expiresAt": "2026-11-23T09:24:11Z"
}
}Send an Idempotency-Key header (any unique string, such as kyc-<user id>) so a retry can’t create a second case. For 24 hours, the same key with the same body returns the first answer again; with a different body it answers 409 idempotency_conflict, and while the first request is still running, 409 idempotency_in_progress.
402 out_of_credit when the month’s credit and your wallet are used up. Test mode is never charged.Send the user
There are two ways to show the verification flow. Both use the session from the create call, and links last 7 days.
- Hosted page: redirect the browser to
session.url, or send the link by email or SMS. Nothing to install. - SDK: open the flow inside your own page, inline or as a modal. See Embed the SDK.
With a returnUrl (https), the hosted page sends the applicant back after the result with ?xiomid_status=…&xiomid_session=…. The status is approved, review, rejected or action_required.
// routes/web.php: the hosted page sends the applicant back here after the result
// https://crm.example.com/kyc/done?xiomid_status=approved&xiomid_session=Hx4mP9rT2c
Route::get('/kyc/done', function (Request $request) {
// Only for the message on screen. The webhook (or GET /v1/applicants/{id}) is the source of truth.
$status = $request->query('xiomid_status'); // approved, review, rejected or action_required
return view('kyc.done', ['status' => $status]);
})->middleware('auth')->name('kyc.done');Embed the SDK
Load the SDK and open the session your server created. The flow runs in a container on your page, as a modal over it, or by redirect to the hosted page.
<div id="kyc"></div>
<script src="https://verify.xiomid.com/sdk.js"></script>
<script>
xiomid.init({
token: 'SESSION_TOKEN', // session.token from POST /v1/applicants, created on your server
mode: 'inline', // or 'modal' (an overlay), or 'redirect' (the hosted page)
container: '#kyc',
onComplete: (event) => {
// approved, review, rejected or action_required: show it, then trust the webhook
window.location.assign('/kyc/done?xiomid_status=' + event.status);
},
onClose: () => console.log('closed'),
}).open();
</script>The script lives at https://verify.xiomid.com/sdk.js. For a longer cache, pin the major version with https://verify.xiomid.com/sdk.v1.js.
- tokenstring, requiredThe
session.tokenfromPOST /v1/applicants, created on your server. - mode'inline' | 'modal' | 'redirect'Inside a container on your page, as an overlay, or by sending the browser to the hosted page.
- containerCSS selectorWhere the flow goes in
inlinemode, for example#kyc. - onComplete(event) => voidCalled with
event.status:approved,review,rejectedoraction_required. Show it on screen; save the decision from the webhook. - onClose() => voidThe applicant closed the flow before finishing.
session.token to the browser. Your secret key never leaves the server.A new link
/v1/applicants/{id}/sessionsA fresh link for the same case, when the first one expired or the user lost it. A case that isn’t finished keeps its attempt and gets 7 more days; a finished or expired one starts a new attempt. A retry within 30 days of a billed verification is free.
The body is optional: language and returnUrl. While the checks run, the call answers 409 processing: try again once the case has a result. The answer is { session: { token, url, expiresAt } }.
curl -X POST https://api.xiomid.com/v1/applicants/apl_7Kq2mX4p/sessions \
-H "Authorization: Bearer $XIOMID_API_KEY"Results
Webhooks
Webhooks tell your server when something happens to a case: started, submitted, decided, changed by a reviewer, or asked to redo a step. Match them to your user by externalUserId.
data object: the decision events (applicant.reviewed, applicant.decision_changed, applicant.action_required) carry the full report with data.object set to report (identity with the full document number, document, checks, AML screening, media links); the other applicant events carry the applicant with data.object set to applicant. It is the same JSON the API returns, so one handler can read both.- In the dashboard, open Developers → Webhooks and add your endpoint’s https URL. Pick its mode (test or live) and the events it listens to.
- Copy the endpoint’s signing secret (
whsec_…) intoXIOMID_WEBHOOK_SECRETon your server. - Verify the signature of every delivery, answer
2xxwithin a few seconds, and do the work in a background job.
Each delivery is a POST with a JSON body. This is an applicant.reviewed event:
POST /webhooks/xiomid HTTP/1.1
Content-Type: application/json
X-Xiomid-Event: applicant.reviewed
X-Xiomid-Delivery: dlv_9Kd02PsQx1
X-Xiomid-Signature: t=1794821500,v1=5f2b9c0e…
{
"id": "evt_3Fq81Lz0aK",
"type": "applicant.reviewed",
"applicantId": "apl_7Kq2mX4p",
"externalUserId": "10482",
"flowId": "flw_3k9d2",
"flow": "Standard KYC",
"status": "approved",
"decision": "approved",
"score": 92,
"riskLevel": "low",
"reasonCodes": [],
"sandbox": true,
"metadata": { "accountId": "MT5-200481" },
"reusedFrom": null,
"createdAt": "2026-11-16T09:30:18Z",
"data": {
"object": "report",
"applicantId": "apl_7Kq2mX4p",
"attempt": 1,
"overall": 92,
"decision": "approved",
"checks": [
{ "id": "face_match", "label": "Face match", "status": "pass", "detail": "The selfie matches the document photo." },
{ "id": "liveness", "label": "Liveness", "status": "pass", "detail": "A live person completed the challenge." }
],
"identity": {
"firstName": "Jane",
"lastName": "Doe",
"dateOfBirth": "1990-04-12",
"sex": "F",
"nationality": "GB",
"address": null,
"documentType": "passport",
"documentKind": null,
"documentNumber": "X1234567",
"documentNumberLast4": "4567",
"issuingCountry": "GB",
"expiryDate": "2031-04-11"
},
"document": { "type": "passport", "country": "GB", "fields": { "placeOfBirth": "London" } },
"screening": { "status": "clear", "hits": 0 },
"media": [
{ "kind": "doc_front", "url": "https://api.xiomid.com/v1/media/med_…?exp=…&sig=…", "contentType": "image/jpeg", "expiresAt": "2026-11-17T09:30:18.000Z" },
{ "kind": "selfie", "url": "https://api.xiomid.com/v1/media/med_…?exp=…&sig=…", "contentType": "image/jpeg", "expiresAt": "2026-11-17T09:30:18.000Z" }
]
}
}Check data.object to know what you got: report is exactly GET /v1/applicants/{id}/report, applicant is exactly GET /v1/applicants/{id}. Both show the case as it was when the event was sent. Events with their own body (screening.resolved, reauth.completed, privacy.erased) have no data, and privacy.erased never carries personal data.
data.media are signed and work for 24 hours (each has its expiresAt); no API key is needed to open them. Show them directly while they are valid, or download the files and store them in your own database or storage if you need them longer. After that, call GET /v1/applicants/{id}/report for fresh links (those last 15 minutes).// In the job, for applicant.reviewed: save each capture to your own storage
use Illuminate\Support\Facades\Http;
use Illuminate\Support\Facades\Storage;
if ($event['type'] === 'applicant.reviewed') {
$id = $event['applicantId']; // apl_7Kq2mX4p
foreach ($event['data']['media'] as $i => $file) {
// Signed links: no API key needed, valid until $file['expiresAt'] (24 hours)
$extension = str_contains($file['contentType'], 'png') ? 'png' : 'jpg';
$path = "kyc/{$id}/{$i}-{$file['kind']}.{$extension}";
Storage::put($path, Http::timeout(30)->get($file['url'])->throw()->body());
KycFile::updateOrCreate(['applicant_id' => $id, 'path' => $path], ['kind' => $file['kind']]);
}
}
// Later than that, ask for fresh links:
// $report = Http::xiomid()->get("applicants/{$id}/report")->throw()->json();data from the stored copies of its deliveries, cancels any still waiting, and sends privacy.erased: delete what you copied too.A delivery that fails or doesn’t answer 2xx is retried with backoff, so the same event can arrive more than once. Handle each event id once: the Laravel example shows how.
Events
The event type is in the body’s type and in the X-Xiomid-Event header.
- applicant.createdA case was created: by the API, in the dashboard or by the sandbox generator.Data:
applicant - applicant.startedThe applicant opened the link and started the first step (once per attempt).Adds:
attemptData:applicant - step.completedThe applicant finished a step.Adds:
stepId,stepType,attemptData:applicant - applicant.submittedEvery step is done; the checks are running.Data:
applicant - applicant.reviewedThe automatic decision: approved, review or rejected.Adds:
reusedFromData:report - applicant.decision_changedA reviewer decided or changed the decision in the dashboard.Adds:
previousStatus,reviewerNameData:report - applicant.action_requiredThe applicant must redo one or more steps.Adds:
stepIds,url,applicantMessageData:report - applicant.monitoring_dueOngoing monitoring: a re-verification is due and the link was sent.Adds:
kinds,stepIds,url,applicantMessageData:applicant - screening.alertAML screening found a possible new match.Adds:
screeningId,amlStatus,openHits,listsData:applicant - screening.resolvedA reviewer resolved an AML match.Own body:
screeningId,hitId,list,kind,resolution,whitelisted,amlStatus - reauth.completedA selfie re-check finished, passed or failed.Own body:
reauthId,reason,reference,status,similarity - privacy.erasedThe applicant’s data was erased on a GDPR or KVKK request.Own body:
erasedAt
Every applicant.*, step.* and screening.alert event carries these fields:
idtypeapplicantIdexternalUserIdflowIdflowstatusdecisionscoreriskLevelreasonCodessandboxmetadatacreatedAtdatadata comes last: the report on decision events, the applicant on the others (see The data object). Events with their own body carry id, type, applicantId, externalUserId, sandbox and createdAt, plus their own fields, and no data.
Verify signatures
Check every delivery before you trust it. The signature is in the X-Xiomid-Signature header:
X-Xiomid-Signature: t=<unix seconds>,v1=<hex>- Split the header on commas and read
tandv1. - Compute HMAC-SHA256 of
<t>.<raw request body>with your endpoint’s secret, as hex. - Compare it with
v1in constant time. - Reject the delivery if
tis more than 300 seconds (5 minutes) away from now.
// routes/web.php
Route::post('/webhooks/xiomid', XiomidWebhookController::class);
// bootstrap/app.php: ->withMiddleware(fn ($m) => $m->validateCsrfTokens(except: ['webhooks/xiomid']))
namespace App\Http\Controllers;
use App\Jobs\HandleXiomidEvent;
use Illuminate\Http\Request;
class XiomidWebhookController
{
public function __invoke(Request $request)
{
$body = $request->getContent(); // the raw body: re-encoded JSON won’t match
$parts = [];
foreach (explode(',', (string) $request->header('X-Xiomid-Signature')) as $part) {
[$key, $value] = array_pad(explode('=', trim($part), 2), 2, '');
$parts[$key] = $value;
}
$t = $parts['t'] ?? '';
$expected = hash_hmac('sha256', $t.'.'.$body, config('services.xiomid.webhook_secret'));
if (! ctype_digit($t) || abs(time() - (int) $t) > 300 || ! hash_equals($expected, $parts['v1'] ?? '')) {
abort(400, 'Invalid signature');
}
HandleXiomidEvent::dispatch(json_decode($body, true)); // answer fast, work in a job
return response()->noContent();
}
}Read an applicant
/v1/applicants/{id}One case with its status, decision (approved, review, rejected or null), score, riskLevel, reasonCodes, identity, your metadata, timestamps and the current session. The identity is what the document gave: name, date of birth, sex, nationality, address, document type and the full documentNumber as captured (masked only where the law requires it, for example Aadhaar), plus documentNumberLast4, issuing country and expiry; a value the document doesn’t have is null. Webhooks other than decisions carry this object in data.
/v1/applicantsLists cases, newest first. Filter by externalUserId or status, set limit (1–100, default 20), then pass nextCursor as cursor for the next page. The answer is { data: [...], nextCursor }.
curl https://api.xiomid.com/v1/applicants/apl_7Kq2mX4p \
-H "Authorization: Bearer $XIOMID_API_KEY"
# Find a user’s cases, newest first (limit 1–100, then pass nextCursor as cursor)
curl "https://api.xiomid.com/v1/applicants?externalUserId=10482&limit=20" \
-H "Authorization: Bearer $XIOMID_API_KEY"{
"id": "apl_7Kq2mX4p",
"externalUserId": "10482",
"flowId": "flw_3k9d2",
"flowName": "Standard KYC",
"status": "approved",
"decision": "approved",
"score": 92,
"riskLevel": "low",
"reasonCodes": [],
"identity": {
"firstName": "Jane",
"lastName": "Doe",
"dateOfBirth": "1990-04-12",
"sex": "F",
"nationality": "GB",
"address": null,
"documentType": "passport",
"documentKind": null,
"documentNumber": "X1234567",
"documentNumberLast4": "4567",
"issuingCountry": "GB",
"expiryDate": "2031-04-11"
},
"email": "jane@example.com",
"phone": null,
"sandbox": true,
"metadata": { "accountId": "MT5-200481" },
"createdAt": "2026-11-16T09:24:11Z",
"submittedAt": "2026-11-16T09:29:52Z",
"decidedAt": "2026-11-16T09:30:18Z",
"session": { "token": "Hx4mP9rT2c", "url": "https://verify.xiomid.com/Hx4mP9rT2c", "expiresAt": "2026-11-23T09:24:11Z", "status": "submitted" }
}- initCreated; the applicant hasn’t started yet.
- in_progressThe applicant is going through the steps.
- processingEvery step is done; the checks are running.
- approvedDecided: approved.
- reviewWaiting for a reviewer in your dashboard.
- rejectedDecided: rejected, with reason codes.
- action_requiredThe applicant must redo one or more steps.
- expiredThe link expired before the applicant finished.
The report
/v1/applicants/{id}/reportThe latest attempt in full: every check with its status and detail, the identity, the document (type, country and extra fields), AML screening, and media links to the captures.
curl https://api.xiomid.com/v1/applicants/apl_7Kq2mX4p/report \
-H "Authorization: Bearer $XIOMID_API_KEY"{
"applicantId": "apl_7Kq2mX4p",
"attempt": 1,
"overall": 92,
"decision": "approved",
"checks": [
{ "id": "document_authenticity", "label": "Document authenticity", "status": "pass", "detail": "Security features and fonts match a GB passport." },
{ "id": "face_match", "label": "Face match", "status": "pass", "detail": "The selfie matches the document photo." },
{ "id": "liveness", "label": "Liveness", "status": "pass", "detail": "A live person completed the challenge." },
{ "id": "aml_screening", "label": "AML screening", "status": "pass", "detail": "No matches on sanctions or PEP lists." }
],
"identity": { "firstName": "Jane", "lastName": "Doe", "dateOfBirth": "1990-04-12", "documentNumber": "X1234567", … },
"document": { "type": "passport", "country": "GB", "fields": { "placeOfBirth": "London", "issueDate": "2021-04-12" } },
"screening": { "status": "clear", "hits": 0 },
"media": [
{ "kind": "doc_front", "url": "https://api.xiomid.com/v1/media/med_…?exp=…&sig=…", "contentType": "image/jpeg", "expiresAt": "2026-11-16T09:45:18.000Z" },
{ "kind": "selfie", "url": "https://api.xiomid.com/v1/media/med_…?exp=…&sig=…", "contentType": "image/jpeg", "expiresAt": "2026-11-16T09:45:18.000Z" }
]
}expiresAt on each). Download the files right away, or fetch the report again later for fresh links. The decision webhooks carry this same report in data, with links that last 24 hours.Reference
Endpoints
All endpoints live under https://api.xiomid.com/v1. Requests and responses are JSON. Ids start with apl_ (applicants), flw_ (flows) and evt_ (events).
- GET
/v1/meThe organization and mode of the key - GET
/v1/flowsYour flows and their steps - POST
/v1/applicantsCreate a case and its verification link - GET
/v1/applicants/{id}Status, decision and identity - GET
/v1/applicantsFind cases by your user id or status - GET
/v1/applicants/{id}/reportEvery check, the document and media links - POST
/v1/applicants/{id}/sessionsA fresh link for the same case
Errors
Every error has the same JSON shape: { code, message, errors }. Branch on code; the message is for people, and errors lists the problems per field on a 422.
HTTP/1.1 422 Unprocessable Entity
{
"code": "validation_error",
"message": "Check the highlighted fields.",
"errors": { "returnUrl": ["Use an https URL."] }
}- unauthenticatedHTTP 401The Authorization header is missing, or the key is wrong or revoked.
- out_of_creditHTTP 402A live case can’t start: the month’s credit and the wallet are used up. Sandbox is never charged.
- not_foundHTTP 404No such id for this key. A sandbox key never sees live cases, and the other way round.
- idempotency_conflictHTTP 409The Idempotency-Key was used in the last 24 hours with a different body.
- validation_errorHTTP 422A field is missing or invalid; errors lists the messages per field.
- rate_limitedHTTP 429More than 300 requests a minute per key. Wait for Retry-After seconds.
- idempotency_in_progressHTTP 409The first request with this Idempotency-Key is still running.
- processingHTTP 409A new link was asked for while the case is being checked. Try again once it has a result.
- kyc_rate_limitedHTTP 429Your company started its 120 new verifications this minute (counted across all your keys). Wait for Retry-After, then retry with the same Idempotency-Key. Ask us about the high-volume program for more.
- busyHTTP 503xiomid is under heavy load right now. Wait for Retry-After (a few seconds) and retry; creates with an Idempotency-Key are safe to resend.
- api_pausedHTTP 403xiomid paused API access for your company. Write to support.
use Illuminate\Http\Client\RequestException;
try {
$data = Http::xiomid()->post('applicants', $payload)->throw()->json();
} catch (RequestException $e) {
$error = $e->response->json(); // ['code' => …, 'message' => …, 'errors' => […]]
match ($e->response->status()) {
402 => report('xiomid: out of credit'), // top up; sandbox still works
422 => logger()->warning('xiomid', $error['errors'] ?? []),
429 => sleep((int) $e->response->header('Retry-After') ?: 60),
default => throw $e,
};
}Rate limits
Each key may make 300 requests a minute per key. Over the limit, the API answers 429 rate_limited with a Retry-After header: wait that many seconds, then try again.
Starting verifications has its own limit per company: 120 new applicants a minute, counted across all of your keys (more on the high-volume program). Over it the API answers 429 kyc_rate_limited. Every company has its own budget, so another customer's traffic never uses yours.
When you retry a create, send the same Idempotency-Key so the retry returns the first case instead of making a second one (see Safe retries).
Use an AI agent
Paste this prompt into your coding agent. It reads our API reference at xiomid.com/llms.txt, then adds the server route, the redirect or SDK call, and a webhook handler that checks the signature.
# Integrate xiomid identity verificationRead https://xiomid.com/llms.txt first.Add a server route that POSTs to https://api.xiomid.com/v1/applicants with flowId "<FLOW_ID>" and externalUserId set to your user’s id.Send the user to the returned session.url (or open it with https://verify.xiomid.com/sdk.js).Add a webhook handler that verifies the x-xiomid-signature header (HMAC-SHA256 of "<t>.<body>", 5-minute tolerance, constant-time compare).Use the XIOMID_API_KEY and XIOMID_WEBHOOK_SECRET environment variables, never literal keys.
Works with any coding agent. It reads xiomid.com/llms.txt, then writes the route, the redirect and the webhook handler.
- Replace
<FLOW_ID>with a flow id from GET /v1/flows or the dashboard. - Keys stay in
XIOMID_API_KEYandXIOMID_WEBHOOK_SECRET, never in code. - Review the change like any other pull request.
Both files are plain text for agents and tools: llms.txt has the API reference, llms-full.txt adds every code sample and example response.
Laravel example
A complete Laravel integration: the config and an HTTP client, the webhook controller that checks the signature, and a job that handles each event once.
// .env
XIOMID_API_KEY=xsk_test_… # sandbox key; xsk_live_… in production
XIOMID_WEBHOOK_SECRET=whsec_… # Developers → Webhooks → your endpoint
// config/services.php
'xiomid' => [
'key' => env('XIOMID_API_KEY'),
'webhook_secret' => env('XIOMID_WEBHOOK_SECRET'),
],
// app/Providers/AppServiceProvider.php, boot()
use Illuminate\Support\Facades\Http;
Http::macro('xiomid', fn () => Http::baseUrl('https://api.xiomid.com/v1')
->withToken(config('services.xiomid.key'))
->acceptJson()
->timeout(15));// routes/web.php
Route::post('/webhooks/xiomid', XiomidWebhookController::class);
// bootstrap/app.php: ->withMiddleware(fn ($m) => $m->validateCsrfTokens(except: ['webhooks/xiomid']))
namespace App\Http\Controllers;
use App\Jobs\HandleXiomidEvent;
use Illuminate\Http\Request;
class XiomidWebhookController
{
public function __invoke(Request $request)
{
$body = $request->getContent(); // the raw body: re-encoded JSON won’t match
$parts = [];
foreach (explode(',', (string) $request->header('X-Xiomid-Signature')) as $part) {
[$key, $value] = array_pad(explode('=', trim($part), 2), 2, '');
$parts[$key] = $value;
}
$t = $parts['t'] ?? '';
$expected = hash_hmac('sha256', $t.'.'.$body, config('services.xiomid.webhook_secret'));
if (! ctype_digit($t) || abs(time() - (int) $t) > 300 || ! hash_equals($expected, $parts['v1'] ?? '')) {
abort(400, 'Invalid signature');
}
HandleXiomidEvent::dispatch(json_decode($body, true)); // answer fast, work in a job
return response()->noContent();
}
}// app/Jobs/HandleXiomidEvent.php, handle()
$event = $this->event;
// A retry can deliver the same event twice: handle each id once.
if (! Cache::add("xiomid:{$event['id']}", true, now()->addDays(3))) {
return;
}
$user = User::find($event['externalUserId']);
match ($event['type']) {
// data is the full report: identity (full document number), checks, AML screening, media links
'applicant.reviewed', 'applicant.decision_changed' => $user?->update([
'kyc_status' => $event['decision'],
'kyc_document_number' => $event['data']['identity']['documentNumber'] ?? null,
]),
'applicant.action_required' => $user?->notify(new RedoVerification($event['url'], $event['applicantMessage'])),
default => null,
};// In the job, for applicant.reviewed: save each capture to your own storage
use Illuminate\Support\Facades\Http;
use Illuminate\Support\Facades\Storage;
if ($event['type'] === 'applicant.reviewed') {
$id = $event['applicantId']; // apl_7Kq2mX4p
foreach ($event['data']['media'] as $i => $file) {
// Signed links: no API key needed, valid until $file['expiresAt'] (24 hours)
$extension = str_contains($file['contentType'], 'png') ? 'png' : 'jpg';
$path = "kyc/{$id}/{$i}-{$file['kind']}.{$extension}";
Storage::put($path, Http::timeout(30)->get($file['url'])->throw()->body());
KycFile::updateOrCreate(['applicant_id' => $id, 'path' => $path], ['kind' => $file['kind']]);
}
}
// Later than that, ask for fresh links:
// $report = Http::xiomid()->get("applicants/{$id}/report")->throw()->json();Creating an applicant and redirecting is in Create an applicant (pick the PHP tab), and the return route in Come back to your site.
Looking for the overview? Developers