TrustLayer

    Authentication

    Pass your API key as a Bearer token. Get one from the API tab in the dashboard.

    Authorization: Bearer htl_live_xxxxxxxxxxxxxxxxxxxx

    POST /v1/verify — Verify identity

    Returns whether a public identity key is human-verified, plus a trust score and risk level.

    curl -X POST 'https://klzwvxcxjzhtgqpfyglc.supabase.co/functions/v1/v1-verify' \
      -H 'Authorization: Bearer YOUR_API_KEY' \
      -H 'Content-Type: application/json' \
      -d '{"identity_id":"BASE64_PUBLIC_KEY"}'
    
    # 200 OK
    {
      "is_human": true,
      "trust_score": 78,
      "risk": "low"
    }

    GET /v1/profile — Public profile lookup

    Read-only public trust data. No auth required. Cached 60s.

    curl 'https://klzwvxcxjzhtgqpfyglc.supabase.co/functions/v1/public-profile?handle=ahmad'
    # or by social handle:
    curl 'https://klzwvxcxjzhtgqpfyglc.supabase.co/functions/v1/public-profile?platform=x&social=ahmad'
    
    # 200 OK
    {
      "handle": "ahmad",
      "trust_score": 84,
      "verifiers": 21,
      "proofs": 47,
      "badges": ["Trusted","Well-Connected"]
    }

    GET /v1/badge — Embeddable SVG

    Returns a dynamic SVG badge. Cache 5 min. Style: flat | dark.

    <a href="https://trstlyr.com/u/ahmad">
      <img src="https://klzwvxcxjzhtgqpfyglc.supabase.co/functions/v1/badge-svg?handle=ahmad" alt="Trust Score" />
    </a>
    Sample TrustLayer badge

    Rate limits

    • Starter — 60 req/min, 1,000 req/month
    • Pro — 300 req/min, 50,000 req/month
    • Enterprise — 1,000 req/min, 500,000 req/month

    Headers returned: X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, Retry-After (on 429).

    Errors

    401  { "error": "Invalid API key" }
    402  { "error": "Monthly usage limit exceeded" }
    429  { "error": "Rate limit exceeded", "retry_after": 12 }
    500  { "error": "Internal server error" }

    JavaScript SDK

    import { TrustLayer } from 'trustlayer-sdk';
    const tl = new TrustLayer('htl_live_xxx');
    const r = await tl.verify('public_key_base64');
    if (r.is_human && r.trust_score >= 60) { /* allow */ }

    SDK source available in the app at src/sdk/trustlayer.ts. NPM package coming soon.