Docs

Quickstart

Get a key, make one call, read the verdict.

Every endpoint is a single request authenticated with your API key in the X-Api-Key header. The scoring endpoints — IP, email, phone, domain, device and the combined signup check — all return the same shape: a 0–100 risk_score, an allow | review | block verdict, the signals behind it, and processing_time_sec. The agent endpoints answer a different question — identity, not risk — so they return verified or decision instead of a verdict. Free tier: 1,000 lookups/month — one per signal checked, so a full /v1/score/user call on all five signals uses five.

Step 1 — get your key. Create a free API key (1,000 lookups/month, no card). Then pass it in the X-Api-Key header on every request below.

Looking for one check? Try the free disposable email API and checker, or see how to verify AI agents with Web Bot Auth.

Strictness. Add &strictness= (0–3) to any scoring endpoint to tune how aggressively verdicts flip — 0 lenient (fewest false positives), 1 balanced (default), 2 strict, 3 paranoid. The risk_score stays the same; only the verdict thresholds move.

When we could not check. If most of the data sources behind an answer could not be reached, or any one of the Tor list, the VPN providers’ exit lists or the disposable-domain list, the response names them in signals_unavailable, is not billed, and never says allow: it says review. Your own allow rule still wins.

curl "https://www.layercall.com/v1/score/ip?ip=185.220.101.1" \
  -H "X-Api-Key: tl_live_your_key"

The response below came from a live key. A test key (tl_test_…) answers with synthetic scores and says so in test_mode_note, so the same call shows different numbers — test mode lists the values that are fixed. On a test key, ask for ip=198.51.100.2 to see a Tor exit: block, score 100.

{
  "ip": "185.220.101.1",
  "risk_score": 60,
  "signals": {
    "is_vpn": true,
    "is_proxy": true,
    "is_datacenter": true,
    "is_tor": true,
    "recent_abuse": false,
    "is_hijacked_netblock": false
  },
  "geo": {
    "country": "DE",
    "city": "Berlin",
    "asn": "AS60729",
    "isp": "Stiftung Erneuerbare Freiheit"
  },
  "vpn_provider": null,
  "hijacked_source": null,
  "verdict": "review",
  "abuse_reports": 0,
  "request_id": "req_5f2c9a7e-3b1d-4e8a-9c6f-0d4b2a8e1f73",
  "billable_lookups": 1,
  "processing_time_sec": 0.142
}

Endpoint reference

Full request and response detail for every endpoint lives on its own page, so this one stays readable.

Node.js

