Skip to main content

Documentation

Developer guide

How to issue, verify and revoke documents with the platform API, based on the platform’s OpenAPI specification.

Overview

The platform lets an organisation issue digital documents that anyone can check. Each document is recorded with a cryptographic hash anchored on a blockchain, so a verifier can check a document and its current status without contacting the issuer.

Sources

This page is based on the platform’s OpenAPI 3.1 specification, but the specification and the services do not always agree. Where we found a difference — the issue request and response, verification responses, rate-limit headers and error bodies — this page describes what the services’ code does. Other details have not all been checked against the services.

What the API does

  • Issue one document, or a batch (issuance service).
  • Verify one document, or up to 100 at a time (verification service).
  • Revoke, suspend or reactivate a document (status service).
  • Search and export the audit log (identity service).

Who uses it

  • Issuers — agencies, universities, hospitals and professional bodies that create documents.
  • Verifiers — employers, banks and institutions that check them.
  • Holders — the people the documents are about, who share them.

New here? Read how it works or the use-case proposals.

Getting started

Base URL

The public production host has not been published yet. Examples use $API_BASE_URL; ask the team for the base URL of your deployment.

Try a request in the API sandbox

The API sandbox builds a request and shows the exact response from a gateway you supply. Register a developer app in the marketplace; a scoped test key can be issued after an operator provisions a synthetic tenant. Ask the operator for a non-production gateway before testing any write operation.
  1. Create an account at sign-up and sign in to the console.
  2. Create an API key. In the console, open API Keys and create a key with only the scopes you need. The full key is shown once: store it in a secret manager or an environment variable. The read-only key created when you signed up is shown once on the email-verification page; the welcome email shows only a preview. Welcome emails sent by earlier versions of the platform contained the full key: if yours did, delete that email or rotate the key.
  3. Find your tenant ID — your organisation’s slug or UUID. Send it in the X-Tenant-ID header unless your deployment routes tenants by subdomain.
  4. Issue a document. Name the template in templateId (its ID or slug) and give the document an id. The other fields in document come from your template.
    Example requestbash
    curl -X POST "$API_BASE_URL/issuance/v1/issue" \
      -H "X-API-Key: $TRUSTME_API_KEY" \
      -H "X-Tenant-ID: your-tenant-slug" \
      -H "Content-Type: application/json" \
      -d '{
        "templateId": "your-template-slug",
        "document": {
          "id": "TCC-2025-0001",
          "documentType": "tax_clearance",
          "holderName": "Example Holder",
          "period": "2025"
        },
        "metadata": { "issuingOffice": "Example office" }
      }'

    A successful call returns 200 with recordId, txRef (the blockchain transaction reference), blockNumber, hash, timestamp and status, among other fields. A request without a template or without a document id is rejected with 400.

  5. Verify it. The verification endpoint needs no API key.
    Example requestbash
    curl "$API_BASE_URL/verify/api/v1/verify/transcript-2024-0001" \
      -H "X-Tenant-ID: your-tenant-slug"

Core concepts

Organisations (tenants)

Each organisation is a tenant, with its own users, templates and documents. Requests name the tenant in the X-Tenant-ID header (slug or UUID) or through a tenant subdomain.

Separation between organisations

Row-level security policies for tenant data exist in the database, but they are not yet enforced for the platform’s own connections. Until they are, separation between tenants relies on the services filtering each query by tenant in their code.

Documents and templates

A template is a JSON Schema that defines one type of document: its fields, their types and their validation rules — for example a tax clearance certificate or a degree certificate.

An issued document is a record of those fields plus a content hash, the blockchain transaction reference, a status and the history of status changes.

Roles

People in the console have roles. The main ones are:

platform_admin
Runs the platform across all tenants.
tenant_admin
Manages one organisation’s users and settings.
issuer_admin
Manages an organisation’s templates and documents.
issuer
Issues documents.
verifier_admin
Manages verification settings.
verifier
Verifies documents.
auditor
Reads audit logs and reports.

Document status

A document’s status is one of these:

ACTIVE
Issued and valid.
PENDING
Not yet confirmed on the blockchain. Verifying it gives the decision manual_review, not accept.
SUSPENDED
Temporarily not valid; can be reactivated.
REVOKED
Permanently not valid. The reason is recorded.
EXPIRED
Past its expiry date.

