API reference

REST API for the verification layer.

Manage batches, fetch verification data, and subscribe to events. Base URL https://api.certiklabs.com.

Authentication

All requests require a bearer token. Generate keys from your dashboard under Settings → API. Keys are scoped per environment (test / live) and per organization.

Authorization: Bearer sk_live_xxxxxxxxxxxxxxxxxxxx

Never expose live keys in client-side code. Use the <certik-badge> embed for browsers — it uses a public, read-only verification path.

Endpoints

All responses are JSON. Errors follow { error: { code, message } }.

GET/v1/batches

List batches in your organization

Returns paginated batch records with status, lot code, and the verifications attached to each batch.

curl https://api.certiklabs.com/v1/batches \
  -H "Authorization: Bearer $CERTIKLABS_API_KEY"

# 200 OK
{
  "data": [
    {
      "id": "btc_01HXYZ...",
      "batch_code": "NW-24-A1207",
      "product": "BPC-157 5mg",
      "status": "active",
      "manufacture_date": "2025-04-10",
      "verifications": [
        {
          "public_id": "CL-9F2A-7C31-B4E8",
          "status": "verified",
          "purity_pct": 98.74,
          "released_at": "2025-04-12T14:22:00Z",
          "verify_url": "https://certiklabs.com/v/CL-9F2A-7C31-B4E8"
        }
      ]
    }
  ],
  "next_cursor": null
}
GET/v1/batches/{id}

Retrieve a single batch

Returns full batch details including every verification, content test, and signed COA URL.

curl https://api.certiklabs.com/v1/batches/btc_01HXYZ \
  -H "Authorization: Bearer $CERTIKLABS_API_KEY"
POST/v1/batches

Register a new batch

Creates a batch record. Use this when shipping samples programmatically from your ERP or LIMS.

curl -X POST https://api.certiklabs.com/v1/batches \
  -H "Authorization: Bearer $CERTIKLABS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "product_id": "prd_abc123",
    "batch_code": "NW-24-A1208",
    "manufacture_date": "2025-04-10",
    "quantity_units": 500
  }'
GET/v1/verifications/{public_id}

Retrieve a public verification

Read-only endpoint returning the same data shown on the public verify page (no auth required).

curl https://api.certiklabs.com/v1/verifications/CL-9F2A-7C31-B4E8
GET/v1/batches/{id}/assets

Get badge & QR assets

Returns SVG/PNG asset URLs for the verified badge and QR code for a batch.

curl https://api.certiklabs.com/v1/batches/btc_01HXYZ/assets \
  -H "Authorization: Bearer $CERTIKLABS_API_KEY"
GET/v1/verifications/{public_id}/views

List scan & view analytics

Aggregated view events for a verification: timestamps, referrers, and coarse geography.

curl https://api.certiklabs.com/v1/verifications/CL-9F2A-7C31-B4E8/views \
  -H "Authorization: Bearer $CERTIKLABS_API_KEY"

Webhooks

Subscribe to events to keep your storefront, ERP, or analytics in sync. Every payload is signed with HMAC-SHA256 — verify the CertikLabs-Signature header before trusting the body.

EventDescription
batch.createdA new batch was registered in your organization.
verification.publishedA verification was released and is now live on the public verify page.
verification.failedA verification did not pass. It will not be made public.
verification.viewedSomeone scanned the QR or opened the public verification page.
batch.lockedA batch was auto-locked after repeated failures, or manually recalled.
// Example payload
{
  "id": "evt_01HX...",
  "type": "verification.published",
  "created": 1745087220,
  "data": {
    "public_id": "CL-9F2A-7C31-B4E8",
    "batch_code": "NW-24-A1207",
    "purity_pct": 98.74,
    "verify_url": "https://certiklabs.com/v/CL-9F2A-7C31-B4E8"
  }
}

Rate limits & SDKs

Default limit is 600 requests/minute per key. Public verification reads (the /v/<id> path) are unmetered. Official SDKs are available for Node.js and Python.

# Node.js
npm install @certiklabs/node

# Python
pip install certiklabs