Skip to content

Developers

Documentation

Verify your users with one API call, a hosted page or SDK for the flow, and a signed webhook with the result.

Base URLhttps://api.xiomid.com/v1

Get 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.

  1. 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 key
    export XIOMID_API_KEY=xsk_test_…   # Dashboard → Developers → API keys
    
    curl https://api.xiomid.com/v1/me \
      -H "Authorization: Bearer $XIOMID_API_KEY"
  2. 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 applicant
    curl 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", … } }
  3. 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 receive
    POST /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.

Header
Authorization: Bearer xsk_live_…
  • Each key belongs to one mode. Test keys start xsk_test_, live keys start xsk_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.
A live key can start billed checks. If one leaks, revoke it in the dashboard right away and create a new one.
GET/v1/me

Returns 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"
Response
{
  "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 modeLive
Keyxsk_test_…xsk_live_…
DataTest applicants onlyLive applicants only
ChecksNothing is checked for real: you pick the resultReal document, face and AML checks
BillingNever billedBilled from your credit, then your wallet
WebhooksSent to test-mode endpointsSent 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": true in API responses and webhooks, and GET /v1/me answers "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_… for xsk_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.

  • Approve
    Every check passes. applicant.reviewed arrives with decision: approved.
  • Review
    The case lands in the review queue: decision: review.
  • Reject
    A hard fail: decision: rejected, with reason codes.
  • Retake
    The applicant is asked to redo a step: applicant.action_required.

Integrate

Choose a flow

GET/v1/flows

A 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"
Response
[
  { "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

POST/v1/applicants

Creates a case on a published flow and its verification link. Call it from your server when one of your users needs to verify.

  • externalUserId
    string, required
    Your user’s id, up to 200 characters. Webhooks carry it back.
  • flowId
    string
    Which flow to run. Default: your organization’s first published flow.
  • email
    string
    Prefills the flow and receives reminders.
  • phone
    string
    In international format, +905551234567.
  • language
    string
    The flow’s language: en, tr, de. Default: the browser’s.
  • returnUrl
    https URL
    Where the hosted page sends the applicant after the result.
  • metadata
    object
    Flat 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.

Response · 201
{
  "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.

With a live key, the call answers 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.

Laravel: the return route
// 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');
Use the return status only for the message on screen. The webhook or GET /v1/applicants/{id} is the source of truth.

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.

HTML
<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.

  • token
    string, required
    The session.token from POST /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.
  • container
    CSS selector
    Where the flow goes in inline mode, for example #kyc.
  • onComplete
    (event) => void
    Called with event.status: approved, review, rejected or action_required. Show it on screen; save the decision from the webhook.
  • onClose
    () => void
    The applicant closed the flow before finishing.
Create the session on your server and pass only session.token to the browser. Your secret key never leaves the server.

A new link

POST/v1/applicants/{id}/sessions

A 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.

One event has everything. Next to the summary fields, every applicant event has a 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.
  1. 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.
  2. Copy the endpoint’s signing secret (whsec_…) into XIOMID_WEBHOOK_SECRET on your server.
  3. Verify the signature of every delivery, answer 2xx within 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:

Request
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.

Media links in 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).
Save the captures on applicant.reviewed (Laravel)
// 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();
Webhook bodies contain personal data: names, dates of birth, document numbers and links to ID photos and selfies. Use an https endpoint, verify every signature, and keep what you store as protected as your own customer data. When an applicant is erased (GDPR or KVKK), xiomid removes 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.created
    A case was created: by the API, in the dashboard or by the sandbox generator.Data: applicant
  • applicant.started
    The applicant opened the link and started the first step (once per attempt).Adds: attemptData: applicant
  • step.completed
    The applicant finished a step.Adds: stepId, stepType, attemptData: applicant
  • applicant.submitted
    Every step is done; the checks are running.Data: applicant
  • applicant.reviewed
    The automatic decision: approved, review or rejected.Adds: reusedFromData: report
  • applicant.decision_changed
    A reviewer decided or changed the decision in the dashboard.Adds: previousStatus, reviewerNameData: report
  • applicant.action_required
    The applicant must redo one or more steps.Adds: stepIds, url, applicantMessageData: report
  • applicant.monitoring_due
    Ongoing monitoring: a re-verification is due and the link was sent.Adds: kinds, stepIds, url, applicantMessageData: applicant
  • screening.alert
    AML screening found a possible new match.Adds: screeningId, amlStatus, openHits, listsData: applicant
  • screening.resolved
    A reviewer resolved an AML match.Own body: screeningId, hitId, list, kind, resolution, whitelisted, amlStatus
  • reauth.completed
    A selfie re-check finished, passed or failed.Own body: reauthId, reason, reference, status, similarity
  • privacy.erased
    The applicant’s data was erased on a GDPR or KVKK request.Own body: erasedAt

Every applicant.*, step.* and screening.alert event carries these fields:

idtypeapplicantIdexternalUserIdflowIdflowstatusdecisionscoreriskLevelreasonCodessandboxmetadatacreatedAtdata

data 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:

Header
X-Xiomid-Signature: t=<unix seconds>,v1=<hex>
  1. Split the header on commas and read t and v1.
  2. Compute HMAC-SHA256 of <t>.<raw request body> with your endpoint’s secret, as hex.
  3. Compare it with v1 in constant time.
  4. Reject the delivery if t is more than 300 seconds (5 minutes) away from now.
Use the raw request body, byte for byte. JSON that was parsed and encoded again won’t match the signature.
// 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

GET/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.

GET/v1/applicants

Lists 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"
Response
{
  "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" }
}
  • init
    Created; the applicant hasn’t started yet.
  • in_progress
    The applicant is going through the steps.
  • processing
    Every step is done; the checks are running.
  • approved
    Decided: approved.
  • review
    Waiting for a reviewer in your dashboard.
  • rejected
    Decided: rejected, with reason codes.
  • action_required
    The applicant must redo one or more steps.
  • expired
    The link expired before the applicant finished.

The report

GET/v1/applicants/{id}/report

The 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"
Response
{
  "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" }
  ]
}
Media links from this endpoint are signed for 15 minutes (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

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.

Example
HTTP/1.1 422 Unprocessable Entity

{
  "code": "validation_error",
  "message": "Check the highlighted fields.",
  "errors": { "returnUrl": ["Use an https URL."] }
}
  • unauthenticated
    HTTP 401
    The Authorization header is missing, or the key is wrong or revoked.
  • out_of_credit
    HTTP 402
    A live case can’t start: the month’s credit and the wallet are used up. Sandbox is never charged.
  • not_found
    HTTP 404
    No such id for this key. A sandbox key never sees live cases, and the other way round.
  • idempotency_conflict
    HTTP 409
    The Idempotency-Key was used in the last 24 hours with a different body.
  • validation_error
    HTTP 422
    A field is missing or invalid; errors lists the messages per field.
  • rate_limited
    HTTP 429
    More than 300 requests a minute per key. Wait for Retry-After seconds.
  • idempotency_in_progress
    HTTP 409
    The first request with this Idempotency-Key is still running.
  • processing
    HTTP 409
    A new link was asked for while the case is being checked. Try again once it has a result.
  • kyc_rate_limited
    HTTP 429
    Your 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.
  • busy
    HTTP 503
    xiomid 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_paused
    HTTP 403
    xiomid paused API access for your company. Write to support.
Laravel: handle errors
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.

Integration prompt
# 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_KEY and XIOMID_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.

1. Setup: .env, config and the Http::xiomid() client
// .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));
2. The webhook controller
// 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();
    }
}
3. The job: handle each event once
// 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,
};
4. Keep the captures (links in a webhook last 24 hours)
// 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.

Stuck on something?

Write to us with the applicant or event id and what you expected to happen.

support@xiomid.com

Looking for the overview? Developers