Authentication

Authenticated calls use one of two credentials:

  • API key — send X-API-Key: <key>. Keys belong to one tenant, carry scopes, and can be rotated (POST /identity/api/v1/api-keys/{keyId}/rotate) or revoked.
  • Access token — send Authorization: Bearer <token> with a JWT from the auth service. Access tokens expire after 15 minutes; renew them with POST /auth/v2/auth/refresh.

Request headers

X-Tenant-ID
Tenant slug or UUID, when subdomain routing is not used.
X-API-Key
A tenant API key (server-to-server calls).
Authorization
Bearer access token (calls made for a signed-in user).
X-Request-ID
Optional. Your correlation ID; it is echoed in the response.

Single sign-on

OpenID Connect sign-in is handled by the identity service under /identity/api/v1/oidc/. Whether it is switched on depends on your deployment.

Keep keys secret

  • Never put an API key in browser or mobile app code, or in version control.
  • Load keys from environment variables or a secret manager.
  • Give each key only the scopes it needs.
  • Rotate keys regularly and revoke keys you no longer use.

API reference

The main endpoints, grouped by service. Paths are relative to $API_BASE_URL.

Issuance

  • POST/issuance/v1/issue

    Issue one document and anchor it on the blockchain.

  • POST/issuance/v1/issue/batch

    Issue several documents in one request.

  • GET/issuance/v1/records

    List issued records.

  • GET/issuance/v1/records/{id}

    Get one issued record.

  • GET/issuance/v1/records/{id}/status

    Get a record’s status.

Verification

  • GET/verify/api/v1/verify/{documentId}

    Verify one document. Add ?skipCache=true to force a blockchain lookup.

  • POST/verify/api/v1/verify/batch

    Verify up to 100 documents; each gets its own result.

The response says whether the document passed (verified), whether it was found (found), its status, and a decision: accept, reject or manual_review. Only accept comes with verified: true.

Example response, abridged (… marks values left out)json
{
  "verified": true,
  "found": true,
  "status": "ACTIVE",
  "issuer": "0x…",
  "timestamp": "…",
  "contentHash": "…",
  "cached": false,
  "responseTime": …,
  "verifiedAt": "…",
  "decision": "accept",
  "score": 100,
  "verification": { … },
  "evidence": { … },
  "checks": [ … ],
  "warnings": [ … ]
}

When no document matches the ID, the service answers 404 with verified: false, found: false, status NOT_FOUND and decision reject. It also answers 404 when an ID matches documents in more than one organisation; send X-Tenant-ID to say which one you mean. Check the HTTP status as well as the fields.

Example response when no document matches (HTTP 404, abridged)json
{
  "verified": false,
  "found": false,
  "status": "NOT_FOUND",
  "decision": "reject",
  …
}

Status and revocation

  • GET/status/api/v1/status/{documentId}

    Get the current status and its history.

  • PUT/status/api/v1/status/{documentId}/revoke

    Revoke permanently, with a reason.

  • PUT/status/api/v1/status/{documentId}/suspend

    Suspend until reactivated.

  • PUT/status/api/v1/status/{documentId}/reactivate

    Reactivate a suspended document.

Example requestbash
curl -X PUT "$API_BASE_URL/status/api/v1/status/transcript-2024-0001/revoke" \
  -H "X-API-Key: $TRUSTME_API_KEY" \
  -H "X-Tenant-ID: your-tenant-slug" \
  -H "Content-Type: application/json" \
  -d '{ "reason": "FRAUD_DETECTED", "notes": "Flagged by compliance team investigation" }'

reason is one of the RevocationReason values below (default OTHER); notes is optional and is kept in the status history.

  • NONE
  • SUPERSEDED
  • FRAUD_DETECTED
  • DATA_BREACH
  • ISSUER_REQUEST
  • REGULATORY_COMPLIANCE
  • EXPIRED
  • OTHER

Audit log

  • GET/identity/api/v1/audit/logs

    Search the tenant’s audit events.

  • POST/identity/api/v1/audit/export

    Export audit events.

Filter the log with startDate, endDate, action, category and actorId. The service filters results by the request’s tenant when it resolves one.

Errors and rate limits

Errors return a JSON body, but its fields differ between services: most include error, and many add message or code. The main services return an X-Request-ID header with every response; quote it when you contact support.