const res = await fetch("https://www.layercall.com/v1/score/user", {
  method: "POST",
  headers: {
    "X-Api-Key": process.env.LAYERCALL_API_KEY,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({ ip, email, phone }),
});
const { verdict, risk_score, top_signals } = await res.json();

if (verdict === "block") {
  // reject the signup or require step-up verification
}

Or use the SDK — npm i layercall, then:

import { LayerCall } from "layercall";

const lc = new LayerCall(process.env.LAYERCALL_API_KEY);
const { verdict, risk_score, top_signals } = await lc.scoreUser({ ip, email, phone });

What /v1/score/user returned, on a live key, for a Tor exit IP, a disposable address and a valid phone number. Three signals checked, so billable_lookups is 3; the same call on a test key bills 0 (review 1d57f789):

{
  "risk_score": 65,
  "verdict": "review",
  "summary": "Needs review (65/100) — Tor exit node, commercial VPN and datacenter ASN.",
  "components": {
    "email": {
      "email": "test@guerrillamail.com",
      "normalized_email": "test@guerrillamail.com",
      "risk_score": 100,
      "verdict": "block",
      "status": "do_not_mail",
      "sub_status": "disposable",
      "deliverability_score": 0,
      "did_you_mean": null,
      "signals": {
        "syntax_valid": true,
        "mx_found": true,
        "is_disposable": true,
        "is_homograph": false,
        "is_role_account": true,
        "is_free_provider": false,
        "is_suspicious_handle": true,
        "is_tagged": false,
        "is_risky_tld": false,
        "is_new_domain": null,
        "has_spf": true,
        "has_dmarc": true,
        "has_website": null,
        "mailbox_exists": null,
        "is_catch_all": null,
        "mailbox_status": "unavailable",
        "has_digital_footprint": null
      },
      "domain": "guerrillamail.com",
      "domain_age_days": null,
      "mx_provider": null,
      "mx_records": [
        "mail.guerrillamail.com."
      ],
      "abuse_reports": 0,
      "digital_footprint": {
        "has_gravatar": false,
        "gravatar_profile_url": null,
        "breach_count": null,
        "seen_in_breach": null
      }
    },
    "phone": {
      "parse_status": "ok",
      "phone": "+14155552671",
      "risk_score": 0,
      "signals": {
        "syntax_valid": true,
        "is_possible": true,
        "is_voip": null,
        "is_premium_rate": false,
        "is_toll_free": false,
        "assigned_area_code": true,
        "is_fictional": false
      },
      "number": {
        "e164": "+14155552671",
        "country": "US",
        "national": "(415) 555-2671",
        "international": "+1 415 555 2671",
        "line_type": "fixed_line_or_mobile"
      },
      "verdict": "allow",
      "abuse_reports": 0
    },
    "ip": {
      "ip": "185.220.101.1",
      "risk_score": 60,
      "signals": {
        "is_vpn": true,
        "is_proxy": true,
        "is_datacenter": true,
        "is_tor": true,
        "recent_abuse": false,
        "is_hijacked_netblock": false
      },
      "geo": {
        "country": "DE",
        "city": "Berlin",
        "asn": "AS60729",
        "isp": "Stiftung Erneuerbare Freiheit"
      },
      "vpn_provider": null,
      "hijacked_source": null,
      "verdict": "review",
      "abuse_reports": 0,
      "request_id": "req_5f2c9a7e-3b1d-4e8a-9c6f-0d4b2a8e1f73"
    }
  },
  "components_checked": [
    "email",
    "phone",
    "ip"
  ],
  "linkage": {
    "device_email_count": null,
    "email_device_count": 0,
    "email_ip_count": 2,
    "subnet_rate_1h": 2,
    "domain_rate_1h": 2
  },
  "actor": {
    "type": "unknown",
    "proven": false,
    "basis": "none",
    "operator": null,
    "trigger": null,
    "detail": "No signature and no device fingerprint. Drop fp.js on the page, or pass the agent's signed request, to get an answer here."
  },
  "top_signals": [
    "ip: tor exit node",
    "ip: commercial vpn",
    "ip: datacenter asn",
    "email: disposable domain",
    "email: role account",
    "email: machine-generated handle"
  ],
  "request_id": "req_5f2c9a7e-3b1d-4e8a-9c6f-0d4b2a8e1f73",
  "billable_lookups": 3,
  "processing_time_sec": 0.142
}

Python

import os, requests

res = requests.post(
    "https://www.layercall.com/v1/score/user",
    json={"ip": ip, "email": email, "phone": phone},
    headers={"X-Api-Key": os.environ["LAYERCALL_API_KEY"]},
    timeout=5,
)
data = res.json()
if data["verdict"] == "block":
    ...  # reject or challenge

Or use the SDK — pip install layercall, then:

import os
from layercall import LayerCall

lc = LayerCall(os.environ["LAYERCALL_API_KEY"])
data = lc.score_user(ip=ip, email=email, phone=phone)

Errors

  • 400 — the request was understood and refused. The codes are: invalid_ip, invalid_email, invalid_phone, invalid_domain, invalid_device_id, invalid_country, invalid_field_type (a number where text belongs — the response names the field), invalid_body, batch_too_large, missing_parameter when nothing was supplied at all, and invalid_parameter for anything else. Retrying the same request will not help.
  • 401 — no key reached us (missing_api_key). If you did send one, a proxy or framework is stripping Authorization: send X-Api-Key: YOUR_KEY instead, which is less often filtered.
  • 403 — invalid or revoked API key (invalid_api_key), or a test key on an endpoint that refuses them (test_key_not_allowed). A key of the wrong shape — truncated or mangled in a copy — lands here too, not on 401, so treat 401 and 403 together as “the key did not work”; the SDKs’ isAuth / is_auth already do.
  • 404 — no such endpoint (not_found, with error: "unknown_endpoint"). The body lists every real endpoint with the methods it accepts.
  • 402 — monthly plan quota exceeded (quota_exceeded), the account is paused after a failed payment (account_paused), your own spend cap stopped it (spend_cap_reached), or the feature belongs to a higher plan (plan_required). Retrying will not help; upgrade, raise the cap, or update your card.
  • 429 — more than 600 requests a minute (rate_limited). Every response carries x-ratelimit-limit and x-ratelimit-remaining so you can pace a bulk job without waiting to be refused. Honour Retry-After and retry.
  • 405 — the endpoint exists but not for that HTTP method (method_not_allowed). The body carries allow, the methods it does take, and the same list is in the Allow header. Most take GET or POST but not both.
  • 422 — on /v1/batch, the Idempotency-Key you sent was already used for a different batch in the last 24 hours (idempotency_key_reused). Send a new key for a new request; reuse a key only to retry the identical batch, which is then not billed again.
  • 500 — something failed on our side (internal_error). Include request_id when reporting it; every error response carries one.
  • 503 — we could not reach the store that says whether your key is valid (auth_unavailable). This is not a rejection — the key was never checked, so do not treat it as invalid_api_key and do not tell your user their credentials are wrong. Retry with a short backoff; it clears by itself.

Recommended integration pattern

Call /v1/score/user at signup or checkout with everything you have, before creating the account or charging the card.

VerdictDo thisNot this
allowLet them through with no friction.—
reviewStep up — email OTP, SMS, or 3-D Secure at checkout. A real user clears it themselves in seconds.Don’t reject. This band includes every commercial VPN user, most of whom are ordinary customers. How to detect VPN and proxy users at signup.
blockReject, or send to a human review queue if the account is worth the handling cost.Don’t reject silently — say something, or your support team learns about it from a bad review.

Prefer step-up over rejection. A challenge lets a legitimate user clear the flag themselves while still stopping an attacker who cannot pass it, so a false positive costs seconds instead of a customer. This is what the large fraud platforms converged on: Stripe Radar blocks only above 75 out of 99 and hands 65–74 to a review queue rather than refusing it, and requests 3-D Secure instead of declining where it can. Sift models the middle band as “Watch”, which explicitly includes asking for mobile verification rather than blocking.

If you already send an OTP to everyone, your step-up is something else. Passwordless and magic-link products cannot use an email code as conditional friction, because it is already mandatory and it happens before the account exists — there is nothing left to escalate to. Score after sign-in instead and use a different lever on review: hold the account in a limited state, delay a payout or a first send, require SMS or a card on file, or simply queue it for a look. We run exactly this way ourselves, which is why our own scoring is observational rather than a gate.

Fail open. If this API is unreachable, let the signup proceed. Losing a real customer to our downtime is a worse outcome than admitting one fraudster, and it is the failure mode you will never see in your metrics.

Measure before you tighten. Log the verdict without acting on it for a week or two, then compare it against the accounts that turned out fine. If you already verify email with a one-time code, everyone who completes it is real by the only test that matters at signup, so any block on that group is a false positive you can count exactly. Tune strictness against that number rather than a guess.

OpenAPI specification

The full API is described by an OpenAPI 3.1 document at /openapi.json. Generate a typed client in any language with openapi-generator, or point an AI coding assistant at it to scaffold your integration.

Version numbers: the /v1 in every path is the API version, and the spec's own version (1.0.0) describes that same contract. The SDKs carry their own version numbers because they are released separately; every SDK 1.x calls /v1.

curl https://www.layercall.com/openapi.json -o layercall.json

Postman

A ready-made collection covering every endpoint, each request pre-filled with input that actually returns signals — a Tor exit node, a disposable mailbox — rather than a clean value that tells you nothing. Import the URL below, set the apiKey variable, and send. A tl_test_ key works for everything except the two endpoints that write to the shared reputation network, which say so on the request itself. The Destructive folder deletes every rule and replaces your agent policy, so both ship disarmed and say what to change before they take effect.

https://www.layercall.com/layercall.postman_collection.json

In Postman: Import → Link, then paste that URL. The collection is generated from the OpenAPI document above and tested against production, so it cannot describe an endpoint this API does not have.