Skip to content

API

Anything you can do on the portal you can also do over HTTP: provision site keys, write access control rules, pull traffic and audit data, manage team members and configure Prosopo Protect. This page lists every endpoint that is reachable from outside Prosopo and what each one is for.

Base URL: https://api.prosopo.io

CredentialEndpoints
VerificationYour site’s secret key, in the request body/siteverify
Management APIAn API key, in the Authorization headerEverything on this page

Verification is the hot path your backend calls once per form submission, so it is deliberately separate: it takes the secret key of the site being verified and needs no API key. See Server-side verification.

Everything else is the management API, described below.

Create an API key in the portal under API Keys, or with /api-keys/create. Send it as a bearer token:

Terminal window
curl -X POST https://api.prosopo.io/sites/get \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{}'

A call succeeds only if all of the following hold:

  • The API feature is enabled on your account. It is off by default — contact support to have it turned on.
  • The feature the endpoint belongs to (Sites, Access Rules, Traffic, …) is enabled on your account.
  • The key carries the permission listed against that endpoint below.
  • The key has not expired, if it was created with an expiry.

Two things follow from how the token is built:

  • The token carries only your account id and the key id. Permissions live on your account and are read on every request, so a key never has to be reissued to stay valid — but there is no endpoint for editing them either. Changing what a key can do means deleting it and creating a replacement.
  • The account comes from the key. Several request bodies still accept an accountId or token field; they are ignored for API-key callers, and the account is always the one that owns the key.

expiresIn (seconds) is set at creation. Omit it, or send 0, for a key that does not expire. An expired key returns 401. Rotate by creating a new key and deleting the old one.

Send POST with a JSON body unless the table says otherwise (application/x-www-form-urlencoded and multipart/form-data are also accepted). Endpoints that take no parameters accept an empty body or {}.

Errors come back as:

{ "error": { "code": 403, "message": "Insufficient permissions", "key": "API.INSUFFICIENT_PERMISSIONS" } }
StatusWhen
400Body missing, unparsable, or failing schema validation
401Authorization header missing, malformed, or the key has expired
403Key lacks the permission, the feature is not enabled on the account, the account is disabled, or a write was attempted on an account that still owes a payment method
404Account, site key or Protect instance not found
429Too many Protect data requests; wait for the number of seconds in the Retry-After header
500Unhandled server error

The key is stable and never translated, so log that rather than the message. Errors the widget itself shows visitors are listed in the Error Reference.

Provision and configure site keys from your own tooling — useful if you spin up tenants, staging environments or customer sites programmatically rather than clicking through the portal.

Requires the Sites feature.

EndpointPermissionBodyReturns
POST /sites/getgetSites{}Array of every site on the account
POST /site/getgetSite{ siteKey }One site
POST /sites/createcreateSite{ name, settings }The created site
POST /sites/updateupdateSite{ siteKey, name?, settings?, isDefault? }The updated site
POST /sites/deletedeleteSite{ siteKey }{ success, deactivatedSiteKey }

A site object carries name, siteKey, secretKey, settings, active, createdAt and updatedAt. Treat responses as secret: they contain the site’s secret key.

settings is the same configuration the portal edits — domains (required, at least one), captchaType, frictionlessThreshold, imageThreshold, powDifficulty, verifiedTimeout, solutionTimeout, ipValidationRules, spamFilter, trafficFilter, honeypot and the rest. See CAPTCHA Types, Safety Threshold, Image Accuracy Threshold, IP Validation Rules, Traffic Filter and Email Filter.

On create:

  • name must be alphanumeric with hyphens and underscores, and unique within your account.
  • The site key and secret key are generated for you; you cannot choose them.
  • Domains are normalised before they are stored: lowercased, with http(s)://, a leading www. and any trailing slash stripped. Subdomain wildcards such as *.example.com are accepted; a bare * is not.
  • The number of non-localhost domains a site may carry is capped by your plan — one on the free tier.
  • Delete deactivates the site rather than erasing it, and the last remaining site cannot be deactivated.