400
The request is invalid (for example a missing template or document ID). Fix it before retrying.
401
Missing or invalid API key or token.
404
The document or resource was not found, or a verification ID matched more than one organisation.
429
Rate limit reached. Wait for the number of seconds in Retry-After.
500
Server error. Retry later; contact support if it continues.
503
A dependency (for example the blockchain node) is unavailable. Retry later.

Rate limits are set per service and per deployment, and are usually counted per client address; no limit is published for any deployment. When a limit applies, responses carry RateLimit-Limit, RateLimit-Remaining and RateLimit-Reset (some public endpoints send a single RateLimit header instead), and a 429 response carries Retry-After.

Webhooks (planned)

Planned — webhook delivery is not yet verified

Webhook delivery has not yet been verified end to end against the running platform; do not build an integration that depends on it. This section describes what the delivery service is built to send, and it may still change. Until this section is no longer marked planned, check a document’s status with GET /status/api/v1/status/{documentId}.

As built, the delivery service sends a signed JSON event by HTTPS POST to every endpoint that subscribed to that event when a credential that belongs to your organisation is issued, revoked, suspended or reinstated, one of your credentials is verified, or a licence your organisation issued is due for renewal. This has not yet been verified end to end against the running platform (see the note above). Endpoints are registered in the console under Webhooks, which also shows every delivery attempt.

Events

credential.issued
A credential is recorded in the registry as ACTIVE: a new issuance, or a pending credential that becomes active. A credential issued to replace another carries supersedesCredentialId.
credential.revoked
A credential’s status changes to REVOKED. reason carries the revocation reason.
credential.suspended
A credential’s status changes to SUSPENDED.
credential.reinstated
A REVOKED, SUSPENDED or EXPIRED credential returns to ACTIVE.
verification.completed
A verification of one of your organisation’s credentials is recorded. It carries the recorded result, never who verified it: no IP address, email address, user agent or API key.
licence.renewal_due
A renewable licence your organisation issued enters one of its renewal reminder windows (by default 90, 30 and 7 days before it expires), once per window, when the reminder is recorded. It carries the licence’s ID, certificate number, type, programme, status, holder name and expiry date, and the reminder window, never the holder’s email address or phone number.
webhook.test
Sent only when you press Send test event in the console, to that one endpoint, with a single attempt. You cannot subscribe to it.

Not sent: a change of status to EXPIRED or PENDING, and a re-issue that changes a credential’s content but not its status. A document issued in a batch (POST /issuance/v1/issue/batch) sends credential.issued when its registry record is written, as a single issue does. Events are captured in the same database transaction as the change, so an event exists only if the change was saved.

Payload

Every request body is one JSON object with these fields. Parse it as JSON; do not depend on the order of the keys inside data.

id
The event id. It stays the same across retries and redeliveries: use it to ignore repeats.
type
The event type, as in the table above.
apiVersion
The payload version, currently 2026-10-01.
createdAt
When the change happened, as a UTC timestamp such as 2026-10-01T09:30:00.123Z.
tenantId
Your organisation’s id.
data
The details of the event, described below.

The four credential events share one data shape: credentialId, documentId, docType, status, previousStatus (null for a new issuance), reason (the revocation reason, for revoked and suspended credentials only), issuedAt, contentHash, issuerAddress, blockchainTxHash, templateId, templateVersion, versionNumber and supersedesCredentialId. The holder’s personal details and free-text revocation notes are never included.

verification.completed carries verificationId, credentialId, documentId, docType, verifiedAt, verificationType, verified, statusAtVerification, decision, reasonCodes and contentHash. contentHash.matched is null whenever no hash was supplied. The examples below shorten hashes with “…”.

