Skip to content

Siteverify

Your backend redeems each token once, with your site’s secret, and acts on the decision in the reply.

Important

success is not a verdict

success: true only means the token is genuine, unexpired and unused. It says nothing about whether to let the request through. Always act on decision.

A Turnstile-style handler that checks only success lets blocked bots through. It’s the most common mistake when switching.

Request

POST https://hc.acecaptcha.com/v1/siteverify with a JSON or application/x-www-form-urlencoded body of at most 16 KiB.

secretRequired
Your site’s secret.
responseRequired
The token from your page.
remoteipOptional
The visitor’s IP address as your server saw it. It only fills ip_match in the reply.
actionOptional
The action you expect. A token issued for a different action fails with action-mismatch and is not used up.
{  "secret": "ace_secret_…",  "response": "<the token from execute>",  "remoteip": "203.0.113.7",  "action": "login"}

Call siteverify from your server only. The secret never goes to the browser, and each token verifies once.

Response

A verified token answers HTTP 200:

200 OK
{  "success": true,  "error-codes": [],  "sitekey": "ace_site_…",  "hostname": "shop.example.com",  "challenge_ts": "2026-11-21T09:30:12.000Z",  "action": "login",  "decision": "allow",  "mode": "enforce",  "ip_match": true}
success
The token is genuine, unexpired and unused. Not a verdict: see below.
error-codes
Empty on success; otherwise one of the error codes.
decision
allow, allow_limited or block. Act on this.
mode
shadow or enforce: the site’s mode, so your backend can branch.
action
The action the token was issued for.
hostname
The hostname of the page that ran the check, validated by AceCaptcha.
challenge_ts
When the token was issued (ISO 8601).
sitekey
The sitekey the token was issued for.
ip_match
When you sent remoteip: true if it matches the address the check came from (the same IP, the same /24 for IPv4 or the same /48 for IPv6), otherwise false. null when you didn’t send it.

success is not a verdict

success answers “is this a real, fresh, unused token?”. decision answers “what should I do with this request?”. A bot can hold a genuine token and still get block, so a handler has to read both: refuse when success is false, then act on decision.

Decisions

allow
Proceed.
allow_limited
Proceed, with tighter limits on this request. For example: stricter rate limits for the account, IP or session; email or SMS verification on signup; holding an order for review; no high-value actions without extra friction.
block
Refuse the request, with a generic error.

Keep the refusal generic (“Please try again.”), so it doesn’t tell a bot what it tripped.

Modes

Mode is a site setting, and siteverify echoes it in every reply as mode, so your backend can branch without its own switch.

  • shadow (the default, Invisible in the dashboard) is for rolling out safely. Nobody is asked to do anything, so a visitor the check isn’t sure about comes back as allow_limited. Log decision, but don’t refuse anything on it yet.
  • enforce gives visitors the check isn’t sure about a short visible check, and how it goes decides the answer. Act on decision. Enforce mode and the visible check are plan features.

Error replies carry no mode, so the samples below keep refusing a failed verification (success: false) in shadow mode too, just as a handler for your current captcha would.

Advanced data

On plans with advanced data (Enterprise), a successful reply also carries a detail block: the score behind the decision, and ids for the visitor’s device. Other replies are unchanged, so a handler written for the plain reply keeps working.

200 OK
{  "success": true,  "error-codes": [],  "sitekey": "ace_site_…",  "hostname": "shop.example.com",  "challenge_ts": "2026-11-21T09:30:12.000Z",  "action": "login",  "decision": "allow",  "mode": "enforce",  "ip_match": true,  "detail": {    "v": 1,    "score": 0.12,    "band": "pass",    "device": {      "id": "lUA3A1zAGYjHQPefytgPYQ",      "machine": null    }  }}
v
The version of this block, 1. New fields may be added within a version; ignore the ones you don’t know.
score
From 0 to 1: how likely the check was automated. Higher is more likely a bot. For your logs and reviews; decision already applies your site’s thresholds.
band
pass, gray or fail: where the score fell against your site’s thresholds.
device.id
An id for the visitor’s browser, stable on your site until the visitor clears the browser storage for hc.acecaptcha.com. Use it for per-device rate limits or to link accounts that share a browser.
device.machine
An id for the visitor’s computer that survives cleared storage and a new network. Only on Windows and Linux desktops, otherwise null: phones and Macs of one model share it, so counting it there would group strangers.