New and changed sites are pushed to the CAPTCHA providers asynchronously, so allow a short delay before the widget picks up a change.

Write and revoke rules from your own detection stack — feed a SIEM verdict, a fraud signal or an abuse report straight into a block without a human in the portal.

Requires the Access Rules feature. The concepts (fields, operators, policies, precedence) are covered in Access Control Rules.

EndpointPermissionBodyReturns
POST /access-control/getgetRules{ page?, limit?, ruleGroupId?, sortBy?, sortOrder? }{ rules, ruleCount, ruleGroupsAndCounts, page, pages }
POST /access-control/createcreateRule{ rule }{ status: "Added new rule" }
POST /access-control/group/createcreateRuleGroup{ rule, conditionSets, ruleGroupId? }{ status: "Added rule group", ruleGroupId, ruleCount }
POST /access-control/deletedeleteRule{ userScopeHash }{ status: "Deleted rule" }
POST /access-control/group/deletedeleteRuleGroup{ ruleGroupId }{ status: "Group removal pending. Job ID: …" }

sortBy is one of createdAt, description, expiry, userScopeHash, ruleGroupId; sortOrder is 1 or -1; limit caps at 10000.

A rule looks like this:

Terminal window
curl -X POST https://api.prosopo.io/access-control/create \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"rule": {
"type": "block",
"description": "Scraper reported by fraud pipeline",
"conditions": [
{ "field": "ip", "operator": "equals", "value": "1.1.1.1" },
{ "field": "countryCode", "operator": "equals", "value": "US" }
],
"expiry": "2026-01-01T00:00:00.000Z"
}
}'
  • type is block (fail the request outright), restrict (serve a harder or easier challenge) or allow (skip the challenge; see Allow). A restrict rule may also carry captchaType, solvedImagesCount, imageThreshold, powDifficulty, unsolvedImagesCount, frictionlessScore or deferToVerify. A block rule must not set captchaType or solvedImagesCount — those are rejected, because a block applies to every CAPTCHA type.
  • conditions are ANDed. field is one of ip, ipMask, userId, ja4Hash, userAgent, countryCode, asn, bypassKeyHash; operator must be equals — any other operator is dropped silently.
  • bypassKeyHash is the lowercase hex SHA-256 of a bypass key. Send the hash, never the key: a value that is not a 64-character hex string is rejected. Pair it with type: "allow" and a clientId naming the site the key is for.
  • expiry defaults to one hour from creation if you omit it. Set it explicitly for anything long-lived.
  • ruleGroupId is a free-form string; group deletion removes every rule sharing it, asynchronously via a job.
  • Rules apply account-wide, across every site key, and are pushed to the providers asynchronously.

To delete a single rule you need its userScopeHash, which is returned by /access-control/get. Each rule comes back with its conditions rebuilt, so a read round-trips into the shape create accepts.

Pull the numbers behind the portal’s charts into your own dashboards or billing reconciliation.

Requires the Traffic feature and the permission listed against each endpoint.

EndpointPermissionBodyReturns
POST /gettrafficdatagetTraffic{ token, accountId, siteKeys?, startDate?, endDate?, month?, year?, domain?, bucket? }Array of per-period count rows
POST /getlivesessionsgetLiveSessions{ token, accountId, siteKeys, windowMinutes?, bucketSeconds?, topIpsLimit?, range? }{ points, windowMinutes, bucketSeconds, uniqueIps, topIps }
  • token and accountId are required by the schema but ignored — the account comes from your API key. Send any non-empty string.
  • /gettrafficdata takes either an ISO startDate/endDate pair or a month (1–12) and year, defaulting to the current month. Omit siteKeys for every site on the account; naming a site key you do not own is a 404. domain narrows the counts to requests from that domain and its subdomains.
  • /gettrafficdata returns hourly rows by default; ranges longer than seven days are aggregated per day. Send bucket: "5_minute" for 5-minute rows instead. They are kept for 7 days and are not split by domain, so bucket: "5_minute" with a domain is an error.
  • /getlivesessions reads raw sessions for one or more of your site keys. siteKeys is required; naming one you do not own is a 404. It covers the last windowMinutes (5–360, default 60) in bucketSeconds buckets (30–3600, default 60). points only contains buckets that saw traffic, so gap-fill client-side. Each point counts pow, image, puzzle, iconOrder, audio, blocked and frictionless (sessions that were never shown a challenge) sessions.