Example: credential.issuedjson
{
  "id": "1b9d6bcd-bbfd-4b2d-9b5d-ab8dfbbd4bed",
  "type": "credential.issued",
  "apiVersion": "2026-10-01",
  "createdAt": "2026-10-01T09:00:00.120Z",
  "tenantId": "00000000-0000-4000-8000-000000000001",
  "data": {
    "credentialId": "55555555-5555-4555-8555-555555555555",
    "documentId": "DOC-2026-000123",
    "docType": "education",
    "issuedAt": "2026-10-01T09:00:00.000Z",
    "contentHash": "0x9f2c…",
    "issuerAddress": "0x4a1d…",
    "blockchainTxHash": "0x7be0…",
    "templateId": null,
    "templateVersion": null,
    "versionNumber": 1,
    "supersedesCredentialId": null,
    "status": "ACTIVE",
    "previousStatus": null,
    "reason": null
  }
}
Example: credential.revokedjson
{
  "id": "6f0e2a1c-8d3b-4c57-9a2e-0b1c2d3e4f50",
  "type": "credential.revoked",
  "apiVersion": "2026-10-01",
  "createdAt": "2026-10-01T09:30:00.123Z",
  "tenantId": "00000000-0000-4000-8000-000000000001",
  "data": {
    "credentialId": "55555555-5555-4555-8555-555555555555",
    "documentId": "DOC-2026-000123",
    "docType": "education",
    "issuedAt": "2026-10-01T09:00:00.000Z",
    "contentHash": "0x9f2c…",
    "issuerAddress": "0x4a1d…",
    "blockchainTxHash": "0x7be0…",
    "templateId": null,
    "templateVersion": null,
    "versionNumber": 1,
    "supersedesCredentialId": null,
    "status": "REVOKED",
    "previousStatus": "ACTIVE",
    "reason": "FRAUD_DETECTED"
  }
}
Example: credential.suspendedjson
{
  "id": "0c4f6e8a-2b1d-4e3f-8a5c-7d9e1f2a3b4c",
  "type": "credential.suspended",
  "apiVersion": "2026-10-01",
  "createdAt": "2026-10-01T10:00:00.000Z",
  "tenantId": "00000000-0000-4000-8000-000000000001",
  "data": {
    "credentialId": "55555555-5555-4555-8555-555555555555",
    "documentId": "DOC-2026-000123",
    "docType": "education",
    "issuedAt": "2026-10-01T09:00:00.000Z",
    "contentHash": "0x9f2c…",
    "issuerAddress": "0x4a1d…",
    "blockchainTxHash": "0x7be0…",
    "templateId": null,
    "templateVersion": null,
    "versionNumber": 1,
    "supersedesCredentialId": null,
    "status": "SUSPENDED",
    "previousStatus": "ACTIVE",
    "reason": "ISSUER_REQUEST"
  }
}
Example: credential.reinstatedjson
{
  "id": "9a8b7c6d-5e4f-4a3b-8c2d-1e0f9a8b7c6d",
  "type": "credential.reinstated",
  "apiVersion": "2026-10-01",
  "createdAt": "2026-10-02T08:15:00.000Z",
  "tenantId": "00000000-0000-4000-8000-000000000001",
  "data": {
    "credentialId": "55555555-5555-4555-8555-555555555555",
    "documentId": "DOC-2026-000123",
    "docType": "education",
    "issuedAt": "2026-10-01T09:00:00.000Z",
    "contentHash": "0x9f2c…",
    "issuerAddress": "0x4a1d…",
    "blockchainTxHash": "0x7be0…",
    "templateId": null,
    "templateVersion": null,
    "versionNumber": 1,
    "supersedesCredentialId": null,
    "status": "ACTIVE",
    "previousStatus": "SUSPENDED",
    "reason": null
  }
}
Example: verification.completedjson
{
  "id": "3c2b1a09-8f7e-4d6c-9b5a-493827160514",
  "type": "verification.completed",
  "apiVersion": "2026-10-01",
  "createdAt": "2026-10-01T09:11:28.600Z",
  "tenantId": "00000000-0000-4000-8000-000000000001",
  "data": {
    "verificationId": "7d6c5b4a-3928-4170-8a9b-0c1d2e3f4a5b",
    "credentialId": "55555555-5555-4555-8555-555555555555",
    "documentId": "DOC-2026-000123",
    "docType": "education",
    "verifiedAt": "2026-10-01T09:11:28.550Z",
    "verificationType": "single",
    "verified": true,
    "statusAtVerification": "ACTIVE",
    "decision": "accept",
    "reasonCodes": [
      "VERIFIED"
    ],
    "contentHash": {
      "provided": false,
      "matched": null
    }
  }
}
Example: webhook.testjson
{
  "id": "9f1c3a52-6f1e-4b8e-9d7a-2b1f0c4e8a10",
  "type": "webhook.test",
  "apiVersion": "2026-10-01",
  "createdAt": "2026-10-01T12:00:00.000Z",
  "tenantId": "00000000-0000-4000-8000-000000000001",
  "data": {
    "message": "Test event from TrustMeHub. No credential changed.",
    "endpointId": "5b0d7c2e-3a41-4f7e-9c55-1d2e3f4a5b6c"
  }
}

