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
Two kinds of credential
Section titled Two kinds of credential| Credential | Endpoints | |
|---|---|---|
| Verification | Your site’s secret key, in the request body | /siteverify |
| Management API | An API key, in the Authorization header | Everything 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.
Authentication
Section titled AuthenticationCreate an API key in the portal under API Keys, or with /api-keys/create. Send it as a
bearer token:
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
accountIdortokenfield; they are ignored for API-key callers, and the account is always the one that owns the key.
Key expiry
Section titled Key expiryexpiresIn (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.
Request and response format
Section titled Request and response formatSend 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" } }| Status | When |
|---|---|
400 | Body missing, unparsable, or failing schema validation |
401 | Authorization header missing, malformed, or the key has expired |
403 | Key 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 |
404 | Account, site key or Protect instance not found |
429 | Too many Protect data requests; wait for the number of seconds in the Retry-After header |
500 | Unhandled 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.
Sites
Section titled SitesProvision 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.
| Endpoint | Permission | Body | Returns |
|---|---|---|---|
POST /sites/get | getSites | {} | Array of every site on the account |
POST /site/get | getSite | { siteKey } | One site |
POST /sites/create | createSite | { name, settings } | The created site |
POST /sites/update | updateSite | { siteKey, name?, settings?, isDefault? } | The updated site |
POST /sites/delete | deleteSite | { 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:
namemust 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 leadingwww.and any trailing slash stripped. Subdomain wildcards such as*.example.comare 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.
Access control rules
Section titled Access control rulesWrite 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.
| Endpoint | Permission | Body | Returns |
|---|---|---|---|
POST /access-control/get | getRules | { page?, limit?, ruleGroupId?, sortBy?, sortOrder? } | { rules, ruleCount, ruleGroupsAndCounts, page, pages } |
POST /access-control/create | createRule | { rule } | { status: "Added new rule" } |
POST /access-control/group/create | createRuleGroup | { rule, conditionSets, ruleGroupId? } | { status: "Added rule group", ruleGroupId, ruleCount } |
POST /access-control/delete | deleteRule | { userScopeHash } | { status: "Deleted rule" } |
POST /access-control/group/delete | deleteRuleGroup | { 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:
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" } }'typeisblock(fail the request outright),restrict(serve a harder or easier challenge) orallow(skip the challenge; see Allow). Arestrictrule may also carrycaptchaType,solvedImagesCount,imageThreshold,powDifficulty,unsolvedImagesCount,frictionlessScoreordeferToVerify. Ablockrule must not setcaptchaTypeorsolvedImagesCount— those are rejected, because a block applies to every CAPTCHA type.conditionsare ANDed.fieldis one ofip,ipMask,userId,ja4Hash,userAgent,countryCode,asn,bypassKeyHash;operatormust beequals— any other operator is dropped silently.bypassKeyHashis 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 withtype: "allow"and aclientIdnaming the site the key is for.expirydefaults to one hour from creation if you omit it. Set it explicitly for anything long-lived.ruleGroupIdis 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.
Traffic
Section titled TrafficPull 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.
| Endpoint | Permission | Body | Returns |
|---|---|---|---|
POST /gettrafficdata | getTraffic | { token, accountId, siteKeys?, startDate?, endDate?, month?, year?, domain?, bucket? } | Array of per-period count rows |
POST /getlivesessions | getLiveSessions | { token, accountId, siteKeys, windowMinutes?, bucketSeconds?, topIpsLimit?, range? } | { points, windowMinutes, bucketSeconds, uniqueIps, topIps } |
tokenandaccountIdare required by the schema but ignored — the account comes from your API key. Send any non-empty string./gettrafficdatatakes either an ISOstartDate/endDatepair or amonth(1–12) andyear, defaulting to the current month. OmitsiteKeysfor every site on the account; naming a site key you do not own is a404.domainnarrows the counts to requests from that domain and its subdomains./gettrafficdatareturns hourly rows by default; ranges longer than seven days are aggregated per day. Sendbucket: "5_minute"for 5-minute rows instead. They are kept for 7 days and are not split by domain, sobucket: "5_minute"with adomainis an error./getlivesessionsreads raw sessions for one or more of your site keys.siteKeysis required; naming one you do not own is a404. It covers the lastwindowMinutes(5–360, default 60) inbucketSecondsbuckets (30–3600, default 60).pointsonly contains buckets that saw traffic, so gap-fill client-side. Each point countspow,image,puzzle,iconOrder,audio,blockedandfrictionless(sessions that were never shown a challenge) sessions.
Top IPs
Section titled Top IPsThe 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.
topIpsLimitsets how many IPs come back, 1–500 (default 10).- Each entry has
ip,total(sessions),blockedandchallenged(sessions given a CAPTCHA). On Professional and Enterprise plans it also hascountryCode,asn,asnName,isVpn,isTor,isProxy,isDatacenterandisAbuser. - To look at a fixed period instead of the last
windowMinutes, sendrange: { from, to }as ISO timestamps.fromis included andtois not, and a range can cover at most 6 hours.
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" } }'Audit records
Section titled Audit recordsSearch 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.
| Endpoint | Body | Returns |
|---|---|---|
POST /audit/searchcaptcharecords | { siteKey?, captchaType?, searchCriteria?, startDate?, endDate?, pagination? } | { records, total, totalIsExact?, limit, hasMore, lastId?, lastTimestamp? } |
captchaTypeispow,image,puzzle,all(default) orblocked— the last covers requests stopped before a CAPTCHA was chosen, which exist only as sessions.startDate/endDateare epoch milliseconds. They default to the last seven days, and are clamped to a 30-day lookback — an olderstartDateis silently pulled forward rather than rejected.- Omit
siteKeyto search every site on the account; naming one you do not own is a404. paginationis{ limit, lastId?, lastTimestamp? },limit1–100 (default 20). Page forward by feeding thelastIdandlastTimestampfrom the previous response back in.searchCriterianarrows onip,ja4,userAgent,userAccount,countryCode,deviceType,vpn,webView,iFrame,status,selectionReason,resultReason,accessRule,policyType,triggeredDetectorsor afreeTextsubstring across the displayable fields.totalis capped server-side; whentotalIsExactisfalsethe real total is higher.
Team members
Section titled Team membersMirror your own identity system — add a starter, revoke a leaver — without anyone logging into the portal.
Requires the Users feature.
| Endpoint | Permission | Body | Returns |
|---|---|---|---|
GET /users/get | getUsers | — | Array of users |
POST /users/create | createUser | { email, name, role } | The created user |
PUT /users/update | updateUser | { email, name?, userType?, marketingPreferences? } | { success } |
POST /users/delete | deleteUser | { 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.
API keys
Section titled API keysRotate credentials on a schedule from CI.
Requires the API feature.
| Endpoint | Permission | Body | Returns |
|---|---|---|---|
POST /api-keys/get | getApiKeys | {} | Array of keys, each including its token |
POST /api-keys/create | createApiKey | { name, permissions, expiresIn? } | The created key, including its token |
POST /api-keys/delete | deleteApiKey | { 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.
Prosopo Protect
Section titled Prosopo ProtectConfigure 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.
| Endpoint | Permission | Body | Purpose |
|---|---|---|---|
POST /protect/instances | getProtectInstances | {} | List instances |
POST /protect/instances/create | createProtectInstance | { name, cname, globalSiteKey, ipCategoryRules, … } | Create an instance |
POST /protect/instances/update | updateProtectInstance | { id, … } | Update an instance |
POST /protect/instances/delete | deleteProtectInstance | { id } | Delete an instance |
POST /protect/client-jwt/generate | generateProtectClientJwt | { protectInstanceId, expiresInWeeks } | Issue the JWT the edge worker authenticates with (0 weeks = effectively unlimited) |
POST /protect/verdicts | getProtectVerdicts | { siteKey?, since?, until?, limit?, offset?, decision?, sources?, firedRules?, asn?, deviceType?, requestPath?, minRulesFired? } | Page the verdict log |
POST /protect/verdicts/search | searchProtectVerdicts | { ip?, jti?, asn?, siteKey? } | Find verdicts for one client |
POST /protect/verdicts/distinct-sources | getDistinctVerdictSources | { since, until?, siteKey? } | Distinct verdict sources in a window |
POST /protect/verdicts/distinct-fired-rules | getDistinctVerdictFiredRules | { since, until?, siteKey? } | Distinct fired rule ids in a window |
POST /protect/risk-history | getProtectRiskHistory | { jti, siteKey? } | Risk score history for one session |
POST /protect/session-telemetry | getProtectSessionTelemetry | { jti, siteKey? } | Telemetry for one session |
POST /protect/sessions/block | blockProtectSession | { jti, hours, reason?, siteKey? } | Block one session |
POST /protect/sessions/unblock | unblockProtectSession | { jti, siteKey? } | Lift a session block |
POST /protect/traffic-summary | getProtectTrafficSummary | { siteKey?, since?, bucket?, source? } | Bucketed traffic totals |
POST /protect/traffic-by-dimension | getProtectTrafficByDimension | { 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-report | getProtectTrafficReport | { siteKey?, since?, until?, bucket?, endpoints? } | The portal’s traffic report |
POST /protect/traffic-endpoints | getProtectTrafficEndpoints | { siteKey?, since?, until?, bucket?, endpoints? } | Traffic per protected endpoint |
POST /protect/challenge-outcomes | getProtectChallengeOutcomes | { siteKey?, since?, until?, bucket?, endpoints? } | How challenged visitors got on |
POST /protect/access-rules | getProtectAccessRules | { siteKey? } | List edge access rules |
POST /protect/access-rules/create | createProtectAccessRule | { rules: [{ type, value, verdict }] } | Add edge access rules |
POST /protect/access-rules/delete | deleteProtectAccessRule | { conditions: [{ type, value }] } | Remove edge access rules |
POST /protect/partner-keys | getProtectPartnerKeys | { siteKey? } | List partner API keys, without the keys themselves |
POST /protect/partner-keys/create | createProtectPartnerKey | { name, paths, rateLimit, rateWindowSecs, allowedNetworks?, siteKey? } | Issue a partner API key. The response holds the key, once. |
POST /protect/partner-keys/revoke | revokeProtectPartnerKey | { id, siteKey? } | Revoke a partner API key |
- Omit
siteKeyand the endpoint uses your account’s active instance; with no matching instance the response is404with{ "error": "No active protect instance found" }. - Edge rule
verdictisallow,challengeorblock, andtypeis one of the fields Protect matches on:ip,ipMask,ja4Hash,userAgent,countryCodeorasn. - The read endpoints proxy the verdict-log service and return its payload unchanged.
Reading Protect data
Section titled Reading Protect dataSeven 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.
| Endpoint | Permission | Query parameters |
|---|---|---|
GET /protect/verdicts | getProtectVerdicts | siteKey, since, until, limit (1–500), offset, decision, sources, firedRules, endpoints, countries, platforms, asn, deviceType, requestPath, minRulesFired, population |
GET /protect/verdicts/search | searchProtectVerdicts | ip, jti, asn, siteKey, limit |
GET /protect/risk-history | getProtectRiskHistory | jti (required), siteKey |
GET /protect/session-telemetry | getProtectSessionTelemetry | jti (required), siteKey |
GET /protect/traffic-summary | getProtectTrafficSummary | siteKey, since, bucket, source |
GET /protect/traffic-by-dimension | getProtectTrafficByDimension | groupBy, siteKey, since, until, bucket, topN, and the same filters as /protect/verdicts |
GET /protect/traffic-report | getProtectTrafficReport | siteKey, since, until, bucket, endpoints |
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 useZ. - A list parameter (
sources,firedRules,endpoints,countries,platforms) takes comma-separated values, or the same parameter repeated:countries=GB&countries=FR. bucketisminute,5_minute,15_minute,hourorday. A request that needs more than 2,016 buckets (a week of 5-minute buckets) is refused with400: 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
GETorPOST) 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 is429with aRetry-Afterheader 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.
Client events
Section titled Client eventsReport 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.
| Endpoint | Permission | Body | Returns |
|---|---|---|---|
POST /protect/client-events | ingestClientEvents | { protectInstanceId, entries } (1–1000 entries) | { received, inserted, duplicates, outOfWindow } |
POST /protect/client-events/logs?token=…&instanceId=…&format=… | ingestClientEventLogs | Your logging system’s webhook payload, unchanged | { received, parsed, skipped, inserted, duplicates, outOfWindow, truncated } |
/protect/client-events/logstakes the API key in thetokenquery parameter, for webhooks that cannot set headers. Query strings end up in request logs, so give that keyingestClientEventLogsand nothing else.formatnames 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
duplicatesrather than inserted twice.