Skip to content
Ksarfr

Developers

One request at signup, one clear decision

Call the API from your server at signup time: you know whether to block the address and whether to grant the promo offer. Answers in milliseconds.

curl -X POST https://api.useksar.com/v1/check-email \
  -H "x-api-key: $KSAR_API_KEY" \
  -H "content-type: application/json" \
  -d '{"email":"[email protected]","event":"signup","offer":"welcome_discount"}'

200 OK

{
  "block": false,
  "risk_score": 6,
  "duplicate": { "status": "exact", "count": 2 },
  "offer": { "decision": "deny", "reasons": ["duplicate_exact"] }
}

Quick start

Live in three steps

  1. 1

    Create an account

    Free signup, no credit card. Your API key is shown once: copy it.

  2. 2

    Keep the key server-side

    Store it in an environment variable (KSAR_API_KEY). It must never appear in a browser or a mobile app.

  3. 3

    Make the first call

    Send the address with event "signup" at signup time, then apply block and offer.decision. The dashboard has a "Test now" button.

Response

The fields to use

The full response is described in the reference; these fields are enough to decide.

FieldValuesMeaning
blockbooleantrue: refuse the signup (disposable address, domain without email…).
risk_score0–100Risk score of the address; block is true above your threshold.
reasonsstring[]Detected reasons (disposable_domain, no_mx, duplicate_exact…).
duplicate.statusnone · exact · seriesThe same person (or a series of similar addresses) already signed up.
offer.decisiongrant · defer · denyGrant the promo offer, put it on hold (granted later) or deny it.
modeenforce · shadowshadow: test mode, nothing is blocked; real decisions are in shadow.
degradedbooleantrue if an internal dependency was unavailable: answer with the available signals.
not_includedstring[]Features not included in your plan (duplicates, promo offer decision…).

Best practices

An integration that never breaks your form

  • Server-side only

    The key gives access to your account: never call from a browser or a mobile app.

  • Short timeout, then let it through

    Use a 2-second timeout. On error, timeout or unexpected answer, accept the signup: your form must never go down because of the API.

  • Quota reached (429)

    quota_exceeded: let signups through until the reset (resets_at) or upgrade; you are warned by email at 80% and 100%. rate_limit_exceeded: honour Retry-After.

  • Signup or simple check

    event "signup" records the signup (duplicates, reports); event "check" analyses without recording anything. Add external_id to match your accounts.

  • Promo offer on hold

    With offer.decision "defer", grant the promo offer later: send the events (email confirmed, first purchase) to /v1/signups/{signup_id}/events.

Example: call with timeout and fallback

// Called by your server at signup.
async function checkSignup(email) {
  try {
    const res = await fetch('https://api.useksar.com/v1/check-email', {
      method: 'POST',
      headers: { 'x-api-key': process.env.KSAR_API_KEY, 'content-type': 'application/json' },
      body: JSON.stringify({ email, event: 'signup', offer: 'welcome_discount' }),
      signal: AbortSignal.timeout(2000),
    });
    if (!res.ok) return { block: false, offer: 'grant' }; // 429, 5xx : let it through
    const data = await res.json();
    return { block: data.block, offer: data.offer.decision };
  } catch {
    return { block: false, offer: 'grant' }; // timeout or network: let it through
  }
}

Errors

Error codes

HTTPerrorWhat to do
400invalid_emailSyntactically invalid address: ask the user to fix it.
401invalid_api_keyMissing, revoked or invalid key: check the environment variable.
403insufficient_scopeThe key lacks the required scope (check or admin).
403plan_upgrade_requiredFeature not included in your plan (report, CSV audit).
403account_suspendedAccount suspended: contact us; let signups through.
429rate_limit_exceededToo many requests per minute: honour Retry-After.
429quota_exceededMonthly quota reached: let signups through.
503service_unavailableService temporarily unavailable: let signups through.

Sandbox

Try every feature without an account

A fictitious customer of your own for 24 hours: signups, rules, report in euros, file audit and GDPR erasure.