Headers on each request

Content-Type
application/json
Content-Length
The length of the body in bytes.
User-Agent
TrustMeHub-Webhooks/1.0
TrustMeHub-Event-Id
The event id, the same as id in the body.
TrustMeHub-Event-Type
The event type.
TrustMeHub-Delivery-Id
The delivery id, the same across the retries of one delivery.
TrustMeHub-Delivery-Attempt
The attempt number, from 1 to 10.
TrustMeHub-Signature
t= followed by the Unix time in seconds, then one v1= signature for each active secret (see below).

The HTTP client also adds the standard Host and Connection headers. Nothing else is sent: no cookies, no Authorization header and no tenant header.

Checking the signature

Check the signature of every request before you trust it. Each endpoint has its own signing secret, which starts with whsec_ and is shown once, when the endpoint is added or the secret is rotated. The header looks like this:

Example signature headerhttp
TrustMeHub-Signature: t=1700000000,v1=0b91005972e1aa5b226d4d9316ab03604e79379c1667176d30918c2745145c3a
  1. Read t and every v1 value from the TrustMeHub-Signature header.
  2. Reject the request when t is more than 300 seconds away from your clock.
  3. Compute HMAC-SHA256, keyed with the whole secret (including whsec_), over t, a full stop and the raw request body exactly as received, and write it as lowercase hex.
  4. Accept the request if the result equals any v1 value, using a constant-time comparison.
  5. Ignore an event whose id you have already processed.
Check the signature in Node.js (Express)javascript
import crypto from 'node:crypto';
import express from 'express';

export function verifyTrustMeHubSignature(rawBody, signatureHeader, secret, { toleranceSeconds = 300, now = Date.now() } = {}) {
  if (typeof signatureHeader !== 'string' || typeof secret !== 'string') return false;
  let timestamp = null;
  const signatures = [];
  for (const part of signatureHeader.split(',')) {
    const eq = part.indexOf('=');
    if (eq <= 0) continue;
    const key = part.slice(0, eq).trim();
    const value = part.slice(eq + 1).trim();
    if (key === 't') timestamp = value;
    else if (key === 'v1') signatures.push(value);
  }
  if (!/^\d{1,12}$/.test(timestamp || '') || signatures.length === 0) return false;
  if (Math.abs(Math.floor(now / 1000) - Number(timestamp)) > toleranceSeconds) return false;
  const expected = crypto.createHmac('sha256', secret).update(`${timestamp}.`).update(rawBody).digest();
  return signatures.some((sig) => /^[0-9a-f]{64}$/.test(sig)
    && crypto.timingSafeEqual(Buffer.from(sig, 'hex'), expected));
}

const app = express();
app.post('/webhooks/trustmehub', express.raw({ type: 'application/json', limit: '256kb' }), (req, res) => {
  if (!verifyTrustMeHubSignature(req.body, req.get('TrustMeHub-Signature'), process.env.TRUSTMEHUB_WEBHOOK_SECRET)) {
    return res.sendStatus(400);
  }
  const event = JSON.parse(req.body.toString('utf8'));
  // At-least-once delivery: ignore an event id you have already processed.
  // Queue the work and answer quickly; anything slower than 10 s counts as a failure.
  res.sendStatus(204);
});
Check the signature in Pythonpython
import hmac, hashlib, time

def verify_trustmehub_signature(raw_body: bytes, header: str, secret: str, tolerance: int = 300) -> bool:
    parts = [p.split('=', 1) for p in (header or '').split(',') if '=' in p]
    ts = next((v.strip() for k, v in parts if k.strip() == 't'), None)
    sigs = [v.strip() for k, v in parts if k.strip() == 'v1']
    if not ts or not ts.isdigit() or not sigs:
        return False
    if abs(int(time.time()) - int(ts)) > tolerance:
        return False
    expected = hmac.new(secret.encode('utf-8'), ts.encode('ascii') + b'.' + raw_body, hashlib.sha256).hexdigest()
    return any(hmac.compare_digest(expected, s) for s in sigs)

