Skip to content
Docs
Get started

API reference

Quickstart

From a new account to a Verified Result at your webhook in about fifteen minutes, in test mode, with a built-in verification template and cURL, Node.js or Python.

This quickstart takes you from sign-up to a Verification Result delivered to your own webhook. Everything runs in test mode, which is free and uses Verilo's real Evidence and Decision Engines. You need a terminal and an https address that can receive a POST.

1. Create your account and copy your test key

Create an account at verilo.app/start: choose Developer and give your work email and company. Open the link we email you. You land on Developers in test mode, with your first test key shown once. Copy it into your shell:

Shell
export VERILO_API_KEY="vrl_test_..."

Check the key:

cURL
curl https://api.verilo.app/v1/account \
  -H "Authorization: Bearer $VERILO_API_KEY"

The answer says "mode": "test". Test keys only ever see test data.

A new test key on the Developers page, shown once, with a Copy button and a note to keep it on your server.

Your first test key on the Developers page, shown once.

2. Receive webhooks

Verilo tells you when a Result is ready by POSTing a signed event to your endpoint. Here is a complete receiver in Node.js. It checks the Verilo-Signature header over the raw body before trusting anything.

Node.js
// receiver.mjs — node receiver.mjs (Node 18 or later)
import { createServer } from 'node:http';
import { createHmac, timingSafeEqual } from 'node:crypto';

const SECRET = process.env.VERILO_WEBHOOK_SECRET; // whsec_...

function verified(raw, header) {
  const t = /t=(\d+)/.exec(header ?? '')?.[1];
  const v1 = /v1=([0-9a-f]+)/.exec(header ?? '')?.[1];
  if (!t || !v1 || Math.abs(Date.now() / 1000 - Number(t)) > 300) return false;
  const want = createHmac('sha256', SECRET).update(`${t}.${raw}`).digest('hex');
  return v1.length === want.length && timingSafeEqual(Buffer.from(v1), Buffer.from(want));
}

createServer((req, res) => {
  let raw = '';
  req.on('data', chunk => (raw += chunk));
  req.on('end', () => {
    if (!verified(raw, req.headers['verilo-signature'])) return res.writeHead(400).end();
    const event = JSON.parse(raw);
    // verification.result_ready for every template; claim.result_ready for damage claims.
    if (event.type === 'verification.result_ready' || event.type === 'claim.result_ready') {
      const { id, result } = event.data.object;
      console.log(id, result.state, result.explanation.strong);
    }
    res.writeHead(200).end('ok');
  });
}).listen(3000);

Make it reachable over https. On a laptop, a tunnel does that in one command, for example cloudflared tunnel --url http://localhost:3000 or ngrok http 3000. Then register the address:

cURL
curl https://api.verilo.app/v1/webhook_endpoints \
  -H "Authorization: Bearer $VERILO_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "url": "https://your-tunnel.example.com/" }'

The answer carries secret once. Start the receiver with it:

Shell
VERILO_WEBHOOK_SECRET="whsec_..." node receiver.mjs

You can also add the endpoint on the Developers page, and press Send test event to see your receiver answer. Every delivery is listed under its endpoint, with the answer your server gave and a Resend button.

Webhook endpoints on the Developers page: one endpoint receiving every event, with Send test event, Roll secret and Delete, and its delivery history: three deliveries delivered and one retrying after three tries that answered HTTP 503, each with Resend.

A webhook endpoint and its delivery history on the Developers page.

3. Create a verification

A Verification checks one physical object, live, against what you expect it to be. Its steps come from a template; this one uses the built-in warranty_serial template, which reads the product's serial number barcode, matches the product to an image, captures the fault close up and checks the scene against the phone's light. The references are what the steps are checked against: here a serial number and Verilo's sample product image, so the whole loop works before you connect your own data.

curl https://api.verilo.app/v1/verifications \
  -H "Authorization: Bearer $VERILO_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: quickstart-war-1001" \
  -d '{
    "template": "warranty_serial",
    "reference": "WAR-1001",
    "subject": { "name": "Ceramic table lamp" },
    "references": {
      "serial": { "codes": ["SN-LAMP-0001"] },
      "item": { "imageUrl": "https://api.verilo.app/v1/samples/ceramic-table-lamp.jpg" }
    }
  }'

The answer is the Verification, with "status": "link_sent" and a verificationLink. In live mode you send verificationLink.url to your customer, who opens it on their phone. See every template with GET /v1/templates, or read Built-in templates.

4. Complete it with the scripted customer

In test mode you do not need the product in your hand. The scripted customer completes the capture through the same endpoints a phone uses: it shows the reference's serial and image at each step, and the engines judge it as they would any capture.

curl -X POST https://api.verilo.app/v1/test_helpers/verifications/ver_.../capture \
  -H "Authorization: Bearer $VERILO_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "scenario": "verified" }'

Within seconds, your receiver prints the Result:

Text
ver_2b7e41c09d8f4a6e9c1d3b5a7f9e0c2d Verified [
  'serial: the code read matches the reference value SN-LAMP-0001.',
  "light: the scene brightened in step with the phone's light (tracking 0.86), consistent with a real object in front of the camera.",
  'item: the item shown looks like the reference image (similarity 0.88).',
  'point: a hand and the item were in view together.',
  'fault: a close-up was recorded as the phone moved in (point your camera at the fault, close up).',
  'Every step was completed.'
]

Try needs_review and unable_to_verify on new Verifications to see the other two Result States. To see what your customers see, open the verificationLink.url of a new test Verification on your phone instead.

5. Read the result and the evidence

The Result gives each step with what it checked and what it measured:

curl https://api.verilo.app/v1/verifications/ver_... -H "Authorization: Bearer $VERILO_API_KEY"
curl https://api.verilo.app/v1/verifications/ver_.../evidence -H "Authorization: Bearer $VERILO_API_KEY"
curl -o evidence-pack.pdf https://api.verilo.app/v1/verifications/ver_.../evidence_pack -H "Authorization: Bearer $VERILO_API_KEY"

How verification works explains each step result and how the state is decided.

Damage claims

Verifying a damaged-item claim against an order? Use Claims: send the order, and the shipping label is checked against its tracking number and the item against the order line's image. The same scripted customer completes test Claims at POST /v1/test_helpers/claims/{id}/capture, and the Claim also gives you a carrier claim pack and an Outcome. See Damage claims.

6. Go live

  1. On Billing, turn on card billing. Live verifications are billed per completed verification, monthly. Nothing is charged until one completes.
  2. On Developers, switch to Live and create a live key (vrl_live_...) and a live webhook endpoint. Live and test keys, endpoints, templates, Verifications and Claims are separate.
  3. Send your own references: your product images, serial numbers, asset tags or tracking numbers. Send each verificationLink.url to your customer by email, SMS or in your app. For Claims, "sendEmail": true has Verilo email it from your account's name.

The Developers page switched to Live: live keys act on live data, and a notice that live Claims need card billing at $0.75 USD per completed verification, with nothing charged until then.

The Developers page in live mode, before card billing is on.

Next: How verification works, Step kinds, Webhooks and Errors.