The portal’s Top IPs report is /getlivesessions: topIps lists the IP addresses with the most sessions in the period, busiest first, and uniqueIps is how many distinct IPs there were in total.

  • topIpsLimit sets how many IPs come back, 1–500 (default 10).
  • Each entry has ip, total (sessions), blocked and challenged (sessions given a CAPTCHA). On Professional and Enterprise plans it also has countryCode, asn, asnName, isVpn, isTor, isProxy, isDatacenter and isAbuser.
  • To look at a fixed period instead of the last windowMinutes, send range: { from, to } as ISO timestamps. from is included and to is not, and a range can cover at most 6 hours.
Terminal window
curl -X POST https://api.prosopo.io/getlivesessions \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"token": "-",
"accountId": "-",
"siteKeys": ["YOUR_SITE_KEY"],
"topIpsLimit": 50,
"range": { "from": "2026-11-18T12:00:00Z", "to": "2026-11-18T13:00:00Z" }
}'

Search individual CAPTCHA attempts — the same data as the portal’s Audit page — to investigate an incident or export evidence.

Requires the Search Captcha Records feature and the searchCaptchaRecords permission.

EndpointBodyReturns
POST /audit/searchcaptcharecords{ siteKey?, captchaType?, searchCriteria?, startDate?, endDate?, pagination? }{ records, total, totalIsExact?, limit, hasMore, lastId?, lastTimestamp? }
  • captchaType is pow, image, puzzle, all (default) or blocked — the last covers requests stopped before a CAPTCHA was chosen, which exist only as sessions.
  • startDate / endDate are epoch milliseconds. They default to the last seven days, and are clamped to a 30-day lookback — an older startDate is silently pulled forward rather than rejected.
  • Omit siteKey to search every site on the account; naming one you do not own is a 404.
  • pagination is { limit, lastId?, lastTimestamp? }, limit 1–100 (default 20). Page forward by feeding the lastId and lastTimestamp from the previous response back in.
  • searchCriteria narrows on ip, ja4, userAgent, userAccount, countryCode, deviceType, vpn, webView, iFrame, status, selectionReason, resultReason, accessRule, policyType, triggeredDetectors or a freeText substring across the displayable fields.
  • total is capped server-side; when totalIsExact is false the real total is higher.

Mirror your own identity system — add a starter, revoke a leaver — without anyone logging into the portal.

Requires the Users feature.

EndpointPermissionBodyReturns
GET /users/getgetUsers—Array of users
POST /users/createcreateUser{ email, name, role }The created user
PUT /users/updateupdateUser{ email, name?, userType?, marketingPreferences? }{ success }
POST /users/deletedeleteUser{ email }{ success, deletedUserEmail }

role and userType are admin or viewer. The account owner cannot be created, changed or removed through the API, and the last remaining user cannot be deleted.

Rotate credentials on a schedule from CI.

Requires the API feature.

EndpointPermissionBodyReturns
POST /api-keys/getgetApiKeys{}Array of keys, each including its token
POST /api-keys/createcreateApiKey{ name, permissions, expiresIn? }The created key, including its token
POST /api-keys/deletedeleteApiKey{ apiKeyId }{ success: true }

permissions is keyed by feature:

{
"name": "CI rule writer",
"expiresIn": 604800,
"permissions": {
"AccessRules": ["getRules", "createRule", "deleteRule"],
"Traffic": ["getTraffic"]
}
}

Every feature named must be enabled on the account, and at least one permission must be granted, or the call is rejected. Deleting a key invalidates it immediately. See API Keys for the full permission list.

Configure and observe edge protection: manage instances, read the verdict log and maintain the edge access rules. See Prosopo Protect for what the product does.

Requires the Protect feature. Each endpoint has its own permission, listed against it, so a key can be limited to reading verdicts, say, without being able to change an instance or block a session. In the portal’s Create API Key dialog the Protect permissions are grouped, and each group can be selected at once.

EndpointPermissionBodyPurpose
POST /protect/instancesgetProtectInstances{}List instances
POST /protect/instances/createcreateProtectInstance{ name, cname, globalSiteKey, ipCategoryRules, … }Create an instance
POST /protect/instances/updateupdateProtectInstance{ id, … }Update an instance
POST /protect/instances/deletedeleteProtectInstance{ id }Delete an instance
POST /protect/client-jwt/generategenerateProtectClientJwt{ protectInstanceId, expiresInWeeks }Issue the JWT the edge worker authenticates with (0 weeks = effectively unlimited)
POST /protect/verdictsgetProtectVerdicts{ siteKey?, since?, until?, limit?, offset?, decision?, sources?, firedRules?, asn?, deviceType?, requestPath?, minRulesFired? }Page the verdict log
POST /protect/verdicts/searchsearchProtectVerdicts{ ip?, jti?, asn?, siteKey? }Find verdicts for one client
POST /protect/verdicts/distinct-sourcesgetDistinctVerdictSources{ since, until?, siteKey? }Distinct verdict sources in a window
POST /protect/verdicts/distinct-fired-rulesgetDistinctVerdictFiredRules{ since, until?, siteKey? }Distinct fired rule ids in a window
POST /protect/risk-historygetProtectRiskHistory{ jti, siteKey? }Risk score history for one session
POST /protect/session-telemetrygetProtectSessionTelemetry{ jti, siteKey? }Telemetry for one session
POST /protect/sessions/blockblockProtectSession{ jti, hours, reason?, siteKey? }Block one session
POST /protect/sessions/unblockunblockProtectSession{ jti, siteKey? }Lift a session block
POST /protect/traffic-summarygetProtectTrafficSummary{ siteKey?, since?, bucket?, source? }Bucketed traffic totals
POST /protect/traffic-by-dimensiongetProtectTrafficByDimension{ groupBy, siteKey?, since?, until?, bucket?, topN?, … }Time series split by decision, source, country, asn, ip_category, ja4, user_agent, request_path, fired_rule, device_type, enforcement_policy or none
POST /protect/traffic-reportgetProtectTrafficReport{ siteKey?, since?, until?, bucket?, endpoints? }The portal’s traffic report
POST /protect/traffic-endpointsgetProtectTrafficEndpoints{ siteKey?, since?, until?, bucket?, endpoints? }Traffic per protected endpoint
POST /protect/challenge-outcomesgetProtectChallengeOutcomes{ siteKey?, since?, until?, bucket?, endpoints? }How challenged visitors got on
POST /protect/access-rulesgetProtectAccessRules{ siteKey? }List edge access rules
POST /protect/access-rules/createcreateProtectAccessRule{ rules: [{ type, value, verdict }] }Add edge access rules
POST /protect/access-rules/deletedeleteProtectAccessRule{ conditions: [{ type, value }] }Remove edge access rules
POST /protect/partner-keysgetProtectPartnerKeys{ siteKey? }List partner API keys, without the keys themselves
POST /protect/partner-keys/createcreateProtectPartnerKey{ name, paths, rateLimit, rateWindowSecs, allowedNetworks?, siteKey? }Issue a partner API key. The response holds the key, once.
POST /protect/partner-keys/revokerevokeProtectPartnerKey{ id, siteKey? }Revoke a partner API key
  • Omit siteKey and the endpoint uses your account’s active instance; with no matching instance the response is 404 with { "error": "No active protect instance found" }.
  • Edge rule verdict is allow, challenge or block, and type is one of the fields Protect matches on: ip, ipMask, ja4Hash, userAgent, countryCode or asn.
  • The read endpoints proxy the verdict-log service and return its payload unchanged.