Rotate a secret from the endpoint’s page in the console; the new secret is shown once. You choose how long the old secret keeps working: not at all, 1 hour, 24 hours (the default) or 7 days. During that time each request carries two v1 signatures, one for each secret, so you can switch without losing events. Every attempt, including a retry, is signed again with a new t.

Delivery and retries

  • A delivery succeeds when your endpoint answers with any 2xx status. Any other status, a redirect, a network error or a timeout is a failure.
  • Answer within 10 seconds, connection included: queue slow work and answer first.
  • Delivery is at least once: the same event can arrive more than once. Use the event id to ignore repeats.
  • Events can arrive out of order. Use createdAt, status and previousStatus to work out the latest state.

A failed delivery is retried, up to 10 attempts in all; the last attempt comes about 47 hours after the first.

1
As soon as the event is captured
2
30 seconds after the previous attempt
3
2 minutes after the previous attempt
4
8 minutes after the previous attempt
5
32 minutes after the previous attempt
6
2 hours 8 minutes after the previous attempt
7
8 hours 32 minutes after the previous attempt
8
12 hours after the previous attempt
9
12 hours after the previous attempt
10
12 hours after the previous attempt
  • Each wait varies by up to 20 % either way, so retries to many endpoints do not arrive together.
  • After the 10th failed attempt the delivery is marked failed. You can redeliver it from the delivery log in the console; the redelivery carries the same event id.
  • An endpoint that has failed 25 times in a row, and has been failing for at least 24 hours, is disabled automatically. The console shows when and why; enable it again once it is fixed.
  • While an endpoint is disabled, deliveries waiting for it are cancelled and new events are not queued for it. Events are not replayed when it is enabled again.
  • Test events are tried once and do not count towards automatic disabling.
  • Events, deliveries and attempts are deleted from the delivery log after 30 days by default. Each deployment can set a period from 7 to 365 days, so ask your platform operator if you rely on it.

Endpoint URLs

  • Use an https:// URL with a valid certificate (TLS 1.2 or later).
  • Private, loopback, link-local and cloud-metadata addresses are refused, as are host names such as localhost or names ending in .local or .internal. The host is checked when you save the URL and again before every attempt.
  • Use port 443, or a port from 1024 to 65535.
  • A URL with a user name, a password or a #fragment is refused. A token in the path or query string is allowed; delivery records store only the host name.
  • Redirects are not followed: use the final address.

Limits

  • Endpoints are managed in the console by administrators and developers. API keys cannot manage webhooks yet.
  • Up to 20 endpoints per organisation.
  • One test event per endpoint every 10 seconds.
  • Custom request headers and payload filters are not available.
  • The addresses deliveries come from are not published yet, so receivers cannot allow-list them by IP address.
  • There is no credential.expired event.

TypeScript client (not yet published)

Not yet published

The TypeScript client is in the platform’s source code, but it has not been published to npm or any other package registry, so it cannot be installed yet. Until it is, call the API over plain HTTP as shown on this page. This section describes the client as built, and it may change before it is published.

The client covers verification, document status (read, revoke, suspend and reactivate), issuing and the public receipt routes, and includes a helper that checks webhook signatures. It is built as an ES module and a CommonJS module with type declarations, runs on Node.js 18.17 or later, and has no runtime dependencies.

It calls these paths on your deployment’s base URL. They are the paths the platform’s reference web server configuration routes, without the service prefixes (such as /verify or /status) used in the API reference above:

  • GET /api/v1/verify/{documentId}
  • GET /api/v1/status/{documentId}
  • PUT /api/v1/status/{documentId}/revoke
  • PUT /api/v1/status/{documentId}/suspend
  • PUT /api/v1/status/{documentId}/reactivate
  • POST /api/v1/issue
  • GET /api/public/receipts/{verificationToken}
  • POST /api/public/receipts/verify

Not every deployment’s web server routes POST /api/v1/issue; ask your operator before you rely on issue.

Configure it with your deployment’s base URL, one credential (an API key or an access token, not both) and your tenant. Reading a status, changing one and issuing need the credential, and the client refuses to send them without one. The receipt calls never send your credential or tenant.