The ids belong to your site alone. The same browser gets a different id on every other site, so ids can’t be matched across sites. Keep acting on decision; detail is extra evidence, not a second verdict. Failed replies and test keys never carry it.

Error codes

Errors answer HTTP 200 with success: false and one code, except internal-error, which answers HTTP 503.

200 OK
{  "success": false,  "error-codes": ["timeout-or-duplicate"]}
missing-input-secret
The secret field is empty.
missing-input-response
The response field is empty.
invalid-input-secret
The secret is unknown, malformed, expired, revoked, or belongs to another site.
invalid-input-response
Not a token, or a token issued for another site. Also returned when the site is suspended or deleted, the page’s hostname has been removed from it, or test and real keys are mixed.
timeout-or-duplicate
The token expired (after 5 minutes) or was already used.
action-mismatch
You sent an action and the token was issued for a different one. The token is not used up.
bad-request
The body couldn’t be parsed, or is over 16 KiB.
internal-error
Sent with HTTP 503 and Retry-After: a temporary fault. See retries and outages.

Retries and outages

  • On internal-error (HTTP 503), wait for Retry-After and retry once. If the retry answers timeout-or-duplicate, ask the visitor to try again.
  • Give each call a timeout (the samples use 5 seconds) so a slow answer can’t hold your request.
  • Decide per action what an outage means. A newsletter signup might fail open (proceed, with limits); a payment might fail closed (refuse and ask the visitor to retry).
  • Don’t retry other errors: each token verifies once, and a retry of a used token answers timeout-or-duplicate.

Samples

Each sample sends JSON, gives up after 5 seconds, retries internal-error once, and returns a decision your handler can act on. In shadow mode it logs the decision and returns allow. Pass failOpen per action to choose what an outage means. The secret comes from the ACE_SECRET environment variable.

// verify.mjs (Node 18+)const SITEVERIFY = 'https://hc.acecaptcha.com/v1/siteverify'/** * Redeems a token. Returns 'allow', 'allow_limited' or 'block'. * failOpen: what this action does when AceCaptcha can't answer. */export async function verifyAce(token, { action, remoteip, failOpen = false } = {}) {  const outage = failOpen ? 'allow_limited' : 'block'  const body = JSON.stringify({ secret: process.env.ACE_SECRET, response: token, action, remoteip })  for (let attempt = 0; attempt < 2; attempt++) {    let reply, data    try {      reply = await fetch(SITEVERIFY, {        method: 'POST',        headers: { 'content-type': 'application/json' },        body,        signal: AbortSignal.timeout(5000),      })      data = await reply.json()    } catch {      return outage // network failure, 5 s timeout or unreadable reply    }    if (data['error-codes']?.includes('internal-error')) {      if (attempt === 1) return outage      const wait = Math.min(Number(reply.headers.get('retry-after')) || 1, 5)      await new Promise((resolve) => setTimeout(resolve, wait * 1000))      continue    }    if (!data.success) return 'block' // missing, invalid, expired or used token    if (data.mode === 'shadow') {      console.info('acecaptcha shadow', action, data.decision)      return 'allow'    }    return data.decision // act on decision, never on success alone  }  return outage}// In your route (Express shown)://   const decision = await verifyAce(req.body['ace-token'], { action: 'login', remoteip: req.ip })//   if (decision === 'block') return res.status(403).send('Please try again.')//   if (decision === 'allow_limited') { /* proceed, with tighter limits */ }

Turnstile compatibility

Siteverify follows Turnstile’s shape, so most handlers change in a few lines:

  • the same request fields: secret, response, remoteip;
  • the same reply fields: success, error-codes, hostname, challenge_ts, action;
  • the same codes: missing-input-*, invalid-input-*, timeout-or-duplicate, bad-request, internal-error.

AceCaptcha adds:

  • decision, mode, ip_match and sitekey in replies;
  • server-side action enforcement in requests, with the action-mismatch code.

See Migrate for side-by-side changes from Turnstile, reCAPTCHA and hCaptcha.