Seven of the read endpoints also answer GET, so a dashboard, SIEM or script can pull verdicts, sessions and traffic with a plain URL. Each takes the same permission as its POST form.

EndpointPermissionQuery parameters
GET /protect/verdictsgetProtectVerdictssiteKey, since, until, limit (1–500), offset, decision, sources, firedRules, endpoints, countries, platforms, asn, deviceType, requestPath, minRulesFired, population
GET /protect/verdicts/searchsearchProtectVerdictsip, jti, asn, siteKey, limit
GET /protect/risk-historygetProtectRiskHistoryjti (required), siteKey
GET /protect/session-telemetrygetProtectSessionTelemetryjti (required), siteKey
GET /protect/traffic-summarygetProtectTrafficSummarysiteKey, since, bucket, source
GET /protect/traffic-by-dimensiongetProtectTrafficByDimensiongroupBy, siteKey, since, until, bucket, topN, and the same filters as /protect/verdicts
GET /protect/traffic-reportgetProtectTrafficReportsiteKey, since, until, bucket, endpoints
Terminal window
curl "https://api.prosopo.io/protect/traffic-summary?since=2026-11-24T00:00:00Z&bucket=5_minute" \
-H "Authorization: Bearer YOUR_API_KEY"
curl "https://api.prosopo.io/protect/verdicts?decision=block&countries=GB,FR&limit=100" \
-H "Authorization: Bearer YOUR_API_KEY"
  • Times are ISO 8601 (2026-11-24T00:00:00Z). URL-encode a + in a time zone offset as %2B, or use Z.
  • A list parameter (sources, firedRules, endpoints, countries, platforms) takes comma-separated values, or the same parameter repeated: countries=GB&countries=FR.
  • bucket is minute, 5_minute, 15_minute, hour or day. A request that needs more than 2,016 buckets (a week of 5-minute buckets) is refused with 400: use a shorter window or a larger bucket. Hourly buckets cover 30 days.
  • Rate limit. API-key calls to the Protect data endpoints (everything above, plus the distinct-sources, distinct-fired-rules, traffic-endpoints and challenge-outcomes endpoints, by GET or POST) share a limit of 30 requests per minute for each account. Every key on the account counts towards the same limit. Over the limit the response is 429 with a Retry-After header giving the seconds until the next minute starts. The limit does not apply to the portal.
  • The responses are the same as the portal sees, and may change as Protect develops. Read the fields you need and ignore ones you don’t recognise.

Report events from your own systems to Protect. Each endpoint has a permission that reports events and does nothing else, so the credential a log shipper holds cannot change what Protect enforces.

EndpointPermissionBodyReturns
POST /protect/client-eventsingestClientEvents{ protectInstanceId, entries } (1–1000 entries){ received, inserted, duplicates, outOfWindow }
POST /protect/client-events/logs?token=…&instanceId=…&format=…ingestClientEventLogsYour logging system’s webhook payload, unchanged{ received, parsed, skipped, inserted, duplicates, outOfWindow, truncated }
  • /protect/client-events/logs takes the API key in the token query parameter, for webhooks that cannot set headers. Query strings end up in request logs, so give that key ingestClientEventLogs and nothing else.
  • format names the log feed and must be one Prosopo supports. The portal’s client event feed setup builds the full URL for you.
  • Resending a batch is safe: rows already stored are counted under duplicates rather than inserted twice.