Example: verify and revoke with the TypeScript clienttypescript
import { createTrustMeHubClient, isTrustMeHubApiError } from '@trustmehub/client';

const client = createTrustMeHubClient({
  baseUrl: process.env.TRUSTMEHUB_BASE_URL, // your deployment's origin
  apiKey: process.env.TRUSTMEHUB_API_KEY,   // or accessToken: () => getAccessToken()
  tenantId: 'your-tenant-slug',
});

const result = await client.verify('transcript-2024-0001');
if (!result.found) {
  // No document matches (HTTP 404, status NOT_FOUND).
} else if (result.decision === 'accept') {
  // ...
}

try {
  await client.revoke('transcript-2024-0001', { reason: 'FRAUD_DETECTED', notes: 'Compliance review' });
} catch (error) {
  if (isTrustMeHubApiError(error)) console.error(error.status, error.code, error.requestId);
  else throw error;
}

Errors are typed: TrustMeHubUsageError means nothing was sent, TrustMeHubNetworkError means no answer arrived, and TrustMeHubApiError carries the HTTP status, the service’s error code, the request ID and any Retry-After. The client does not follow redirects, so your key is never sent to another host.

The webhook helper runs the same signature check as the Node.js example in the webhooks section, with types. It checks signatures only; it does not change the status of webhook delivery described there.

Example: check a webhook with the TypeScript clienttypescript
import { constructWebhookEvent } from '@trustmehub/client/webhooks';

// rawBody: the request body exactly as received (a Buffer), before any JSON parsing.
const event = constructWebhookEvent(rawBody, req.get('TrustMeHub-Signature'), process.env.TRUSTMEHUB_WEBHOOK_SECRET);
// Throws WebhookSignatureError when the signature does not verify; de-duplicate on event.id.

Sector guides

The API is the same in every sector; what changes is the template. The use-case proposals describe how each sector could use the platform:

  • Education — degree certificates, transcripts and result slips.
  • Tax — tax clearance certificates that banks and procuring bodies can check.
  • Professional licensing — licences whose current status matters as much as their issue.
  • Healthcare — practising licences for health workers.
  • Identity — checks against government identity documents.

Example: a degree certificate

A request body for a template with these fields:

Examplejson
{
  "templateId": "your-degree-template-slug",
  "document": {
    "id": "EXAMPLE-DEG-2025-0001",
    "documentType": "degree_certificate",
    "studentId": "EXAMPLE/CSC/2020/0001",
    "holderName": "Example Graduate",
    "programme": "B.Sc. Computer Science",
    "classOfDegree": "Second Class Upper",
    "graduationDate": "2025-07-15"
  },
  "metadata": { "faculty": "Science" }
}

Personal data

Put only the fields a verifier needs into a document. A hash anchored on a blockchain cannot be removed later.

Deployment notes

  • Blockchain. Each document's fingerprint (not the document) is written to an Ethereum-compatible ledger the platform operates, over a direct RPC connection. Which network is used is set per deployment.
  • Tenancy. Separation between tenants relies on the services filtering their queries by tenant in their code. Public verification also looks a document up in other tenants when it is not found under the tenant given, and adds a TENANT_SCOPE_MISMATCH warning when it was found in another one. Database row-level security policies exist but are not yet enforced (see Organisations (tenants)).
  • Performance. No latency figures are published yet. Each verification response reports its own responseTime (milliseconds) and whether it was cached.
  • Availability. Current service health is on service status. Database replication status describes the replication setup (a test lab until production nodes are configured). No uptime figure is published.
  • Testing. Try your integration against a non-production tenant before issuing real documents.

Questions

Use an API key for server-to-server calls. Use access tokens for calls made on behalf of a signed-in user.

We have not published a measured figure. Check GET /status/api/v1/status/{documentId} until the document reports ACTIVE.

Call PUT /status/api/v1/status/{documentId}/revoke with a reason, or use Revoke on the document in the console. Verifications then report REVOKED.

A TypeScript client is generated from the OpenAPI specification inside the platform’s source code, but it has not been published to a package registry. Use plain HTTP as shown on this page.

On the security page, which lists the controls in place today and how to report a vulnerability.

Need help with an integration?

Send a message through the contact form, or email us.

Documentation | TrustMeHub