# OffenderSearch API documentation

> One REST API over 58 sex-offender registries — every US state, DC and the territories. One normalized record schema, per-source status on every response, labelled match strength, and a continuously-updated corpus with optional live re-verification per request.

- **Base URL (live):** https://api.offendersearch.app — live keys (`os_live_…`)
- **Base URL (sandbox):** https://sandbox.offendersearch.app — test keys (`os_test_…`), never billed; see https://offendersearch.app/docs/sandbox.md
- **API version:** 1.0.0
- **Authentication:** `X-API-Key` request header (`GET /v1/sources` needs none)
- **OpenAPI:** https://offendersearch.app/openapi.json · https://offendersearch.app/openapi.yaml
- **API catalog (RFC 9727):** https://offendersearch.app/.well-known/api-catalog
- **HTML documentation:** https://offendersearch.app/docs
- **Per-section markdown:** https://offendersearch.app/docs/{section}.md

The standard endpoints are not a consumer report: do not use their results for FCRA-covered decisions. FCRA-regulated use is available only through FCRA Partner Access — for approved consumer reporting agencies and screening platforms under a written FCRA agreement — on the FCRA API, where one order covers a sex offender search, a criminal search or both. See https://offendersearch.app/docs/fcra.md.

## What the API guarantees

- **One call, every US registry.** Omit `jurisdictions` to search the full dataset, or name a subset.
- **One normalized schema across 58 jurisdictions.** Every match is the same 37-key record — a superset of the legacy record shape — with a 36-field extensive `stateData` block on every record (`exclude: ["stateData"]` for a lighter payload).
- **Per-source status on every response.** `sourceStatus[]` reports every jurisdiction the request touched, individually, so an incomplete search is always labelled as one and never returned as a silently short list.
- **Labelled match strength.** On a date-of-birth or age search, `matchState` labels every record `dob_match`, `year_match`, `age_match` or `no_dob_age_year` (and `age_mismatch` when you ask to see contradictions), so you set your own confidence threshold rather than inherit one.
- **Provenance built in.** Every record carries `sources[]` with a `lastCheckedAt`, and any search can be re-verified live per request.
- **Additive contract.** New data lands as a new `recordType`; the response shape does not break.

## Endpoints

| Method | Path | What it does | Documented in |
| --- | --- | --- | --- |
| POST | `/v1/search` | Synchronous search across every jurisdiction, scored and de-duplicated. | [search](https://offendersearch.app/docs/search.md) |
| POST | `/v1/searches` | Asynchronous search — submit now, collect by polling or webhook. | [async-and-webhooks](https://offendersearch.app/docs/async-and-webhooks.md) |
| GET | `/v1/searches/{searchId}` | Status and results of an asynchronous search. | [async-and-webhooks](https://offendersearch.app/docs/async-and-webhooks.md) |
| POST | `/v1/batch` | Up to 1000 queries in one call, JSON or CSV, results in input order. | [batch](https://offendersearch.app/docs/batch.md) |
| POST | `/v1/report` | A consolidated, timestamped PDF rendered from a search you already ran (re-read at render time). | [reports](https://offendersearch.app/docs/reports.md) |
| GET | `/v1/records/{recordId}` | Fetch a single normalized record by id. | [record-object](https://offendersearch.app/docs/record-object.md) |
| GET | `/v1/sources` | The live coverage catalog with per-jurisdiction health. | [regular-and-live](https://offendersearch.app/docs/freshness.md) |
| POST | `/v1/clearances` | Record that a returned person is, or is not, the subject you are screening. | [clearances](https://offendersearch.app/docs/clearances.md) |
| GET | `/v1/clearances` | List a subject’s clearances; `GET` and `DELETE /v1/clearances/{clearanceId}` retrieve and revoke one. | [clearances](https://offendersearch.app/docs/clearances.md) |
| POST | `/v1/fcra/orders` | FCRA-regulated orders, for approved partners under FCRA Partner Access. | [fcra](https://offendersearch.app/docs/fcra.md) |
| GET | `/v1/map/viewport` | What to draw for one map view: clusters, pins or named pins. | [map/viewport](https://offendersearch.app/docs/map/viewport.md) |
| POST | `/v1/map/area` | The same answer for a drawn polygon, or a route with a buffer. | [map/drawn-areas](https://offendersearch.app/docs/map/drawn-areas.md) |
| GET | `/v1/map/groups/{groupId}` | The people behind a many-people pin or an approximate-area pin. | [map/clusters-and-markers](https://offendersearch.app/docs/map/clusters-and-markers.md) |
| GET | `/v1/map/records/{markerId}` | The complete record behind a map marker or a saved reference. | [map/open-a-record](https://offendersearch.app/docs/map/open-a-record.md) |
| GET | `/v1/map/status` | The Map API plan, rates, limits and usage for the month. | [map/billing](https://offendersearch.app/docs/map/billing.md) |
| POST | `/v1/map/enable` | Turn the Map API on. `POST /v1/map/disable` turns it off. | [map/turn-it-on](https://offendersearch.app/docs/map/turn-it-on.md) |

## Contents

- [Quickstart](https://offendersearch.app/docs/quickstart.md) — Your first authenticated search in three languages, and the four fields to read off every response.
- [Authentication, keys & security](https://offendersearch.app/docs/authentication.md) — The X-API-Key header, key lifecycle and rotation, and the security posture behind the API.
- [Sex Offender API sandbox & test keys](https://offendersearch.app/docs/sandbox.md) — A test key, the sandbox base URL, rate limits, and fixed test names for search, batch, compat, records, reports and clearances. Never billed.
- [Errors, status codes & rate limits](https://offendersearch.app/docs/errors.md) — Every status code, the error body, the Retry-After header, and how to back off.
- [Search — POST /v1/search](https://offendersearch.app/docs/search.md) — The primary endpoint. Every parameter, the four stages of a search, and nine worked query shapes.
- [Matching, confidence & partial names](https://offendersearch.app/docs/matching.md) — Match modes, the closed strategy vocabulary, confidence ceilings, and partial-name search.
- [Searching by date of birth](https://offendersearch.app/docs/date-of-birth.md) — Labelled match strength on every record, and how dob, birthYear and dobPrecision fit together.
- [Result completeness & per-source status](https://offendersearch.app/docs/result-completeness.md) — An incomplete search is labelled, never silently empty. counts, sourceStatus and incompleteReason.
- [Pagination & response size](https://offendersearch.app/docs/pagination.md) — The full result set in one response, up to a 4,000-record cap — plus page, perPage and totalPages to reach every match.
- [Regular & Live modes, and source coverage](https://offendersearch.app/docs/freshness.md) — Two modes — Regular (continuously updated) and Live — per-record lastCheckedAt, and the live coverage catalog.
- [Live evidence — the registry’s page as a PDF](https://offendersearch.app/docs/live-evidence.md) — The registry’s own website, printed to one PDF per registry with a cover page, a content hash and a 30-day download link.
- [Jurisdictions & codes](https://offendersearch.app/docs/jurisdictions.md) — Every jurisdiction code, and the difference between scoping a search and filtering a result.
- [Clearances](https://offendersearch.app/docs/clearances.md) — Dismiss a false-positive match once per subject; later searches hide the person, and a changed record brings them back.
- [Async search, webhooks & idempotency](https://offendersearch.app/docs/async-and-webhooks.md) — Submit and collect without holding a connection open. Webhook delivery and safe retries.
- [Batch & CSV search](https://offendersearch.app/docs/batch.md) — Up to 1000 lookups per call, JSON or CSV, row in and row out, with per-row fault isolation.
- [Front-desk visitor screening](https://offendersearch.app/docs/front-desk-visitor-screening.md) — A registry check at visitor sign-in: what to send from the ID, the Clear, Review and Match states, the staff screen, repeat visitors and the audit trail.
- [Sex offender API reference](https://offendersearch.app/docs/api-reference.md) — Every endpoint and every object, each linked to the one place its fields are defined.
- [The Record object](https://offendersearch.app/docs/record-object.md) — One normalized 37-key record across every jurisdiction, and how to read its empty values.
- [Verification reports](https://offendersearch.app/docs/reports.md) — A timestamped PDF of a search you already ran, with a source citation on every record.

---

# Quickstart

> Make your first search of every US sex offender registry in cURL, Node or Python, and what to read on every response: status, counts and each matchState.

HTML: https://offendersearch.app/docs/quickstart · Markdown: https://offendersearch.app/docs/quickstart.md

## Authenticate

Every request carries your secret key in the `X-API-Key` header. Keys are created, rotated and revoked from the dashboard, and a key's secret is shown in full only once, at creation.

```bash
export OFFENDERSEARCH_KEY="os_live_9f2a…"
```

## Your first search

One authenticated call covers every jurisdiction. Passing `jurisdictions: null` — or omitting it — searches the full dataset, and the response is one scored, de-duplicated, source-tagged result set.

**cURL**

```bash
curl https://api.offendersearch.app/v1/search \
  -H "X-API-Key: $OFFENDERSEARCH_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "query": {
      "firstName": "John",
      "lastName": "Doe",
      "dob": "1980-04-12"
    },
    "jurisdictions": null,
    "match": "balanced"
  }'
```

**Node**

```javascript
const res = await fetch("https://api.offendersearch.app/v1/search", {
  method: "POST",
  headers: {
    "X-API-Key": process.env.OFFENDERSEARCH_KEY,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    query: { firstName: "John", lastName: "Doe", dob: "1980-04-12" },
    jurisdictions: null,     // null = search the full dataset
    match: "balanced",
  }),
});

const { records, sourceStatus, counts, status } = await res.json();
// status is "complete", or "partial" when a jurisdiction did not finish (see sourceStatus)
for (const r of records) {
  console.log(r.matchConfidence, r.name.full, r.source.jurisdiction);
}
```

**Python**

```python
import os, requests

resp = requests.post(
    "https://api.offendersearch.app/v1/search",
    headers={"X-API-Key": os.environ["OFFENDERSEARCH_KEY"]},
    json={
        "query": {"firstName": "John", "lastName": "Doe", "dob": "1980-04-12"},
        "jurisdictions": None,   # None = search the full dataset
        "match": "balanced",
    },
    timeout=130,
)
data = resp.json()
print(data["status"], data["counts"])
for r in data["records"]:
    print(r["matchConfidence"], r["name"]["full"], r["source"]["jurisdiction"])
```

## Read four things off every response

1. **`status`** — `"complete"` or `"partial"`. `"partial"` means at least one jurisdiction was not searched to the end; `sourceStatus[]` names it and says why.
2. **`counts.sourcesComplete` vs `counts.sourcesQueried`** — how much of the search finished. An equal pair is a closed answer.
3. **`counts.records`** — the total number of matches *before* any page slice, so it does not change as you page.
4. **`matchState` and `matchedName`, per record** — the labelled strength of the identity match, and whether the registered name or an alias produced the hit.

Every response also carries `sourceStatus[]`, one entry per jurisdiction the request touched, with that jurisdiction’s own status and completeness flag — so an incomplete search is always labelled as one and never returned as a silently short list.

```json
{
  "status": "complete",
  "counts": {
    "records": 3,
    "sourcesQueried": 58,
    "sourcesComplete": 58,
    "sourcesIncomplete": 0,
    "sourcesSkippedByScope": 0
  },
  "records": [
    {
      "matchState": "dob_match",
      "matchedName": { "value": "John A. Doe", "type": "legal" },
      "matchConfidence": 1.0
    }
  ]
}
```

## Where to go next

- [POST /v1/search](https://offendersearch.app/docs/search.md) — every parameter, and nine worked query shapes.
- [The Record object](https://offendersearch.app/docs/record-object.md) — one normalized schema across all 58 jurisdictions.
- [Result completeness](https://offendersearch.app/docs/result-completeness.md) — how counts, sourceStatus and incompleteReason fit together.
- [Async & webhooks](https://offendersearch.app/docs/async-and-webhooks.md) and [Batch & CSV](https://offendersearch.app/docs/batch.md) — for volume work.
- [OpenAPI JSON](https://offendersearch.app/openapi.json) / [YAML](https://offendersearch.app/openapi.yaml) — generate a typed client rather than hand-writing one.

---

# Authentication, keys & security

> Authenticate with an X-API-Key header: key creation, rotation and revocation, what a key controls, tenant isolation, encryption, search history and the BAA.

HTML: https://offendersearch.app/docs/authentication · Markdown: https://offendersearch.app/docs/authentication.md

## The X-API-Key header

Authenticate every request with your secret key in the `X-API-Key` header. Keys are created, named, rotated, and revoked from the API keys page. A key's secret is shown in full only once, at creation, and is stored only as a one-way hash — keep it in a secret manager, and never in client-side code.

```bash
curl https://api.offendersearch.app/v1/records/rec_4b1e \
  -H "X-API-Key: os_live_9f2a…"
```

A missing or unrecognised key returns `401` (some endpoints word the sentence slightly differently). An account with no active subscription and no free-trial searches left returns `402`. Both bodies carry a `detail` sentence that says which. `GET /v1/sources` is the one endpoint that needs no key.

```json
{
  "detail": "Missing or invalid API key. Send it in the X-API-Key header."
}
```

## What a key controls

A key is a pure authentication credential — nothing billable is provisioned on it. Every key can run both search modes: the default **Regular** search and, by sending a `live` block, a **Live** re-verification (billed per live source). Verification reports are a **separate endpoint** (`POST /v1/report`) that any valid key can call, billed per document. There are no per-key feature scopes to configure, so a key created today can call every endpoint documented here.

**Rotation.** Issue a second key, deploy it, then revoke the first — both are valid at once, so rotation needs no downtime window. You can also rotate a key in place from the API keys page: it issues a new secret, shown once, and the old secret stops working immediately. Each key records when it was last used, which is the practical reason to issue one key per environment or per service rather than sharing a single credential across a fleet.

## Security

- **Encryption.** TLS in transit, AES-256 at rest for stored searches and their results.
- **Per-key hashing.** Secrets are hashed at rest — a database read never exposes a usable key.
- **Access controls & tenant isolation.** Data is scoped per account; one customer can never read another’s keys, usage, or reports.
- **Search history.** Every billable search is recorded with its account, time and query, and shows in the dashboard’s usage and search history for the 14 days results are kept.
- **Attestations.** Any account can execute a Business Associate Agreement (BAA) from the dashboard. It is a click-through agreement executed by a signed-in person, never by an API key; the executed copy is available as a PDF.

Results from the standard endpoints are public-record data and are not a consumer report; do not use them for FCRA-covered decisions. FCRA-regulated use is available only through FCRA Partner Access, on the FCRA API — see [FCRA API](https://offendersearch.app/docs/fcra.md).

---

# Sex Offender API sandbox & test keys

> Test the Sex Offender API in the sandbox with an os_test_ key: fixed test names for search, batch, compat, records, reports and clearances. Never billed.

HTML: https://offendersearch.app/docs/sandbox · Markdown: https://offendersearch.app/docs/sandbox.md

## API sandbox test keys: create one in the dashboard

The sandbox is a separate server with the same endpoints as the live API. This page covers the Sex Offender API: search, batch, stored searches, the offenders.io-compatible endpoint, records, reports and clearances. It answers from a fixed set of made-up people, so every request returns the same result every time, and nothing you send is billed. Build and test your whole integration against it, then switch two settings to go live.

1. In the dashboard, open [Developers → API keys](https://offendersearch.app/dashboard/keys).
2. Choose **Create test key**. Test keys are for business accounts and need no subscription.
3. Copy the key. Test keys begin `os_test_`. Like a live key, the full secret is shown once, so put it in your secrets store straight away.

One test key works on every API’s sandbox. Each key in the list is labelled **Test · Sandbox** or **Live**, with the base URL it works on. Send it in the same `X-API-Key` header the live API uses. An account holds up to 3 active test keys and can create 10 a day. A revoked test key stops working on the sandbox within a few minutes.

## Sandbox base URL and test keys vs live keys

|  | Sandbox | Production |
| --- | --- | --- |
| Base URL | `https://sandbox.offendersearch.app` | `https://api.offendersearch.app` |
| Key prefix | `os_test_` | `os_live_` |
| Data | The fixed test people listed below | 58 sex offender registries |
| Billing | Never billed, never recorded to usage | Your plan’s prices |
| `sandbox` field | `true` on every response | Absent |
| `X-Offendersearch-Environment` | `sandbox` on every response | Absent |

Each key works on its own server only, so a mixed-up configuration is caught on the first request rather than after a release. A test key sent to the live API, or a live key sent to the sandbox, is refused with `401` and a `detail` message that says so:

401 — a test key sent to the live API

```json
{
  "detail": "This is a test key (os_test_…). Test keys work only on the sandbox at https://sandbox.offendersearch.app, which answers with sample data. To search real records, send a live key (os_live_…) to https://api.offendersearch.app."
}
```

401 — a live key sent to the sandbox

```json
{
  "detail": "This is a live key. The sandbox at https://sandbox.offendersearch.app accepts test keys (os_test_…) only — create one in the dashboard under Developers → API keys. Send live keys to https://api.offendersearch.app."
}
```

A revoked test key gets `401` with: “This test key has been revoked. Create a new test key in the dashboard under Developers → API keys.”

## Sandbox response format: identical to live, never billed

Every sandbox endpoint takes the same request body and returns the same response shape as its live counterpart, produced by the same serializers: the same envelope, the same [Record object](https://offendersearch.app/docs/record-object.md), the same `matchState`, `matchConfidence`, `matchBasis` and `matchDetail`. Code that parses a sandbox response parses a live one. Two things are added so a sandbox answer is never mistaken for a real screening: `"sandbox": true` in the body and the `X-Offendersearch-Environment: sandbox` header.

POST /v1/search — sandbox (abridged)

```json
HTTP/1.1 200 OK
X-Offendersearch-Environment: sandbox

{
  "sandbox": true,
  "searchId": "srch_…",
  "status": "complete",
  "counts": { "records": 1, … },
  "records": [
    { "recordId": "rec_…",
      "personRef": "prs_…",
      "name": { "first": "Exact", "middle": "Sample", "last": "Match", … },
      "dob": "1980-01-01",
      "matchState": "dob_match",
      "matchConfidence": 0.9,
      "registrationState": "OH",
      "images": [ { "url": "https://…" } ],
      … }
  ]
}
```

- **Never billed.** Nothing on the sandbox is billed or recorded to your usage.
- **Names match as a pair.** `firstName` and `lastName` are matched together, ignoring case. Any other name returns a complete answer with zero records.
- **Dates of birth behave as in production.** Send a test person’s `dob` exactly as listed; a different `dob` contradicts the record and returns no match, and omitting it returns the person at name-only confidence.
- **Filters behave as in production.** A `state`, `city` or `zipcode` returns a test person only when it matches their registry state or one of their addresses, and a malformed request gets the same `422` it would in production.
- **Test data is temporary.** Searches, stored results, clearances, monitors and FCRA orders you create in the sandbox are kept for testing and may be reset.

The test people are invented, with sample addresses and placeholder photos marked SAMPLE. They are not real registrants, and their records must never be shown to anyone as real.

## Sandbox rate limits

Rate limits keep the sandbox fast for everyone. They apply only to the sandbox, and to every API on it together.

| Limit | Value |
| --- | --- |
| Requests per test key, per minute | 60 |
| Requests per test key, per day | 2,000 |
| Requests per IP address, per minute | 120 |
| Active test keys per account | 3 |
| Test keys created per account, per day | 10 |

Past a request limit the sandbox answers `429` with a `Retry-After` header giving the seconds until the window resets. Wait that long and send the request again.

429 — sandbox

```json
HTTP/1.1 429 Too Many Requests
Retry-After: 23
X-Offendersearch-Environment: sandbox

{
  "detail": "Sandbox rate limit reached: 60 requests a minute for this test key. Retry after 23s. The sandbox allows 60 requests a minute and 2000 a day per test key, and 120 a minute per IP address.",
  "sandbox": true
}
```

## Sex offender search test names

Send these to `POST /v1/search` on the sandbox. Each one returns the same answer every time. The **Desk state** column is what the mapping in the [front-desk visitor screening guide](https://offendersearch.app/docs/front-desk-visitor-screening.md) produces for that answer. The same names work on `POST /v1/batch`, `POST /v1/searches` and the offenders.io-compatible endpoint, and a returned `recordId` opens with `GET /v1/records/{recordId}`.

| Send | What comes back | Desk state |
| --- | --- | --- |
| `firstName: Clear`, `lastName: Visitor` | **Clear visitor.** No match: a complete answer with zero records. | Clear |
| `firstName: Exact`, `lastName: Match`, `dob: 1980-01-01` | **Exact match, date of birth verified.** One strong match: DOB-verified (matchState dob_match), high confidence, photo, offense, registry state and two addresses. | Match |
| `firstName: Exact`, `lastName: Match` | **Exact match, no date of birth sent.** The same person, matched on name alone: matchState is null because no date of birth was sent to verify. | Review |
| `firstName: Exact`, `lastName: Match`, `dob: 1990-05-05` | **Exact match name, different date of birth.** No match: the registry's date of birth contradicts the one sent. | Clear |
| `firstName: Name`, `lastName: Only` | **Name only — possible matches.** Three possible matches in three states. None of the registries publishes a date of birth, so the name is the only evidence (medium confidence). Sending a dob returns the same three with matchState no_dob_age_year and unverified true. | Review |
| `firstName: Alias`, `lastName: Match` | **Matched through an alias.** One match whose legal name is different (Jordan Sample Placeholder): matchedName.type is alias, matchBasis carries alias:exact. | Review |
| `firstName: Out`, `lastName: State`, `state: TX` | **Registered in another state.** One match living in Texas but registered by Oklahoma's registry: registrationState OK, addressStates [TX]. | Review |
| `firstName: Multi`, `lastName: State` | **One person on two registries.** One record merged from two registries (Florida and Georgia): sources[] lists both. | Review |
| `firstName: Homeless`, `lastName: Registrant` | **Homeless registrant.** One match with housingStatus homeless. | Review |

POST /v1/search — sandbox

```bash
curl -X POST "https://sandbox.offendersearch.app/v1/search" \
  -H "X-API-Key: $OFFENDERSEARCH_TEST_KEY" \
  -H "Content-Type: application/json" \
  -d '{
      "query": {
        "firstName": "Exact",
        "lastName": "Match",
        "dob": "1980-01-01"
      }
    }'
```

In a batch, each row gets the same answer it gets from `POST /v1/search`, in input order.

POST /v1/batch — sandbox

```bash
curl -X POST "https://sandbox.offendersearch.app/v1/batch" \
  -H "X-API-Key: $OFFENDERSEARCH_TEST_KEY" \
  -H "Content-Type: application/json" \
  -d '[
      {
        "firstName": "Clear",
        "lastName": "Visitor"
      },
      {
        "firstName": "Exact",
        "lastName": "Match",
        "dob": "1980-01-01"
      },
      {
        "firstName": "Exact",
        "lastName": "Match"
      }
    ]'
```

## Clearances in the API sandbox

All four [clearance](https://offendersearch.app/docs/clearances.md) endpoints run on the sandbox against your sandbox searches. Search a test name with a `subjectId`, take the `searchId` and a returned `personRef`, and `POST /v1/clearances` with `verdict: "not_this_person"`. The next sandbox search with the same `subjectId` and `clientId` lists that person in `cleared[]` instead of `records[]`, exactly as live. `Name Only` is a good subject: it returns three people, so you can clear one and keep two.

POST /v1/search with a subjectId — sandbox

```bash
curl -X POST "https://sandbox.offendersearch.app/v1/search" \
  -H "X-API-Key: $OFFENDERSEARCH_TEST_KEY" \
  -H "Content-Type: application/json" \
  -d '{
      "query": {
        "firstName": "Name",
        "lastName": "Only"
      },
      "subjectId": "visitor-1042",
      "clientId": "school-3"
    }'
```

## Other sandbox endpoints: reports, live evidence and catalogues

The rest of the Sex Offender API runs on the sandbox too, with the same paths and shapes as live. The test names above apply wherever a name is searched.

| Send | What comes back |
| --- | --- |
| `POST /v1/report {"searchId": "<a sandbox search id>"} (or an inline query)` | **Verification report.** The production verification PDF (application/pdf, X-Report-Id header) for the sample people that search returned, without photographs. Never billed. |
| `POST /v1/search with "proof": {"registries": ["OH"]}, or POST /v1/searches/{id}/proof` | **Proof documents.** A ProofBundle: status ready, one document per registry at /v1/proof-docs/{token}, rendered by the production renderer. billedDocuments is 0: the sandbox bills nothing. |
| `POST /v1/search with "live": {"jurisdictions": ["OH"], "evidence": "pdf"}` | **Live evidence documents.** 202 {searchId: evs_…, status: pending, mode: async, registries, pollUrl}. The first poll of GET /v1/searches/{evs_…} is complete: the search plus evidence[] with one complete SAMPLE PDF per registry (inline pdfBase64 and a downloadUrl). Nothing billed: billed false, chargeUsd 0. |
| `GET /v1/sources (no key)` | **Registry catalogue.** The production catalogue of 58 registries. health is null: the sandbox has no ingest. |
| `GET /v1/status, GET /v1/sandbox/fixtures (no key)` | **Sandbox status.** Environment, base URLs, key prefix, rate limits; and this file's scenarios. |

## Sandbox API examples in cURL, Node and Python

The date-of-birth-verified test person, called three ways. Export your test key as `OFFENDERSEARCH_TEST_KEY` first.

POST /v1/search — sandbox — cURL

```bash
curl -X POST "https://sandbox.offendersearch.app/v1/search" \
  -H "X-API-Key: $OFFENDERSEARCH_TEST_KEY" \
  -H "Content-Type: application/json" \
  -d '{
      "query": {
        "firstName": "Exact",
        "lastName": "Match",
        "dob": "1980-01-01"
      }
    }'
```

POST /v1/search — sandbox — Node

```javascript
// Node 18+ — fetch is built in.
const BASE = process.env.OFFENDERSEARCH_BASE ?? 'https://sandbox.offendersearch.app';

const res = await fetch(`${BASE}/v1/search`, {
  method: 'POST',
  headers: {
    'X-API-Key': process.env.OFFENDERSEARCH_TEST_KEY,
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({ query: { firstName: 'Exact', lastName: 'Match', dob: '1980-01-01' } }),
});
const body = await res.json();

console.log(res.headers.get('X-Offendersearch-Environment')); // "sandbox"
console.log(body.sandbox);                // true
console.log(body.records[0].matchState);  // "dob_match"
```

POST /v1/search — sandbox — Python

```python
import os
import requests

BASE = os.environ.get("OFFENDERSEARCH_BASE", "https://sandbox.offendersearch.app")

r = requests.post(
    f"{BASE}/v1/search",
    headers={"X-API-Key": os.environ["OFFENDERSEARCH_TEST_KEY"]},
    json={"query": {"firstName": "Exact", "lastName": "Match", "dob": "1980-01-01"}},
    timeout=30,
)
body = r.json()

print(r.headers["X-Offendersearch-Environment"])  # sandbox
print(body["sandbox"])                     # True
print(body["records"][0]["matchState"])    # dob_match
```

## Postman collection for the OffenderSearch sandbox

One collection covers every API’s sandbox, with a folder per API, ready to import into Postman or Insomnia: https://offendersearch.app/downloads/offendersearch-sandbox.postman_collection.json. The **Sex Offender API** folder has one request for every scenario on this page. Set `{{apiKey}}` to your test key; `{{baseUrl}}` is preset to the sandbox. Ids from earlier responses go in `{{searchId}}`.

## Sandbox test keys for the criminal, monitoring, Map and FCRA APIs

Each API’s docs have their own sandbox page, with that API’s test data, calls and Postman folder. The same `os_test_` key works on all of them.

- [Criminal Search API sandbox](https://offendersearch.app/docs/criminal/sandbox.md)
- [Monitoring API sandbox](https://offendersearch.app/docs/monitoring/sandbox.md)
- [Map API sandbox server](https://offendersearch.app/docs/map/sandbox.md)
- [FCRA API sandbox](https://offendersearch.app/docs/fcra/sandbox.md)

## Move from the API sandbox to production

The sandbox and the live API differ only in the base URL and the key. Keep both in configuration, not in code, and going live is a configuration change:

.env

```bash
# Sandbox
OFFENDERSEARCH_BASE=https://sandbox.offendersearch.app
OFFENDERSEARCH_KEY=os_test_…

# Production — change these two values and nothing else
OFFENDERSEARCH_BASE=https://api.offendersearch.app
OFFENDERSEARCH_KEY=os_live_…
```

- Create a live key on the same [Developers → API keys](https://offendersearch.app/dashboard/keys) page.
- Remove any branch that reads `sandbox`. The field does not exist on live.
- Live answers are real people. Read [Matching & confidence](https://offendersearch.app/docs/matching.md) and [Date of birth](https://offendersearch.app/docs/date-of-birth.md) before you decide what your interface shows for each `matchState`.
- Live calls are billed; see [pricing](https://offendersearch.app/pricing).

---

# Errors, status codes & rate limits

> Every status code the API returns, the detail error body with its field-level shape, the 429 Retry-After header, and the backoff to implement against it.

HTML: https://offendersearch.app/docs/errors · Markdown: https://offendersearch.app/docs/errors.md

## Status codes

The API uses conventional HTTP status codes. A `200` can still carry a `partial` result: when a jurisdiction does not finish, the records from the jurisdictions that did are returned and every jurisdiction is labelled in `sourceStatus`, rather than failing the whole call. An account needs an active subscription, or free-trial searches left, for a search to run.

| Status | Meaning | When you see it |
| --- | --- | --- |
| `200` | OK | The search ran. status says whether every jurisdiction finished (complete) or at least one did not (partial). |
| `202` | Accepted | Asynchronous search accepted; poll the results URL or await the webhook. |
| `400` | Bad Request | The request cannot be acted on as sent — for example POST /v1/report with neither a searchId nor a query. |
| `401` | Unauthorized | The X-API-Key header is missing or the key is not valid (or, on endpoints that accept one, the dashboard session is not valid). |
| `402` | Payment Required | The account has no active subscription and no free-trial searches left; a free-trial search names no one (a trial search needs a first or last name); a batch has more rows than the trial searches left; or a request sent proof without billing on the account. The detail says which. |
| `403` | Forbidden | Location-only searches (a radius, city, county, ZIP or state with no name) are paused for this account for the rest of the month: detail.code is "location_quota_paused". Searches that include a name are not affected. |
| `404` | Not Found | The search id or record id does not exist, or a report was requested for a searchId this account did not run. |
| `409` | Conflict | GET /v1/records/{recordId} was given a registry uuid that matches records in more than one jurisdiction. The detail names them. |
| `410` | Gone | A verification report was requested for a search older than the 7-day report window, or stored results were requested for a search past the 14-day retention window. |
| `413` | Payload Too Large | A batch has more than 1000 rows. |
| `422` | Unprocessable Entity | The request was understood and DECLINED, and the body says why in a plain sentence you can show a user. Two causes. (a) THE QUERY CANNOT BE ANSWERED COMPLETELY, so it is declined rather than answered with a subset that would read as the whole answer: a query carrying nothing to narrow on cannot be guaranteed to return the same full result twice. Send at least one of lastName, dob, age, city, county, zipcode, address, a lat/lng radius, or q — a firstName or a state on its own is not enough to narrow a search, so pair it with a surname or a date of birth. A name + DOB query is NEVER refused, whatever the name. (b) A parameter is malformed or unrecognised — an unknown jurisdiction code, or a filter placed at the top level of the body instead of inside query. |
| `429` | Too Many Requests | The service is at capacity and did not run the search (detail.code "overloaded"). Nothing was searched and no result is implied. Wait the Retry-After seconds and retry. |
| `504` | Deadline Exceeded | The deadline was hit and the request sent onDeadline = "error"; or the search found no records while at least one registry did not finish (detail.code "incomplete_no_results"), so the empty result is not an answer. |

## The error envelope

Every non-2xx response is JSON, and on this API almost always one key, `detail` (two exceptions: the consumer-account `403` body is `{"error","message","path"}`, and the live-evidence `503` is `{"error":{"code","message"}}`; the Criminal Records API uses that `error` object for every refusal). For most errors `detail` is a sentence you can log or show a user. When a request fails field validation it is a list, one entry per field, each with `loc` (the path to the field), `msg` and `type`. On a `429` it is an object with a `code` and `retryAfterSeconds`; on a `403` and on the `504` whose code is `incomplete_no_results` it is also an object with a `code` and a `message`. Branch on the HTTP status; read `detail` for the reason.

```json
{
  "detail": "Unknown match 'strick'. Allowed: balanced, broad, strict."
}
```

`422` is a deliberate contract, not a failure. A query with nothing to narrow on cannot be guaranteed to return the same full result twice, so it is declined with a sentence you can show a user rather than answered with a subset that would read as the whole answer. A name + date-of-birth query is never declined, whatever the name.

```javascript
const res = await fetch(url, { method: "POST", headers, body });

if (!res.ok) {
  const { detail } = await res.json();
  const reason = typeof detail === "string" ? detail : JSON.stringify(detail);
  switch (res.status) {
    case 401: throw new Error("Check X-API-Key: " + reason);
    case 402: throw new Error("Subscription or billing needed: " + reason);
    case 422: return { declined: reason };                 // show the user
    case 429: return retryAfter(res.headers.get("Retry-After"));
    default:  throw new Error(res.status + ": " + reason);
  }
}

const body = await res.json();
// A 200 can still be partial - read status and counts, never records alone.
if (body.status === "partial") {
  // counts.sourcesComplete of counts.sourcesQueried finished
}
```

## The Error object — sex offender API error response fields

The error body. `detail` is a sentence you can log or show; the HTTP status is the value to branch on.

| Field | Type | Default | Description |
| --- | --- | --- | --- |
| `detail` | `string, array or object` |  | What went wrong. A sentence on most errors. A list when the request fails field validation: one entry per field, with `loc` (the path to the field), `msg` and `type`. An object with `code`, `message`, `unfinishedSources` and `sourcesQueried` on the `504` whose `code` is `incomplete_no_results`: the search found no records and at least one registry did not finish, so the empty result is not an answer. An object with `code: "location_quota_paused"`, `message`, `locationRecordsUsed` and `locationRecordsLimit` on the `403` that pauses location-only searches for the month. Example `"Missing or invalid API key. Send it in the X-API-Key header."`. |

## The RateLimitError object — 429 rate limit response fields

The `429 Too Many Requests` body. The `Retry-After` header carries the same wait as `detail.retryAfterSeconds`.

| Field | Type | Default | Description |
| --- | --- | --- | --- |
| `detail` | `object` |  | Why the request was refused and how long to wait. |
| `detail.code` | `string` — one of `"rate_limited"`, `"overloaded"` |  | `overloaded`: the service is at capacity; no result is implied about the person. `rate_limited`: a per-caller limit on the contact form and the consumer endpoints, never on search. |
| `detail.message` | `string` |  | A sentence describing the refusal. |
| `detail.retryAfterSeconds` | `integer` |  | Seconds to wait before retrying; equals the `Retry-After` header. |
| `detail.queueDepth` | `integer` or null |  | Searches queued ahead of this one when it was refused. Present when the search was refused before it ran, and when it ran, found no records and could not finish; absent on the refusal that answers `onDeadline: "error"`. |
| `detail.predictedWaitSeconds` | `number` or null |  | The predicted wait behind that queue, in seconds. Present when the search was refused before it ran; absent on a deadline refusal. |
| `detail.unfinishedSources` | `array of string` |  | Registries that did not finish, when the search ran, found no records and could not complete because the service was at capacity. |
| `detail.sourcesQueried` | `integer` |  | Registries the search queried; sent with `unfinishedSources`. |

## Rate limits & quotas

The search endpoints answer `429 Too Many Requests` when the service is at capacity for a request. The search did not run: nothing was searched and the response says nothing about the person. The `Retry-After` header carries the seconds to wait (1 to 120), and the body repeats it as `detail.retryAfterSeconds` with `detail.code: "overloaded"`. A search that reaches its `deadlineMs` with `onDeadline: "error"` is answered the same way when the service is under load, and with `504` and `detail: "Deadline hit and onDeadline=error"` otherwise; a search that found nothing before some registries finished answers `504` with `detail.code: "incomplete_no_results"` (both skipped when you explicitly sent `onDeadline: "partial"`).

| Header | Meaning |
| --- | --- |
| `Retry-After` | On a 429, seconds to wait before retrying. |

For large jobs, prefer the asynchronous endpoint or batch and spread submissions, rather than issuing thousands of synchronous calls at once. Handle `429` with exponential backoff that respects `Retry-After`.

```python
import time, requests

def search(payload, key, attempts=5):
    for attempt in range(attempts):
        r = requests.post(
            "https://api.offendersearch.app/v1/search",
            headers={"X-API-Key": key},
            json=payload,
            timeout=130,
        )
        if r.status_code != 429:
            r.raise_for_status()
            return r.json()
        wait = int(r.headers.get("Retry-After", 2 ** attempt))
        time.sleep(wait)
    raise RuntimeError("rate limited after %d attempts" % attempts)
```

## Retrying safely

A retry should never start — or bill — a second search. On `POST /v1/searches` every accepted request is a new job, so store the `searchId` from the `202` and poll it rather than submitting again. A `429` whose body carries `detail.queueDepth` was refused before a result was produced and was not billed, so retrying it after `Retry-After` is safe.

When a response comes back `partial`, the field to read is `sourceStatus[].incompleteReason`: it is a closed enum, and each value says whether retrying the identical request will change the answer.

---

# Search — POST /v1/search

> The primary endpoint: one authenticated call searches every jurisdiction, scores and de-duplicates the matches. Full parameter reference and worked examples.

HTML: https://offendersearch.app/docs/search · Markdown: https://offendersearch.app/docs/search.md

## How a search works

Every search moves through the same four stages, so the response is predictable and the same query returns the same answer:

1. **Dispatch.** Your `query` is matched across the jurisdictions you targeted — all 58 by default, or the codes in `jurisdictions`.
2. **Match & verify.** Each jurisdiction’s rows are filtered by your `match` mode, then checked against any `dob`/`age` you supplied to confirm identity.
3. **De-duplicate & score.** The same person present in multiple jurisdictions is merged into one record whose `sources[]` lists every corroborating jurisdiction, and each record gets a `matchConfidence` and `matchBasis`.
4. **Return.** You get `records`, a per-jurisdiction `sourceStatus`, and `counts` — with `status: "complete"` or `"partial"`.

## POST /v1/search — Synchronous search

The primary endpoint. One authenticated call searches the full dataset (or the jurisdictions you name), scores and de-duplicates the matches, and returns them in a single response.

**Authentication:** `X-API-Key` header.

Send a `query` describing the person you are checking. By default the search covers the full dataset at once; you can narrow it with `jurisdictions`, tune the fuzzy-match tolerance with `match`, re-verify named jurisdictions at query time with a `live` block, request extended detail with `include`, and cap how long you are willing to wait with `deadlineMs`.

Only know part of a name? Set `prefixMatch` to `"firstName"`, `"lastName"` or `"both"` and the name you send is treated as the start of a name — `thom` returns Thomas, Thompson and Thomason — matched against aliases as well as the registered name. Minimum 3 characters. See Partial name search.

The synchronous endpoint answers in a single round trip, and every response reports its own `elapsedMs` so you can measure it against your own traffic. `deadlineMs` bounds how long the search waits for jurisdictions to answer: a jurisdiction still unanswered at that point is marked `incompleteReason: "deadline"` in `sourceStatus`, and the response comes back `status: "partial"` with the records from every jurisdiction that finished. It bounds that wait, not the response time — a jurisdiction already answering is given its own time limit to finish. If the search found no records at all and a jurisdiction did not finish, the call answers `504` (`incomplete_no_results`) instead, unless you sent `onDeadline: "partial"` explicitly.

Every record you get back carries a `matchConfidence` score, the `matchBasis` (why it matched, per field — e.g. `lastName:prefix`, `alias:prefix`), a `matchedName` saying whether the registered name or an alias matched, a `dobVerification` result, and full per-source provenance with a source citation and a `lastCheckedAt` timestamp.

### What you can do

- **Search all or some jurisdictions.** Omit jurisdictions to search every US registry, or pass codes like ["TX","NY"] to scope it.
- **Name, DOB, age, or location.** Match on any combination. Send at least one field that narrows the search — a surname, dob, age, city, county, ZIP, address, a lat/lng radius or q; a first name or a state on its own is declined with 422. A DOB or age confirms identity and lifts confidence.
- **Nickname-aware name search.** A firstName is expanded to its nicknames/variants (John ↔ Johnny ↔ Jack) for recall, and the expansion is echoed back in each record’s nicknames[].
- **Partial (prefix) name search.** Set prefixMatch to search on the start of a name — "thom" returns Thomas, Thompson and Thomason — on the first name, the last name, or both, and across aliases as well as the registered name.
- **Geographic radius.** Provide lat/lng + radiusMiles (defaults to 1, capped at 100) to find registrants near a point; each address carries its lat/lng, and each record its absconder/predator flags. Radius matching selects on address coordinates, so use a name search when you need selection that is independent of them.
- **Free-text and fuzzy street match.** Use q for a single free-text field, or address for a fuzzy street-address match.
- **Tunable fuzzy matching.** Choose strict, balanced, or broad to trade recall for precision uniformly across every jurisdiction.
- **Full record by default.** Every record carries offenses[], images[] and the 36-field stateData block (vehicles, extra photos, state-specific fields). Send exclude: ["stateData"] for a lighter payload on large result sets.
- **De-duplicated people.** The same person appearing in several sources is merged into one record with a sources[] array.
- **Deadline control.** Set deadlineMs to bound how long the search waits for jurisdictions, and onDeadline to choose a partial answer or an error when one does not finish.

### Request

**cURL**

```bash
curl https://api.offendersearch.app/v1/search \
  -H "X-API-Key: $OFFENDERSEARCH_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "query": {
      "firstName": "John",
      "lastName": "Doe",
      "dob": "1980-04-12"
    },
    "jurisdictions": null,
    "match": "balanced"
  }'
```

**Node**

```javascript
const res = await fetch("https://api.offendersearch.app/v1/search", {
  method: "POST",
  headers: {
    "X-API-Key": process.env.OFFENDERSEARCH_KEY,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    query: { firstName: "John", lastName: "Doe", dob: "1980-04-12" },
    jurisdictions: null,     // null = search the full dataset
    match: "balanced",
  }),
});

const { records, sourceStatus, counts, status } = await res.json();
// status is "complete", or "partial" when a jurisdiction did not finish (see sourceStatus)
for (const r of records) {
  console.log(r.matchConfidence, r.name.full, r.source.jurisdiction);
}
```

**Python**

```python
import os, requests

resp = requests.post(
    "https://api.offendersearch.app/v1/search",
    headers={"X-API-Key": os.environ["OFFENDERSEARCH_KEY"]},
    json={
        "query": {"firstName": "John", "lastName": "Doe", "dob": "1980-04-12"},
        "jurisdictions": None,   # None = search the full dataset
        "match": "balanced",
    },
    timeout=130,
)
data = resp.json()
print(data["status"], data["counts"])
for r in data["records"]:
    print(r["matchConfidence"], r["name"]["full"], r["source"]["jurisdiction"])
```

### Response

```json
{
  "searchId": "srch_9f2a7c",
  "status": "complete",
  "elapsedMs": 142,
  "counts": { "records": 1, "recordsReturned": 1, "sourcesQueried": 58,
              "sourcesComplete": 58, "sourcesIncomplete": 0,
              "sourcesSkippedByScope": 0 },
  "capped": false,
  "cappedReason": null,
  "cappedLimit": null,
  "cappedOmittedSources": [],
  "omittedFields": [],
  "page": 1,
  "perPage": 1,
  "totalPages": 1,
  "warnings": [],
  "proof": { "status": "none" },
  "sourceStatus": [
    { "source": "NJ", "status": "ok", "matched": 1, "fromCache": true,
      "note": null, "incomplete": false, "incompleteReason": null,
      "cappedOmitted": false },
    { "source": "PA", "status": "ok", "matched": 1, "fromCache": true,
      "note": null, "incomplete": false, "incompleteReason": null,
      "cappedOmitted": false }
    /* … one entry for each of the other jurisdictions searched … */
  ],
  "records": [
    {
      "recordId": "rec_4b1e",
      "uuid": "b1e4-…",
      "recordType": "sex_offender",
      "matchConfidence": 1.0,
      "matchBasis": ["lastName", "firstName", "dob", "lastName:exact",
                     "firstName:exact", "name_match"],
      "matchDetail": {
        "strategies": { "lastName": "exact", "firstName": "exact" },
        "fieldsPresent": ["lastName", "firstName", "dob"],
        "signals": ["matchedLegalName"],
        "matchedNameType": "legal",
        "verification": "dob_match"
      },
      "matchedName": { "value": "John A. Doe", "type": "legal" },
      "name": { "first": "John", "middle": "A", "last": "Doe", "suffix": "",
                "full": "John A. Doe" },
      "aliases": ["Johnny Doe"],
      "nicknames": ["john", "johnny", "jack"],
      "dob": "1980-04-12",
      "birthYear": 1980,
      "dobPrecision": "exact",
      "age": "46",
      "sex": "male", "race": "white", "ethnicity": "", "height": "5'10\"",
      "weight": "180", "eyeColor": "Brown", "hairColor": "Brown", "marks": "",
      "addresses": [
        { "type": "residence", "line1": "12 Main St", "city": "Trenton",
          "county": "Mercer", "state": "NJ", "zipcode": "08608",
          "lat": 40.2171, "lng": -74.7429 }
      ],
      "registrationState": "NJ",
      "addressStates": ["NJ"],
      "offense": { "tier": "II", "riskLevel": "", "statute": "2C:14-2",
                   "crime": "Sexual assault", "registrationDate": "2015-06-01" },
      "offenses": [
        { "crime": "Sexual assault", "statute": "2C:14-2", "tier": "II",
          "convictionDate": "2014-11-03", "registrationDate": "2015-06-01" }
      ],
      "stateData": {
        "stateOffenderId": "NJ-00123", "status": "active", "designation": "Tier II",
        "registrationEnds": "2035-06-01", "lawAgency": "Example County"
      },
      "flags": { "absconder": false, "predator": false },
      "images": [{ "url": "https://sor.example-state.gov/offender/NJ-00123/image" }],
      "housingStatus": "housed",
      "matchState": "dob_match",
      "dobVerification": "dob_match",
      "unverified": false,
      "source": {
        "jurisdiction": "NJ",
        "registryName": "State Sex Offender Registry",
        "recordUrl": "https://sor.example-state.gov/offender/NJ-00123",
        "recordedAt": "2026-07-25T09:14:00Z",
        "lastCheckedAt": "2026-07-25T09:14:00Z",
        "sourceUpdatedAt": "2026-07-20T00:00:00Z"
      },
      "sources": [
        { "jurisdiction": "NJ", "registryName": "State Sex Offender Registry",
          "recordUrl": "https://sor.example-state.gov/offender/NJ-00123",
          "recordedAt": "2026-07-25T09:14:00Z",
          "lastCheckedAt": "2026-07-25T09:14:00Z",
          "sourceUpdatedAt": "2026-07-20T00:00:00Z" },
        { "jurisdiction": "PA", "registryName": "State Sex Offender Registry",
          "recordUrl": "https://sor.example-state.gov/offender/PA-00456",
          "recordedAt": "2026-07-25T09:14:00Z",
          "lastCheckedAt": "2026-07-25T09:14:00Z",
          "sourceUpdatedAt": null }
      ]
    }
  ]
}
```

counts summarizes the search; sourceStatus reports every jurisdiction touched (ok / error / restricted / no_coverage) with its own incomplete flag; records holds the scored, de-duplicated matches.

### Worked examples

**Search on a partial name (prefixMatch)** — Only know part of a name? Set prefixMatch and the name you send is treated as the START of a name — "thom" returns Thomas, Thompson and Thomason. Use "firstName", "lastName", or "both". Minimum 3 characters (shorter returns 422). Prefixes are matched against every recorded alias as well as the registered name, and each record’s matchedName tells you which one matched. An exact match always ranks above a prefix match.

```json
{
  "query": {
    "lastName": "thom",
    "prefixMatch": "lastName",
    "state": "TX"
  }
}

// Returns Thomas, Thompson, Thomason, Thom, Hamilton-Thompson ...
// but NOT Bothomley - we anchor at the start of a name, never mid-word.
//
// Each record reports how it matched:
//   "matchBasis":  ["lastName:prefix", "name_match"]
//   "matchedName": { "value": "Ana Thompson", "type": "legal" }
//   "matchConfidence": 0.60      <- capped: a prefix hit is a CANDIDATE
```

**Partial first AND last name at once** — prefixMatch: "both" prefix-matches the first and last name together; a record must satisfy both. Add a dob or age to keep precision while widening recall — a confirmed DOB lifts the confidence cap that a partial-name match otherwise carries.

```json
{
  "query": {
    "firstName": "thom",
    "lastName": "and",
    "prefixMatch": "both",
    "dob": "1980-04-12"
  }
}

// -> Thomas Anderson, Thompson Andrews, ...
```

**Control matching per field (nameMatch)** — prefixMatch is the shorthand. Send nameMatch when you want to drive matching yourself: list exactly the strategies you want per field. Anything you leave out is OFF for that field; exact matching is always on and cannot be disabled. nameMatch overrides both prefixMatch and match. firstName accepts prefix, nickname, fuzzy and middle; lastName accepts prefix and fuzzy; aliases toggles alias matching (default true).

```json
{
  "query": {
    "firstName": "Robert",
    "lastName": "thom",
    "nameMatch": {
      "firstName": [],
      "lastName": ["prefix"],
      "aliases": true
    }
  }
}

// firstName: []          exact only - no nickname widening, so no "Bob"
// lastName:  ["prefix"]  Thompson, Thomas, Thomason ...
// aliases:   true        also match aliases (the default)
//
// -> Robert Thompson     (not Bob Thompson)
```

**Search a single state** — Pass jurisdiction codes in jurisdictions to limit the search. Naming ["TX"] searches the Texas registry, plus the tribal registries that cover Texas.

```json
{
  "query": { "firstName": "Maria", "lastName": "Lopez" },
  "jurisdictions": ["TX"]
}
```

**Find registrants near a location** — Combine lat/lng with radiusMiles for a geographic search — useful for “who lives near this school / address”. A search that names no one is always paginated; see Pagination.

```json
{
  "query": {
    "lat": 40.7357,
    "lng": -74.1724,
    "radiusMiles": 5
  }
}
```

**Free-text query** — Pass q to search across name, aliases, address, city, county, state and ZIP in a single field — the legacy-style catch-all. Every word must appear.

```json
{
  "query": { "q": "john doe newark nj" },
  "match": "broad"
}
```

**High-precision check with live re-verification** — Use match: "strict" for exact names only, a dob to exclude anyone whose published birth date contradicts it, and a live block to re-verify the matched jurisdictions at query time — a point-in-time answer you can defend. Up to two registries that support an in-request check run inline; otherwise the 200 is a job to poll.

```json
{
  "query": { "firstName": "John", "lastName": "Doe", "dob": "1980-04-12" },
  "match": "strict",
  "live": { "scope": "matched" }
}
```

**A lighter payload** — stateData (vehicles, extra photos, state-specific fields) is on every record by default. On a large result set, exclude it; the response lists it in omittedFields.

```json
{
  "query": { "firstName": "John", "lastName": "Doe" },
  "exclude": ["stateData"]
}
```

**Fast bounded response** — Lower deadlineMs and send onDeadline: "partial" to stop waiting on slow jurisdictions sooner: anything unanswered at the bound is marked deadline in sourceStatus and you get a partial answer, even an empty one, instead of a 504. A jurisdiction already answering still gets its own time limit, so this shortens the wait rather than guaranteeing a response time.

```json
{
  "query": { "lastName": "Doe" },
  "deadlineMs": 4000,
  "onDeadline": "partial"
}
```

## Sex offender search API request and response fields

`POST /v1/search` · auth: `X-API-Key`

Search every US sex offender registry in one call. Send a SearchRequest; get back one de-duplicated, scored result set with a status for every registry searched.

### Request

**Body** (application/json)

| Field | Type | Required / default | Description |
| --- | --- | --- | --- |
| `query` | [Query](https://offendersearch.app/docs/search#object-query) | required | Who or where to search for. See the Query object. |
| `jurisdictions` | `array of string` or null | optional | Registry codes to search, in any case (`["TX"]`, `["tx", "ok"]`): a two-letter state or territory code, `CNMI`, `USVI`, `TRIBAL`, or any other id `GET /v1/sources` lists. A state code also runs the tribal registries that cover that state. Omit it or send `null` to search every US registry. An unrecognised code is a `422`, never an empty result. `GET /v1/sources` lists every code. Example `["IL","IN"]`. |
| `locationScoped` | `boolean` | optional · default `false` | When `true` and `query.state` is set, search only the registries that cover that state instead of every US registry. `query.state` alone never narrows which registries are searched. When this narrows the search, `counts.sourcesSkippedByScope` reports how many registries were skipped. |
| `recordTypes` | `array of string` — one of `"sex_offender"` | optional · default `["sex_offender"]` | Record types to search. This endpoint searches sex offender registries only; criminal records are a separate product at `POST /v1/criminal/search`. Any other value is a `422`. |
| `live` | [LiveBlock](https://offendersearch.app/docs/freshness#object-liveblock) | optional | Re-check named registries at query time (Live verification). Omit for the Regular answer. With `evidence: "pdf"`, the same search also prints each named registry's own page to a PDF and always answers `202`. See the LiveBlock object. |
| `match` | `string` — one of `"strict"`, `"balanced"`, `"broad"` | optional · default `"balanced"` | How widely names match, applied the same way in every registry searched. `strict`: exact names only. `balanced`: exact surname, plus nicknames, initials, prefixes, middle names and one-letter typos on the first name. `broad`: also prefix and typo matches on the surname, and two-letter typos on the first name. `query.prefixMatch` (which runs the search at `broad`), `query.fuzzy` and `query.nameMatch` override it. An unrecognised value is a `422`. See [Matching & confidence](https://offendersearch.app/docs/matching). |
| `include` | `array of string` — one of `"stateData"`, `"raw"`, `"extensive"` | optional | Accepted for compatibility and has no effect: `stateData` is populated on every record by default. To drop it for a lighter payload send `exclude: ["stateData"]`. |
| `exclude` | `array of string` — one of `"stateData"` | optional | Record fields to leave out. The only value is `stateData` — the 36-field per-state block that is on every record by default. Send it for a lighter payload on large result sets; the response then lists it in `omittedFields`. Any other value is a `422`. Example `["stateData"]`. |
| `proof` | [ProofRequest](https://offendersearch.app/docs/reports#object-proofrequest) or null | optional | Per-registry proof documents, rendered with the search: for each matched record, a document of that registry's own listing as it stood when the search ran, one per registry, so a reviewer can see the entry itself and not only our record of it. An add-on that needs billing on the account: without an active subscription the call answers 402. Leave it unset for a normal search. This is not the verification report: `POST /v1/report` is the one consolidated PDF of a whole search, available to every key. |
| `subjectId` | `string` | optional | Your id for the person being screened — the resident, visitor, applicant or employee id from your own system, 1–128 characters. Sending it turns [clearances](https://offendersearch.app/docs/clearances) on for this search: a person a reviewer marked `not_this_person` for this subject leaves `records[]` (or is annotated — see `clearanceMode`), the response carries `cleared[]` and `counts.clearedSuppressed`, and a kept record a clearance names carries a `clearance` object. Omit it and the response is exactly what it was before clearances existed. Stored only as a per-account hash, never as the id you sent. Example `"resident-48213"`. |
| `clientId` | `string` | optional | Your id for the facility, tenant or client this subject belongs to, 1–128 characters. A platform that screens for many facilities sends it so that one facility's clearances never reach another facility's results; a direct customer omits it. Meaningful only with `subjectId`. Stored only as a per-account hash. Example `"facility-07"`. |
| `clearanceMode` | `string` — one of `"suppress"`, `"annotate"`, `"ignore"` | optional · default `"suppress"` | What a `not_this_person` clearance does to the record it names. `suppress` (the default whenever `subjectId` is sent) removes the record from `records[]` and lists it in `cleared[]`. `annotate` keeps the record and attaches its `clearance` object, for an interface that shows cleared people greyed out. `ignore` answers as if no clearances existed. A `this_person` verdict, and a cleared person who has re-surfaced (`clearance.staleReason` set), are kept and annotated in every mode. |
| `deadlineMs` | `integer` | optional · default `120000` | How long the search waits for registries to answer, in milliseconds, from 1000 to 600000. Outside that range is a `422`. A registry still unanswered at the bound is marked `incompleteReason: "deadline"`. It bounds the wait, not the response time: a registry already answering is given its own time limit to finish. |
| `onDeadline` | `string` — one of `"partial"`, `"error"` | optional · default `"partial"` | What happens at `deadlineMs`. `partial` returns what finished, with `status: "partial"` and every unfinished registry marked in `sourceStatus[]`. `error` returns `504` instead. |

### Response

**200** (application/json) — The search finished, completely or partially; `status` says which. When the request's `live` block resolves to more than two registries, or to a registry whose live check cannot run in-request, the 200 body is instead a live-job acknowledgement — `{"searchId", "status": "pending", "mode": "async", "liveSourcesRequested", "poll", "reason"}` — and you poll the `poll` path for the result (`GET /v1/searches/{searchId}`).

| Field | Type | Default | Description |
| --- | --- | --- | --- |
| `searchId` | `string` |  | This search's id. Pass it to `POST /v1/report` within 7 days for a verification report. Example `"srch_9f2c1a7b"`. |
| `status` | `string` — one of `"complete"`, `"partial"`, `"running"`, `"pending"`, `"error"` |  | `complete`: every registry searched was searched to the end. `partial`: at least one was not — read `counts.sourcesIncomplete` and `sourceStatus[]` before treating an empty `records` as an answer. `pending` and `running` appear only on an async job still in progress; `error` only on an async job that failed. |
| `elapsedMs` | `integer` |  | Server time spent finding the answer, in milliseconds. |
| `usage` | [LiveUsage](https://offendersearch.app/docs/freshness#object-liveusage) or null |  | Present only on a live result. See the LiveUsage object. Absent on a Regular answer. |
| `meterEvents` | array of [MeterEvent](https://offendersearch.app/docs/freshness#object-meterevent) or null |  | Present only on a live result: the billable units for this search. Absent on a Regular answer. |
| `counts` | `object` |  | Roll-up counts for this search. Present on every response. |
| `counts.records` | `integer` |  | Total matched records, before any page or cap. Not the length of `records`. |
| `counts.recordsReturned` | `integer` |  | Records in this response. Equal to `records` unless the response was capped or paginated. |
| `counts.sourcesQueried` | `integer` |  | Registries this search queried. All registries unless `jurisdictions` or `locationScoped: true` narrowed it. |
| `counts.sourcesSkippedByScope` | `integer` |  | Registries not queried because `locationScoped: true` narrowed the search. 0 on every default search. |
| `counts.sourcesIncomplete` | `integer` |  | Registries that were not searched to the end. Above 0, an empty result is not proof of no match; `sourceStatus[]` names them and says why. |
| `counts.sourcesComplete` | `integer` |  | Registries that were searched to the end. `status` is `complete` exactly when this equals `sourcesQueried`. |
| `counts.clearedSuppressed` | `integer` |  | Records a `not_this_person` [clearance](https://offendersearch.app/docs/clearances) removed from `records[]`. Present only when the request carried `subjectId`; `0` in `annotate` and `ignore` modes. `records` already excludes them, so `records + clearedSuppressed` is the count before clearances. Each one is listed in `cleared[]`. |
| `warnings` | `array of string` |  | One plain sentence per condition that shortened this answer, naming the registries. Always present; `[]` means nothing shortened it. An entry starting `INCOMPLETE SEARCH:` means at least one registry was not searched to the end. |
| `page` | `integer` |  | The page returned. `1` when the request did not paginate. |
| `perPage` | `integer` |  | The page size applied. When the request did not paginate, this equals the number of records returned. |
| `totalPages` | `integer` |  | Pages at this `perPage`. `1` when the request did not paginate. |
| `sourceStatus` | array of [SourceStatus](https://offendersearch.app/docs/result-completeness#object-sourcestatus) |  | One entry per registry this search touched. See the SourceStatus object. |
| `records` | array of [Record](https://offendersearch.app/docs/record-object#record-fields) |  | The matched registrants, de-duplicated across registries and ordered by match strength. The same query returns the same records in the same order. |
| `proof` | [ProofBundle](https://offendersearch.app/docs/reports#object-proofbundle) |  | The proof documents, when the request asked for them with `proof`: their status and, when rendered, the fetch tokens. `{"status": "none"}` on every search that did not ask, which is the normal case. |
| `error` | `string` or null |  | Present only when an async job failed (`status: "error"`): the reason. |
| `capped` | `boolean` |  | `true` when the match set was larger than one response carries and was cut to `cappedLimit` records. Always present. Branch on this field. When `true`, `counts.records` is still the full match count; paginate (`query.perPage`) to reach every record. |
| `cappedReason` | `string` or null — one of `"responseLimit"` |  | `responseLimit` when `capped` is `true`; `null` otherwise. |
| `cappedLimit` | `integer` or null |  | The record ceiling applied when `capped` is `true` (4000); `null` otherwise. Read it from the response rather than hard-coding it. |
| `cappedOmittedSources` | `array of string` |  | Registries whose records are entirely absent from this response because of the cap. Always present; `[]` on every uncapped search. Narrow the search or paginate to reach them. |
| `omittedFields` | `array of string` |  | Record fields this response leaves out because the request excluded them: `[]` on a default search (the full record is the default), `["stateData"]` when the request sent `exclude: ["stateData"]`. Always present. It is what tells "not requested" apart from "the registry publishes none" when `stateData` is `null`. |
| `cleared` | array of [ClearedEntry](https://offendersearch.app/docs/clearances#object-clearedentry) |  | Present only when the request carried `subjectId`. One entry per record a `not_this_person` [clearance](https://offendersearch.app/docs/clearances) removed from `records[]`, so an interface can say "2 previously cleared people hidden" and link each to its clearance. `[]` when nothing was suppressed, including every search in `annotate` or `ignore` mode. |

**202** (application/json) — Only when `live.evidence` is `"pdf"`: the live evidence search was accepted and runs asynchronously. Poll `pollUrl` — `GET /v1/searches/{searchId}` — for the records and `evidence[]`. See [Live evidence](https://offendersearch.app/docs/live-evidence).

The body is [the `EvidenceAccepted` object](https://offendersearch.app/docs/live-evidence#reference-post-v1-search-live-evidence). The 202 body of `POST /v1/search` when the request sent `live.evidence: "pdf"`: a job handle to poll.

**Errors**

| Status | Code | When |
| --- | --- | --- |
| 401 | — | The `X-API-Key` header is missing or the key is not valid, and no valid dashboard session was sent. |
| 402 | — | The account has no active subscription and no free-trial searches left, or a free-trial search names no one (a trial search needs a first or last name). `detail` says which. |
| 402 | — | The request sent `proof` and billing is not enabled on the account. |
| 422 | — | A field is malformed or unrecognised (an unknown jurisdiction code, an unknown `match` value, a filter placed outside `query`), or the query narrows on nothing (a first name or a state on its own does not narrow). `detail` says which. |
| 429 | `overloaded` | The service is at capacity. Wait `Retry-After` seconds and retry. The body is a [RateLimitError](https://offendersearch.app/docs/errors#object-ratelimiterror). |
| 504 | — | `deadlineMs` was reached and the request sent `onDeadline: "error"`. |
| 504 | `incomplete_no_results` | The search found no records and at least one registry did not finish (`deadline` or `truncated`), so the empty result is not an answer. `detail.unfinishedSources` names them. Retry, or narrow the query. Sending `onDeadline: "partial"` explicitly returns a `200` with `status: "partial"` instead. |
| 503 | `unavailable` | Only with `live.evidence: "pdf"`: live evidence is temporarily unavailable. The search was not run and nothing was billed; retry, or omit `live.evidence`. |

## The Query object — sex offender search request fields

Who or where to search for. Every field is optional; send what you know. A name, a date of birth or age, or a location narrows the search, and a query that narrows on nothing is refused with a `422` rather than answered with a partial list.

Returned or accepted by [`POST /v1/search`](https://offendersearch.app/docs/search#reference-post-v1-search), [`POST /v1/search`](https://offendersearch.app/docs/live-evidence#reference-post-v1-search-live-evidence), [`POST /v1/batch`](https://offendersearch.app/docs/batch#reference-post-v1-batch), [`POST /v1/report`](https://offendersearch.app/docs/reports#reference-post-v1-report).

| Field | Type | Required / default | Description |
| --- | --- | --- | --- |
| `firstName` | `string` | optional | Given name. Matched exactly, or more widely under the `match` mode you choose. A first name on its own does not narrow a search; pair it with a surname, a date of birth or a location. Example `"John"`. |
| `lastName` | `string` | optional | Surname, the primary match key. Example `"Smith"`. |
| `dob` | `string (date)` | optional | Date of birth, `YYYY-MM-DD`. It narrows: a record whose published birth date, birth year or age contradicts it is excluded. A record that publishes none of those still comes back on the name, labelled `matchState: "no_dob_age_year"` and `unverified: true`. Every returned record states how it was checked in `matchState`. See [Searching by date of birth](https://offendersearch.app/docs/date-of-birth). Example `"1985-06-14"`. |
| `age` | `integer` | optional | Age in years, for when you do not have a date of birth. Matched within `ageTolerance` years (default ±1) to absorb birthday drift. Example `39`. |
| `city` | `string` | optional | Residence city. A record matches when one of its addresses is in that city. Example `"Chicago"`. |
| `county` | `string` | optional | Residence county. Compared after the words County, Co, Parish and Borough are removed from both sides, so `Harris`, `Harris County` and `HARRIS CO` are the same filter. A record matches when one of its addresses is in that county; a record with no address on file does not match a county filter. Example `"Harris"`. |
| `state` | `string` | optional | Two-letter state or territory code (`FL`) or the full name (`Florida`), any case. A record matches when it has an address in that state OR that state's registry holds it — `addressStates` and `registrationState` on each record tell you which. A value that resolves to no state is a `422`. It filters the result; to narrow which registries are searched, add `locationScoped: true`. Example `"IL"`. |
| `zipcode` | `string` | optional | Residence ZIP code. The first five digits are compared. Example `"60614"`. |
| `address` | `string` | optional | Street address text. Every word must appear in one of the record's addresses. A record with no published address is not excluded by it. |
| `lat` | `number` | optional | Latitude of the centre of a radius search. Send with `lng`. Example `41.9`. |
| `lng` | `number` | optional | Longitude of the centre of a radius search. Send with `lat`. Example `-87.65`. |
| `radiusMiles` | `number` | optional | Radius around `lat`/`lng`, in miles, up to 100. Defaults to 1 mile when `lat` and `lng` are sent without it. |
| `q` | `string` | optional | Free text matched across name, aliases, address, city, state and ZIP. Every word must appear. |
| `fuzzy` | `boolean` | optional | `true` matches as `match: "balanced"`, `false` as `match: "strict"`. Overrides `match` when sent. |
| `prefixMatch` | `string or array of string` | optional | Partial-name search: treat the name you sent as the start of a name, so `thom` finds Thomas, Thompson and Thomason. `"firstName"`, `"lastName"`, `"both"`, or a list of field names. Matched against aliases as well as the registered name. The prefix must be at least 3 characters (`422` otherwise). An exact match always ranks above a prefix match. Sending it runs the rest of the name match at `match: "broad"`. |
| `nameMatch` | `object` | optional | Per-field control of name matching, the fine-grained form of `match` and `prefixMatch` (and it overrides both). A strategy you leave out of a field's list is off for that field; exact matching is always on. |
| `nameMatch.firstName` | `array of string` — one of `"exact"`, `"prefix"`, `"nickname"`, `"fuzzy"`, `"middle"` | optional | Strategies for the first name. `prefix` needs at least 3 characters; `middle` (your given name is the person's middle name) needs at least 2. |
| `nameMatch.lastName` | `array of string` — one of `"exact"`, `"prefix"`, `"fuzzy"` | optional | Strategies for the surname. `prefix` needs at least 3 characters. |
| `nameMatch.aliases` | `boolean` | optional · default `true` | Also match against every alias the registry publishes. |
| `faceId` | `string` | optional | Not supported on this endpoint. Sending it is a `422`. |
| `createdAtStart` | `string (date-time)` | optional | Return only records first recorded at or after this time (`source.recordedAt`). |
| `createdAtEnd` | `string (date-time)` | optional | Return only records first recorded at or before this time (`source.recordedAt`). |
| `updatedAtStart` | `string (date-time)` | optional | Return only records the registry last changed at or after this time (`source.sourceUpdatedAt`). A record whose registry publishes no such date is kept. |
| `updatedAtEnd` | `string (date-time)` | optional | Return only records the registry last changed at or before this time (`source.sourceUpdatedAt`). A record whose registry publishes no such date is kept. |
| `page` | `integer` | optional | 1-based page number. Omit `page` and `perPage` to get the whole match set in one response, up to `cappedLimit` records. A page past `totalPages` returns an empty `records` array. See [Pagination](https://offendersearch.app/docs/pagination). |
| `perPage` | `integer` | optional | Records per page. Sending it turns pagination on (default 20 when `page` is sent without it). It is clamped to `cappedLimit`. A paginated request reaches every match, however many there are. |
| `ageTolerance` | `integer` | optional · default `1` | Years of slack, 0 to 10, when an age is compared: a searched `dob` against a published age, or a searched `age` against a record. On an `age` search the slack is never less than 1. |
| `onAgeMismatch` | `string` — one of `"drop"`, `"flag"` | optional · default `"drop"` | A record that matches on name but whose published age contradicts your `dob` (or falls outside `ageTolerance` on an `age` search). `drop` omits it. `flag` returns it labelled `matchState: "age_mismatch"` and `unverified: true`. |
| `dobTolerance` | `integer` | optional · default `0` | Birth-date typo tolerance, 0 to 2, for registries that publish a full date of birth. `0` keeps the exact rule. `1` or `2` returns a record whose date has the same month and day with the year off by up to that many years, or the day and month swapped, labelled `matchState: "dob_near_match"` and `unverified: true`; `matchBasis` says how it differed (`dob:near:year+1` means the registry's year is one later than yours; `dob:near:dayMonthSwapped`). A different month and day is still dropped. |

## What the envelope guarantees

- **Every top-level key is always present.** Test the value, never for key existence.
- **Coverage is reported, not implied.** `counts.sourcesQueried`, `sourcesComplete`, `sourcesIncomplete` and `sourcesSkippedByScope` appear on every response, alongside a `sourceStatus[]` entry per jurisdiction.
- **Match strength is labelled.** `matchState`, `matchBasis`, `matchDetail`, `matchedName` and `matchConfidence` let you set your own auto-accept threshold rather than inherit one.
- **The contract is additive.** New data lands as a new `recordType`; existing keys and their meanings do not change under you.
- **Ordering is total and stable.** The same query returns the same records in the same order, so paging never reshuffles.

## FCRA-regulated use

Results from `POST /v1/search` are not a consumer report and may not be used for FCRA-covered decisions. Approved consumer reporting agencies and screening platforms under a written FCRA agreement place FCRA orders instead — one order covers a sex offender search, a criminal search or both, with its own controls — see the [FCRA API](https://offendersearch.app/docs/fcra.md).

**Hiring or renting to someone?** FCRA workflows are meant primarily for tenant screening and hiring decisions. If a result could help decide whether a person gets a job or a home, run it through the [FCRA API](https://offendersearch.app/docs/fcra.md), not this endpoint.

## Test the sex offender search API in the sandbox

Run POST /v1/search against the sandbox with a test key (os_test_…): fixed test names return a clear answer, a date-of-birth-verified match, possible matches, alias, out-of-state, two-registry and homeless records, the same every time and never billed.

- **Sandbox base URL:** `https://sandbox.offendersearch.app`. Not `https://api.offendersearch.app`, which takes live keys only.
- **Test key:** in the dashboard, Developers → API keys (https://offendersearch.app/dashboard/keys) → **Create test key**. Test keys begin `os_test_`; send yours in the `X-API-Key` header.

POST /v1/search

```bash
curl -X POST "https://sandbox.offendersearch.app/v1/search" \
  -H "X-API-Key: $OFFENDERSEARCH_TEST_KEY" \
  -H "Content-Type: application/json" \
  -d '{
      "query": {
        "firstName": "Exact",
        "lastName": "Match",
        "dob": "1980-01-01"
      }
    }'
```

- Every test name: [Sex offender search test names](https://offendersearch.app/docs/sandbox#sex-offender-test-names)
- Postman collection: https://offendersearch.app/downloads/offendersearch-sandbox.postman_collection.json
- Sex Offender API sandbox: https://offendersearch.app/docs/sandbox.md
- Run any scenario from the browser: the HTML page's "Try it here" explorer (sandbox host and `os_test_` keys only, never billed).

---

# Matching, confidence & partial names

> strict, balanced and broad match modes, the closed match-strategy vocabulary, confidence ceilings, nickname expansion, and prefix search on partial names.

HTML: https://offendersearch.app/docs/matching · Markdown: https://offendersearch.app/docs/matching.md

## Match modes

The `match` field sets the fuzzy-match tolerance, applied uniformly across every jurisdiction, so behaviour is consistent no matter which states you hit. Whatever mode you choose, supplying a `dob` or `age` is the strongest lever on accuracy.

| Mode | First name | Last name | Use it for |
| --- | --- | --- | --- |
| `strict` | Exact only | Exact only | Lowest false positives; pair with a DOB. |
| `balanced` | Nicknames, initials, prefixes, middle names, typos (edit-distance 1) | Exact | The default — good recall with controlled noise. |
| `broad` | All balanced rules, with typos to edit-distance 2 | Also prefix + typo tolerance (scaled to the surname’s length) | Maximum recall; expect more low-confidence rows to triage. |

Read `matchDetail` to see exactly why a record matched — it splits the match into `strategies` (for example `{"lastName":"exact"}`), the `fieldsPresent` on the record, and any `signals`. The flat `matchBasis` array carries the same information mixed together.

**Nickname-aware name search.** Under `balanced` and `broad`, a `firstName` is expanded to its common nicknames and variants before matching — `John` also finds Johnny and Jack, and `Bob` finds Robert. Separately, every record carries an output-only `nicknames[]` array: the nickname equivalents of that record’s own first name, from our given-name table. It is computed by OffenderSearch and is never presented as data published by a jurisdiction.

## The match-strategy vocabulary — the complete list

Every record tells you *how* it matched, per field, in `matchDetail.strategies` (and, in the older flat form, as the `field:strategy` tokens of `matchBasis`). **The list is closed.** Any token the engine emits that this mapping does not define arrives under `matchDetail.other` rather than appearing here.

| Strategy | Can appear on | Meaning | Rank | Ceiling | Turned on by |
| --- | --- | --- | --- | --- | --- |
| `exact` | lastName, firstName, alias | The field equals what you sent — or equals one whole token of a compound surname, so a Smith query matches Hamilton-Smith. | 1 | none | Every mode. Cannot be switched off. |
| `nickname` | firstName only | A known given-name equivalence. Never appears on a surname — there is no surname nickname table, and asking for one is a 422. | 2 | 0.75 | balanced, broad |
| `initial` | firstName only | A single letter against a full given name, in either direction. | 2 | 0.60 | balanced, broad. Not requestable via nameMatch. |
| `prefix` | lastName, firstName, alias | The field starts with what you sent. Minimum 3 characters, anchored at a token start — never a mid-word substring. | 3 | 0.60 | firstName: balanced, broad · lastName: broad only |
| `fuzzy` | lastName, firstName, alias | A spelling variant or typo within an edit-distance budget that scales with name length. | 4 | 0.60 | firstName: balanced, broad · lastName: broad only |
| `middle` | firstName only | The given name you sent is the person’s MIDDLE name, matched as a whole token of the registered legal name — 81% of records carry one, and many people go by theirs. Whole token and exact only: minimum 2 characters, never a prefix, never fuzzy, and an initial is not a name in either direction. Tried only after the registered first name and every alias have failed, so a stronger basis is always the one reported. matchedNameType stays "legal"; signals also carries matchedMiddleName. | 5 | 0.60 | balanced, broad |
| `absent` | firstName only | The record publishes no first name at all, so your query could not be DISPROVED. The record is kept and flagged — it is never a confirmation. | 6 | 0.60 | Every mode. Not requestable via nameMatch. |

**Rank** is the ordering contract, not a score: `1` is the strongest evidence, and results sort by surname rank then given-name rank, with legal-name hits ahead of alias-only hits. **Ceiling** is the cap the strategy puts on `matchConfidence`, applied automatically so a widened hit is never reported as certainty. The cap is lifted in exactly one case: you supplied a `dob` and the record’s full date of birth matched it. Where the registry publishes only a birth year and your `dob` confirmed it (`year_match`), the cap is raised to `0.80` instead.

**Choosing an auto-accept threshold.** Gate on `matchDetail.strategies`, not on `matchConfidence` alone — several strategies share one ceiling. Auto-accept only `exact` on every field you queried with `matchedNameType: "legal"`, and for anything consequential require a confirmed date of birth as well. Send `nickname`, `initial`, `prefix` and `fuzzy` hits to human review. Never auto-accept an alias-only hit or `firstName: "absent"` — the latter means *this person could not be ruled out*, which is not the same fact as *this is your person*.

## Partial name search

Set `prefixMatch` and the name you send is treated as the **start** of a name. Searching `thom` returns Thomas, Thompson and Thomason — on the first name, the last name, or both — matched against every recorded alias as well as the registered name.

```json
{
  "query": {
    "firstName": "thom",
    "lastName": "and",
    "prefixMatch": "both"
  }
}
```

`prefixMatch` accepts `"firstName"`, `"lastName"`, `"both"`, or a list. When both fields are prefix-matched, a record must satisfy *both*. Sending `prefixMatch` runs the rest of the name match at `broad`, whatever `match` says.

| Rule | What it means |
| --- | --- |
| Prefix, not substring | thom matches Thompson but not Bothomley. We anchor at the start of a name, never mid-word. |
| Minimum 3 characters | A shorter prefix is rejected with 422. One or two letters is a bulk download, not a search. |
| Every name part | A compound or hyphenated surname matches on any of its parts: thom finds Hamilton-Thompson. |
| Aliases included | Prefixes are matched against every recorded alias as well as the registered name, so a variation of a first name still finds the person. matchedName tells you which one matched. |
| A superset of exact | Turning prefix matching on never loses a record that an exact search would have returned. |
| Exact ranks first | An exact surname match always appears above a prefix match, and the order is deterministic — paging never reshuffles results. |
| Scope it when you can | An explicit jurisdictions list narrows which jurisdictions run, so a prefix search scoped that way does less work than one across every US registry. Note that query.state does NOT scope the search — it is a residence filter, and every jurisdiction is still queried. |
| Prefix runs at broad | Sending prefixMatch runs the rest of the name match at match: "broad", whatever match says — so the surname also accepts prefix and typo matches. Send nameMatch instead to choose every strategy yourself. |

### Per-field control with nameMatch

`prefixMatch` is the shorthand. Send `nameMatch` to drive matching yourself and list exactly the strategies you want per field. Anything you leave out is **off** for that field, and `nameMatch` overrides both `prefixMatch` and `match`.

```json
{
  "query": {
    "firstName": "Robert",
    "lastName": "thom",
    "nameMatch": {
      "firstName": [],
      "lastName": ["prefix"],
      "aliases": true
    }
  }
}
```

| Strategy | Applies to | Meaning | Example |
| --- | --- | --- | --- |
| `exact` | firstName, lastName | The name equals what you sent. Always on — it cannot be switched off. | `Thomas → Thomas` |
| `prefix` | firstName, lastName | The name starts with what you sent. Minimum 3 characters. | `thom → Thomas, Thompson, Thomason` |
| `nickname` | firstName | A known given-name equivalence. | `bob → Robert` |
| `fuzzy` | firstName, lastName | A spelling variant or typo within edit distance. | `smyth → Smith` |
| `middle` | firstName | The given name you sent is the person’s middle name, matched exactly as a whole word. Minimum 2 characters. | `Wayne → Dean Wayne Ellison` |

### Which name matched — legal or alias

A prefix is matched against every recorded alias as well as the registered name. Every record tells you which name did it.

```json
{
  "name":        { "first": "Ryan", "last": "Lloyd" },
  "aliases":     ["BRANDON THOMPSON"],
  "matchedName": { "value": "BRANDON THOMPSON", "type": "alias" },
  "matchBasis":  ["lastName:prefix", "alias:prefix", "alias_match"],
  "matchConfidence": 0.55
}
```

Send `"nameMatch": { "aliases": false }` to search registered names only.

### How results are ordered

The ordering is deterministic, so paging never reshuffles. In order:

1. Surname match strength — exact, then prefix, then fuzzy
2. First-name match strength — exact, then nickname or initial, then prefix, fuzzy, middle name, and no first name published
3. Legal-name matches before alias-only matches
4. A whole-surname match before a match on one part of a compound surname
5. matchConfidence, highest first
6. Last name, first name, then date of birth
7. Record id — the final tie-break, so the ordering is total and repeatable

### Confidence ceilings

Widening a search widens the risk of returning the wrong person, so a partial-name hit is never presented as certainty.

| How the name matched | matchConfidence ceiling |
| --- | --- |
| Exact match on the registered name | `No cap` |
| Nickname | `0.75` |
| Initial, prefix, fuzzy, middle name, or no first name published | `0.60` |
| Alias only | `0.55` |
| Any widened match whose birth year your dob confirmed (year_match) | `0.80` |

The one exception: if you supplied a `dob` and the record’s full date of birth matches it, the cap is lifted. A confirmed birth year alone raises the cap to `0.80`. Supplying a `dob` or `age` alongside a prefix search is the single best way to keep precision while widening recall.

---

# Searching by date of birth

> Add a dob and every record returns a labelled matchState: dob_match, year_match, age_match or no_dob_age_year — so you set your own confidence threshold.

HTML: https://offendersearch.app/docs/date-of-birth · Markdown: https://offendersearch.app/docs/date-of-birth.md

## Searching by date of birth

A date of birth is the strongest identity verifier. Add `dob` (`YYYY-MM-DD`) to your `query` and every returned record carries a `matchState` telling you exactly how it matched. A record with no date of birth published is never silently dropped: if there is nothing to confirm the date but the name matched, you still get the record, labelled as unverified. Only a true conflict is excluded.

Jurisdictions publish identity at different resolutions — a full calendar date, a birth year, an age, or none of the three — and `matchState` names which one verified this record. That lets you set your own threshold for auto-accept versus review, rather than inherit one.

### matchState — how each record matched

| matchState | Meaning |
| --- | --- |
| `dob_match` | The record has a full date of birth on file and it equals the DOB you queried — the strongest confirmation. |
| `year_match` | The record has NO full DOB (a year-only source, e.g. Massachusetts), but its birth year equals your DOB’s year. |
| `age_match` | The record’s age agrees with your query within ageTolerance (default ±1 year, for birthday drift): on a dob search, a record that publishes only an age; on an age search, any record whose date, year or age gives an age in range. |
| `no_dob_age_year` | The record has no DOB, year, or age to verify against — yet it is still returned because the name matched. Check matchBasis for name_match or alias_match. This is the “no DOB on file, but the name matches” case. |
| `age_mismatch` | The record’s published age contradicts your query, and you sent onAgeMismatch: "flag", so it is returned rather than dropped — always with unverified: true, so it never reads as a confirmation. |
| `dob_near_match` | You sent dobTolerance (1 or 2) and the record’s full date of birth is a likely typo of the one you sent: the same month and day with the year off by up to dobTolerance, or the day and month swapped. Returned rather than dropped, always with unverified: true; matchBasis says which (dob:near:year+1, dob:near:year-1, dob:near:dayMonthSwapped). |
| `dob_mismatch` | The record HAD a DOB, year, or age and it did NOT match your query, so it is filtered OUT of the results. You will not normally see this state — it is documented so you know a true conflict is excluded, never silently shown. |
| `null` | You did not send a dob or an age, so there was nothing to verify the record against and this field carries no information. It is null, not a string — do not treat it as a failed verification. |

`matchState` is `null` when you did not supply a `dob` or `age`. A record whose date, year or age actively conflicts with your query is filtered out of `records[]` — unless you send `onAgeMismatch: "flag"`, which returns an age contradiction labelled `age_mismatch`.

### dobVerification — the same signal, backward-compatible

`dobVerification` carries the raw token for integrations written before `matchState` existed. New code should read `matchState`.

| dobVerification | Meaning |
| --- | --- |
| `dob_match` | The record’s full date of birth equals the DOB you supplied — the strongest identity confirmation. |
| `year_match` | The record is year-only (dobPrecision: year) and its year equals your DOB’s year. |
| `age_match` | The record’s age agrees with your query within ageTolerance (default ±1 year, for birthday drift). |
| `unverified_no_dob_or_age` | The record had no DOB, age, or year to check against — kept and flagged (unverified: true). matchState spells it no_dob_age_year. |
| `age_mismatch(flagged)` | The record’s age contradicts your query and you sent onAgeMismatch: "flag", so it is returned, flagged unverified: true. matchState spells it age_mismatch. |
| `dob_near_match` | You sent dobTolerance and the record’s birth date is a likely typo of yours — the year off by up to that many years, or day and month swapped. Returned flagged unverified: true; matchBasis carries dob:near:year+1, dob:near:year-2 or dob:near:dayMonthSwapped. |
| `""` | You sent no dob or age, so there was nothing to verify. |

## dob, birthYear and dobPrecision

Jurisdictions differ in how much of a birth date they publish, so three fields carry the answer and which of them is populated is itself information. Read `dobPrecision` to know which case you are in.

| What the jurisdiction publishes | dob | birthYear | dobPrecision | Matches your dob query as |
| --- | --- | --- | --- | --- |
| A full calendar date | `"1961-09-25"` | `1961` | `"exact"` | `dob_match` |
| A birth year only | `null` | `1961` | `"year"` | `year_match` — any date you query inside that year |
| An age only | `null` | `null` | `"unknown"` | `age_match` — a date consistent with the published age |
| Neither date, year nor age | `null` | `null` | `"unknown"` | `no_dob_age_year` — kept on the name, `unverified: true` |

`dob` is a full `YYYY-MM-DD` date or `null` — never a bare year, never a partial date, and never a day and month chosen to fill the field, so you can hand it straight to a date parser. **Read `birthYear` for any year logic**: it is populated both from a published year and from the year of a published date, so your code never has to branch on which kind of record it is looking at. It is never inferred from an age.

**Age tolerance.** Where a jurisdiction publishes an age and no date, a name + `dob` search compares your date against that published age, and `ageTolerance` (0–10, default 1) sets how much slack that comparison allows. `onAgeMismatch` decides what happens to a record that matches on name but whose published age contradicts your date: `"drop"` omits it, `"flag"` returns it labelled `matchState: "age_mismatch"` and always `unverified`.

```json
{
  "query": {
    "firstName": "John",
    "lastName": "Doe",
    "dob": "1980-04-12",
    "ageTolerance": 2,
    "onAgeMismatch": "flag"
  },
  "match": "balanced"
}
```

## matchBasis — why each record is in the results

| matchBasis value | Meaning |
| --- | --- |
| `lastName:exact / firstName:exact` | The field equals the name you sent. |
| `lastName:prefix / firstName:prefix` | The field starts with the name you sent — a partial-name hit. See Partial name search. |
| `firstName:nickname` | Matched through a nickname equivalence (bob → Robert). |
| `lastName:fuzzy / firstName:fuzzy` | Matched through a spelling variant or typo. |
| `firstName:absent` | The record publishes no first name, so your first name could not be disproved — kept and flagged rather than dropped. |
| `alias:exact / alias:prefix` | An alias matched, not the registered name. Read matchedName to see which alias. |
| `name_match` | The record matched on its primary name — the name you searched. |
| `alias_match` | The record matched on one of its aliases rather than its primary name. |
| `unverified_no_dob_or_age` | The record was kept without DOB/age verification because there was nothing on file to check against — paired with matchState = no_dob_age_year. |
| `dob:near:year+1 / dob:near:year-2 / dob:near:dayMonthSwapped` | Kept by dobTolerance: how the record’s birth date differs from the one you sent — year+1 means the registry’s year is one later than yours; dayMonthSwapped means day and month are reversed. Paired with matchState = dob_near_match. |

`matchBasis` also carries `lastName`, `firstName`, and `dob` tokens indicating which identity fields the record itself provides. So a name hit with no date of birth reads as `matchState: "no_dob_age_year"` with `matchBasis: ["...", "name_match"]` (or `alias_match` when the match was on an alias).

```json
{
  "matchState": "no_dob_age_year",
  "matchBasis": ["lastName", "firstName", "unverified_no_dob_or_age", "name_match"],
  "unverified": true,
  "name": { "first": "John", "last": "Doe", "full": "John Doe" },
  "dob": null,
  "dobPrecision": "unknown"
}
```

---

# Result completeness & per-source status

> Every response labels which sources completed. counts, sourceStatus and the closed incompleteReason enum tell you whether an empty result is an answer.

HTML: https://offendersearch.app/docs/result-completeness · Markdown: https://offendersearch.app/docs/result-completeness.md

## Per-source status on every response

Every jurisdiction a search touches is reported individually in `sourceStatus[]`, on every response, whether or not it contributed a record. That is what makes a result auditable: a search is never a single number you have to trust, and an incomplete search is always labelled as one.

| status | Meaning |
| --- | --- |
| `ok` | Queried successfully; matched holds the count from this source. |
| `error` | This source did not complete for this request; see note. |
| `restricted` | Reserved for a source whose terms restrict this use; no source returns it today. |
| `no_coverage` | The source could not cover this query; see note. |

**A complete search**

```json
{
  "searchId": "srch_9f2a7c",
  "status": "complete",
  "counts": {
    "records": 1,
    "sourcesQueried": 2,
    "sourcesComplete": 2,
    "sourcesIncomplete": 0,
    "sourcesSkippedByScope": 0
  },
  "warnings": [],
  "sourceStatus": [
    { "source": "NJ", "status": "ok", "matched": 1, "fromCache": true,
      "note": null, "incomplete": false, "incompleteReason": null,
      "cappedOmitted": false },
    { "source": "PA", "status": "ok", "matched": 1, "fromCache": true,
      "note": null, "incomplete": false, "incompleteReason": null,
      "cappedOmitted": false }
  ],
  "records": []
}
```

**A labelled partial search**

```json
{
  "searchId": "srch_31c9de",
  "status": "partial",
  "counts": {
    "records": 4,
    "sourcesQueried": 58,
    "sourcesComplete": 56,
    "sourcesIncomplete": 2,
    "sourcesSkippedByScope": 0
  },
  "warnings": [
    "INCOMPLETE SEARCH: 2 of 58 registries could not be searched to completion — 1 returned more candidates than the search could examine (TX); 1 could not be read for this request and can be recovered by retrying (WA). The records below are a LOWER BOUND: …"
  ],
  "sourceStatus": [
    { "source": "TX", "status": "ok", "matched": 0,
      "incomplete": true, "incompleteReason": "truncated" },
    { "source": "WA", "status": "error", "matched": 0,
      "incomplete": true, "incompleteReason": "unavailable",
      "note": "source did not complete for this request" },
    { "source": "NJ", "status": "ok", "matched": 4,
      "incomplete": false, "incompleteReason": null }
  ],
  "records": []
}
```

**Read `sourceStatus[].incomplete`, not `status`.** `sourceStatus[].status` describes whether the source responded; `incomplete` describes whether the search of that source finished. A source can be `"ok"` and `incomplete: true` at the same time.

## The SourceStatus object — per-registry status fields

One registry's outcome within a search. Each registry the search touched has one entry in `sourceStatus[]`, so coverage is stated per response rather than assumed.

Returned or accepted by [`POST /v1/search`](https://offendersearch.app/docs/search#reference-post-v1-search), [`GET /v1/searches/{searchId}`](https://offendersearch.app/docs/async-and-webhooks#reference-get-v1-searches-searchid), [`POST /v1/search`](https://offendersearch.app/docs/live-evidence#reference-post-v1-search-live-evidence).

| Field | Type | Default | Description |
| --- | --- | --- | --- |
| `source` | `string` |  | The registry code. Example `"IL"`. |
| `status` | `string` — one of `"ok"`, `"error"`, `"restricted"`, `"no_coverage"`, `"complete"`, `"partial"` |  | `ok`: the registry was searched (its records can still be `[]`). `error`: the registry failed for this request. `restricted`: reserved for a registry whose terms restrict this use; no registry returns it today. `no_coverage`: the registry does not cover this query. `ok` describes whether the registry answered, not whether the search finished — read `incomplete` for that. A row appended by a `live` re-check reads `complete` (finished) or `partial` (`incomplete: true`) instead. |
| `matched` | `integer` |  | Records this registry contributed before records were merged across registries. A lower bound when `incomplete` is `true`. |
| `fromCache` | `boolean` |  | `true` when the answer came from the continuously updated dataset; `false` when it was checked live. |
| `note` | `string` or null |  | Free-text detail for logs. Its wording changes; never branch on it. Use `incomplete` and `incompleteReason`. |
| `incomplete` | `boolean` |  | `true` when this registry was not searched to the end, so a matching person here may not be in `records`. Independent of `status`. This is the field that decides whether an empty result means nobody matched. |
| `incompleteReason` | `string` or null — one of `"deadline"`, `"truncated"`, `"excluded"`, `"not_searched"`, `"unavailable"`, `"error"` |  | Why this registry did not finish; set exactly when `incomplete` is `true`. `deadline`: it did not answer in time — retry, or raise `deadlineMs` if you lowered it. `truncated`: the query matched more candidates than one search examines — narrow it (add a surname); retrying does not help. `excluded`: a retired option on your request dropped this registry; send the request without it and its records come back. `not_searched`: nothing was available to search for this registry — treat the answer as a lower bound and re-run later. `unavailable`: the registry could not be read for this request — retry. `error`: the registry failed — retry. See [Result completeness](https://offendersearch.app/docs/result-completeness). |
| `cappedOmitted` | `boolean` |  | `true` when this registry matched people and none of them are in this response because the response was capped. Its `matched` count is exact; what is missing is the records. Always present; `false` on uncapped searches. |

## Reading an empty result

An empty `records` array is not, on its own, evidence that a person is not registered. Two very different events produce the same empty list, and the response tells you which one you are holding.

| What happened | What the response says |
| --- | --- |
| Every jurisdiction completed and nobody matched. **This is an answer.** | `status: "complete"`, `counts.sourcesIncomplete: 0`, `counts.sourcesComplete === counts.sourcesQueried` |
| One or more jurisdictions did not complete. **This is a lower bound.** | `status: "partial"`, `counts.sourcesIncomplete > 0`, and a `warnings[]` sentence naming the jurisdictions |

Never infer absence without checking `counts.sourcesIncomplete === 0` first. Record an incomplete search as *not determined* and re-query more narrowly.

```javascript
const { status, counts, records } = await search(query);

if (counts.sourcesIncomplete > 0) {
  // Not an answer about anyone: a lower bound.
  return { outcome: "not_determined", counts };
}
if (records.length === 0) {
  // Every queried source completed and nobody matched.
  return { outcome: "no_match", counts };
}
return { outcome: "matches", records, counts };
```

## counts — how much of the search finished

`status` is one word, and one word cannot tell you how partial a partial result is. A search that reached 57 of 58 jurisdictions and one that reached 7 of 58 both say `"partial"`, and they are very different answers.

The counts — `sourcesQueried`, `sourcesComplete`, `sourcesIncomplete`, `sourcesSkippedByScope`, `records` and `recordsReturned` — are defined field by field in the [`POST /v1/search` response fields](https://offendersearch.app/docs/search#reference-post-v1-search).

`status: "complete"` means exactly `counts.sourcesComplete === counts.sourcesQueried`. If you log one number per search, log that ratio rather than the word.

## incompleteReason — the closed enum

A closed enum of six values, total over the condition it describes: `incomplete: true` always carries exactly one of these, and `incomplete: false` always carries `null`. An exhaustive switch on this field is safe to write; adding a seventh value would be a breaking change and is treated as one.

| Value | What to do | What it means |
| --- | --- | --- |
| `deadline` | Retry the same request | This source did not complete within the time bound set for this request, so it contributed no records. Transient — the identical request will usually complete. |
| `truncated` | Narrow the query — a retry returns the same answer | The query matches more candidate rows inside this one jurisdiction than a single search examines, and the examined set is not ranked, so a matching person can fall outside it. Deterministic: the identical request returns the identical answer. Add a first name, a date of birth or an age, or a city, and search again. |
| `excluded` | Remove the parameter from your request | A retired option on your request dropped this registry from the search. Send the request without it and the registry is searched again. |
| `not_searched` | Treat as not determined; retry later | This source did not contribute to this request, so a zero from it is not an answer about anyone. |
| `unavailable` | Retry with backoff | This source did not respond to this request and contributed no records. |
| `error` | Retry with backoff | This source returned no usable answer for this request and contributed no records. |

## The defined per-source limits

Two kinds of per-jurisdiction limit — how many candidate rows one search examines, and how long it waits — are defined in the contract so that one over-broad query cannot degrade the service for everyone. Both are always reported, never silent.

| Limit | Value | What reaches it |
| --- | --- | --- |
| `truncated` | At least 15,000 candidate rows per jurisdiction | Your query matches more rows inside that one jurisdiction than a single search examines. The examined set is not ranked, so a matching person can fall outside it. |
| `truncated` | 2,000 typo candidates per jurisdiction | `match: "broad"` only. Broad evaluates a second, speculative set of candidates for spelling variants of your surname, with its own smaller budget. |
| `deadline` | 15 seconds or more per jurisdiction, inside the search’s overall time budget | That jurisdiction did not complete within the bound and contributed zero records. Retrying usually completes it; if you lowered `deadlineMs`, raise it. |

A `dob` or `age` is never what gets displaced: when your query constrains the birth year, the records whose birth year matches are examined first, against the full candidate limit; records where the jurisdiction publishes no birth date are examined within a separate budget of their own, and a shortfall there is reported as `truncated` like any other.

**A cap is not a page.** `perPage` slices an answer you can walk in full — `counts.records` is the true total and `page = 1 … totalPages` returns every record exactly once. A candidate limit is the opposite: there is no next 15,000 to ask for. That is why it is reported and paging is not.

### Which query shapes reach a limit

| Query shape | Behaviour |
| --- | --- |
| `lastName` + `city` or `zipcode` | **Safest.** A city or ZIP narrows the rows examined inside each jurisdiction, not only the answer. Use this shape for any automated reconciliation job. |
| `lastName` alone | Fine for most surnames. Reaches the limit on short or very common surname tokens — Lee, Ford, Hill, Wood, Ward, Ray, West, James, Allen, Thomas — because alias and address matching widen the reach of a surname. |
| `firstName` with no `lastName` | **Declined with `422`.** A first name on its own has nothing to narrow on. Pair it with a surname, or with a date of birth or age. |
| `city`, `zipcode`, `dob` or `age` with no name | Reaches the limit in large jurisdictions — a single birth year still matches tens of thousands of people. With a name, the date is never what is displaced. |

---

# Pagination & response size

> A named search returns the full de-duplicated set in one response, up to a 4,000-record cap; page, perPage and totalPages reach every match beyond it.

HTML: https://offendersearch.app/docs/pagination · Markdown: https://offendersearch.app/docs/pagination.md

## Pagination

`POST /v1/search` returns the **full, de-duplicated result set in a single response** unless you ask otherwise. Set `query.page` and/or `query.perPage` to paginate; set neither and you get everything at once, up to the 4,000-record cap described below. A search that names no one is always paginated. Results are totally and stably ordered, so paging never reshuffles.

You do not have to page to get a complete answer. There is no page-until-empty loop to write and no cursor to carry. On a response you did not paginate, `perPage` comes back equal to `counts.records` and `totalPages` is `1` — that is the shape confirming you have everything (a capped response says so in `capped`; see Response size below).

| Parameter | Default | Constraint |
| --- | --- | --- |
| `query.page` | 1 | `>= 1` — `0` returns 422. A page past the end returns an empty `records` array. |
| `query.perPage` | 20 *when paginating* | `>= 1` |

The search envelope returns `page`, `perPage` and `totalPages` directly. Loop to `totalPages` rather than until a page comes back empty: a `page` past the end returns an empty `records` array, and every page you request is a billable search. `counts.records` is the total matched *before* the page slice, which is not `records.length`.

```javascript
async function page(n) {
  const res = await fetch("https://api.offendersearch.app/v1/search", {
    method: "POST",
    headers: {
      "X-API-Key": process.env.OFFENDERSEARCH_KEY,
      "Content-Type": "application/json",
    },
    body: JSON.stringify({
      query: { lastName: "Doe", state: "NJ", page: n, perPage: 20 },
    }),
  });
  return res.json();
}

const first = await page(1);
for (let n = 2; n <= first.totalPages; n++) {
  const next = await page(n);
}
```

## Response size

An unpaginated search for a common surname can reach roughly 20 MB of JSON (send `Accept-Encoding: gzip` and responses above 1 KB are compressed). Paginate for anything interactive. An unpaginated response is returned up to a defined **4,000-record** cap and sets `capped: true` when that cap applies; send `perPage` and every matched record is reachable, with `capped` false. Branch on `counts.records` against `counts.recordsReturned`: if they differ, there is more to fetch.

A **location-only search** — a radius, city, county, ZIP or state with no `firstName` or `lastName` — is always paginated, at up to **500 records per page**. Send it without `page` and you get page 1 with `totalPages`; a larger `perPage` is reduced to 500. Walk `page` from 1 to `totalPages` to read the full set. Searches that include a name are not affected. An account that reaches its monthly location-only record limit receives `403` with `code: "location_quota_paused"` on further location-only searches until the limit is raised.

- **Broad geographic searches.** A wide `lat/lng` + `radiusMiles` query can match many registrants. Narrow the radius or add name filters, or run it as an async search. Radius matching selects on address coordinates, so use a name search when you need selection that is independent of address coordinates.
- **A cap is not a page.** The per-jurisdiction candidate limit is reported through `incompleteReason: "truncated"` and is not something paging can walk through — narrow the query instead.

---

# Regular & Live modes, and source coverage

> Regular is the continuously-updated answer; Live re-verifies named jurisdictions at query time, $0.02 per completed source. Each record carries lastCheckedAt.

HTML: https://offendersearch.app/docs/freshness · Markdown: https://offendersearch.app/docs/freshness.md

## Two modes: Regular, and Live verification

There is one search endpoint, and which mode you get is decided by the request body. Omit the `live` block and you get the **Regular** answer — the continuously-updated data we hold, close to live, returned in one round trip. Send a `live` block and the API re-verifies the named jurisdiction(s) in real time. Both modes run every result through the **same** match logic and return the **same** response envelope, so the choice is about how the answer is obtained, not about a different product.

|  | Regular (default) | Live verification |
| --- | --- | --- |
| How you ask | Omit `live` | Send a `live` block |
| What you get | The continuously-updated answer, ranked in one round trip — close to live. | Re-verifies the named jurisdiction(s) at query time, then merges with the Regular answer. |
| Speed | One round trip | ≤2 sources may run inline; more → asynchronous |
| Price | Base per-call rate only | Base rate plus $0.02 per completed live source, to a $2.00 ceiling |

Base is $0.15 per call, dropping to $0.11 after 2,000 calls a month. A Regular search is billed as one call at that base rate. A live check adds $0.02 for each source that completes, and the live charge for one search never exceeds $2.00 — a price ceiling, not a source limit: every source you request runs. A live check that fails is not billed. Need the registry’s own page, not only its records? Add `"evidence": "pdf"` to the `live` block and the same search also prints it to a PDF — [live evidence](https://offendersearch.app/docs/live-evidence.md), $0.25 per registry document.

## Regular — the default

The Regular answer reads the continuously-updated data we hold, assembled into one ranked result, and returns in a single round trip. It is close to live — current enough for the great majority of screening decisions — and it is the mode you get when you say nothing. Every record still carries its own `lastCheckedAt`, so currency is a value you read off the answer rather than an assumption about the service.

## Live verification

A live check re-verifies at the named jurisdiction(s) as part of your request, then merges the fresh results with the Regular answer. Send a `live` block with `jurisdictions: [codes]` (an explicit list; a two-letter code names that state’s own registry) or `scope: "matched"` (re-verify every jurisdiction that produced a Regular hit) — one of the two. A live-verified record carries a fresh `lastCheckedAt`, and a live result supersedes the Regular copy of the same person; nothing is lost from either side.

```json
{
  "query": { "firstName": "John", "lastName": "Doe", "dob": "1980-04-12" },
  "live": { "jurisdictions": ["TX"] }
}
```

A live check of **≤2 sources**, each of which supports a synchronous check, runs synchronously — one `200`, results inline. **More than two sources**, or any source without a synchronous check, runs asynchronously: a `200` whose body is a job acknowledgement (`status: "pending"`, `mode: "async"`) with a `searchId` and a `poll` path. Both paths run the same live checks and return the same envelope. An empty live result is not, on its own, evidence of absence: check `counts.sourcesIncomplete == 0` before treating an empty `records` array as "not found".

## Currency is answered per request

It is carried on every record. `sources[].lastCheckedAt` is when that jurisdiction’s copy of the record was last confirmed, and `source.lastCheckedAt` is the same for the jurisdiction that supplied the record’s top-level values. Read it rather than a general statement about the dataset: it is a contract field, and it answers the question for the exact record in front of you. For a jurisdiction as a whole, `GET /v1/sources` publishes `health.lastSuccessAt`.

```json
{
  "source": {
    "jurisdiction": "NJ",
    "registryName": "State Sex Offender Registry",
    "recordUrl": "https://…",
    "recordedAt": "2026-08-13T04:12:00Z",
    "lastCheckedAt": "2026-08-13T04:12:00Z",
    "sourceUpdatedAt": "2026-08-11T00:00:00Z"
  },
  "sources": []
}
```

`sourceUpdatedAt` is the date the jurisdiction itself states it last changed the record; it is `null` where a jurisdiction publishes no such date.

## GET /v1/sources — List sources

The coverage catalog: every jurisdiction we cover, by code, name, and live health.

The live coverage catalog: every jurisdiction the API covers, with its code, display name, and health signals such as typical latency and when its data last updated. Use it to render your own coverage UI or to decide which `jurisdictions` to name.

No API key is required. A key sent with the request is ignored.

### What you can do

- **Coverage.** Every jurisdiction with its code and name.
- **Health.** Typical latency and the time of the last successful update, per jurisdiction.

### Request

**cURL**

```bash
curl https://api.offendersearch.app/v1/sources \
  -H "X-API-Key: $OFFENDERSEARCH_KEY"
```

**Node**

```javascript
const res = await fetch("https://api.offendersearch.app/v1/sources", {
  headers: { "X-API-Key": process.env.OFFENDERSEARCH_KEY },
});
const sources = await res.json();
for (const s of sources) console.log(s.id, s.scope, s.covers.join(","));
```

**Python**

```python
import os, requests

resp = requests.get(
    "https://api.offendersearch.app/v1/sources",
    headers={"X-API-Key": os.environ["OFFENDERSEARCH_KEY"]},
)
for s in resp.json():
    print(s["id"], s["scope"], ",".join(s["covers"]))
```

### Response

```json
[
  {
    "id": "NJ",
    "name": "New Jersey Sex Offender Internet Registry",
    "covers": ["NJ"],
    "registries": 1,
    "scope": "state",
    "status": "live",
    "legal": { "commercialUse": "unknown" },
    "health": { "lastSuccessAt": "2026-07-25T09:14:00Z", "typicalLatencyMs": 380,
                "ageSeconds": 3600, "freshFor": ["daily", "weekly"] }
  },
  {
    "id": "TX",
    "name": "Texas DPS Sex Offender Registry",
    "covers": ["TX"],
    "registries": 1,
    "scope": "state",
    "status": "live",
    "legal": { "commercialUse": "unknown" },
    "health": { "lastSuccessAt": "2026-07-25T09:14:00Z", "typicalLatencyMs": 410,
                "ageSeconds": 3600, "freshFor": ["daily", "weekly"] }
  }
  /* … one entry per registry … */
]
```

## Registry coverage API: GET /v1/sources response fields

`GET /v1/sources` · no API key

The coverage catalog: every registry the API searches, by code, with its coverage and health. No API key required.

### Request

No parameters.

### Response

**200** (application/json) — A JSON array with one SourceInfo entry per registry:

| Field | Type | Default | Description |
| --- | --- | --- | --- |
| `id` | `string` |  | The registry code. Send it in `jurisdictions`. Example `"IL"`. |
| `name` | `string` |  | The registry's name. Example `"Illinois Sex Offender Registry"`. |
| `covers` | `array of string` |  | State and territory codes this registry covers. |
| `registries` | `integer` |  | How many registries this entry represents: 1 for a state registry, more for an entry that groups the tribal registries. Example `1`. |
| `scope` | `string` — one of `"state"`, `"national"` |  | `state` or `national`. |
| `status` | `string` — one of `"building"`, `"live"` |  | `live` when the registry is searchable. |
| `legal` | `object` |  | The registry's terms of use for commercial purposes. |
| `legal.commercialUse` | `string` — one of `"allowed"`, `"restricted"`, `"prohibited"`, `"unknown"` |  | `allowed`, `restricted`, `prohibited` or `unknown`: what the registry's terms say about commercial use. Records from every US registry are returned in search results whatever this says. |
| `health` | `object` |  | Current health of this registry. |
| `health.lastSuccessAt` | `string (date-time)` or null |  | When this registry's data last updated successfully, ISO-8601; `null` if it never has. |
| `health.typicalLatencyMs` | `integer` or null |  | Typical response time in milliseconds; `null` when not measured. |
| `health.ageSeconds` | `number` or null |  | Seconds since `lastSuccessAt`; `null` when `lastSuccessAt` is `null`. |
| `health.freshFor` | `array of string` — one of `"daily"`, `"weekly"` |  | Labels for how recent the registry's data is (`daily`, `weekly`). Informational: each registry contributes to every search whatever this says. |

## The LiveBlock object — live verification request fields

Asks for named registries to be re-checked at query time (Live verification). Omit it for the Regular answer. Send `jurisdictions` or `scope`, not both. Add `evidence: "pdf"` to also receive each named registry's own page as a PDF.

Returned or accepted by [`POST /v1/search`](https://offendersearch.app/docs/search#reference-post-v1-search), [`POST /v1/search`](https://offendersearch.app/docs/live-evidence#reference-post-v1-search-live-evidence).

| Field | Type | Required / default | Description |
| --- | --- | --- | --- |
| `jurisdictions` | `array of string` or null | optional | Registry ids or two-letter codes to re-check live. A two-letter code names that state's or territory's own registry; any other id `GET /v1/sources` lists names that registry. Example `["TX"]`. |
| `scope` | `string` or null — one of `"matched"` | optional | `"matched"` re-checks the registries that produced the Regular matches, instead of naming them. |
| `evidence` | `string` or null — one of `"none"`, `"pdf"` | optional | `"pdf"`: besides the live check, print each registry named in `jurisdictions` (up to 20) — its own public website, every result page and each matching registrant's detail page — to one PDF per registry behind a cover page, and return the documents with the records. The search then always answers `202` and is returned by `GET /v1/searches/{searchId}`, whose body carries `evidence[]`. $0.25 per completed registry document, $5.00 ceiling per search, on top of the live search's normal charge; an incomplete document bills nothing. Omit it, or send `"none"`, for today's search, byte for byte. See [Live evidence](https://offendersearch.app/docs/live-evidence). |

## The LiveUsage object — live check charge fields

The live-check charge summary. Present only on the result of a search that carried a `live` block — the inline response, or the polled result of a live job; its presence is the signal that the answer was re-verified live.

Returned or accepted by [`POST /v1/search`](https://offendersearch.app/docs/search#reference-post-v1-search), [`GET /v1/searches/{searchId}`](https://offendersearch.app/docs/async-and-webhooks#reference-get-v1-searches-searchid), [`POST /v1/search`](https://offendersearch.app/docs/live-evidence#reference-post-v1-search-live-evidence).

| Field | Type | Default | Description |
| --- | --- | --- | --- |
| `liveChecks` | `integer` |  | Registries re-checked live that completed. The true count, even when the charge reached its ceiling. Example `1`. |
| `liveChargeUsd` | `number` |  | The live charge for this search, in US dollars: $0.02 per completed registry, at most $2.00. Example `0.02`. |
| `capped` | `boolean` |  | `true` when the charge reached the $2.00 per-search ceiling. Example `false`. |
| `display` | `string` |  | A one-line summary for display. Example `"1 live checks · $0.02"`. |

## The MeterEvent object — billable units on a live result

One billable unit behind a live result. Present only on a live result, in `meterEvents[]`.

Returned or accepted by [`POST /v1/search`](https://offendersearch.app/docs/search#reference-post-v1-search), [`GET /v1/searches/{searchId}`](https://offendersearch.app/docs/async-and-webhooks#reference-get-v1-searches-searchid), [`POST /v1/search`](https://offendersearch.app/docs/live-evidence#reference-post-v1-search-live-evidence).

| Field | Type | Default | Description |
| --- | --- | --- | --- |
| `kind` | `string` |  | The unit's kind. `live_source` is one completed live registry check. Example `"live_source"`. |
| `quantity` | `integer` |  | How many units. Example `1`. |
| `chargeCeilingUsd` | `number` or null |  | The per-search ceiling that applies to these units, in US dollars; `null` when none applies. Example `2`. |

---

# Live evidence — the registry’s page as a PDF

> Ask for live evidence and the search prints the registry’s own website — result pages and detail pages — to one PDF per registry, with a cover page and hash.

HTML: https://offendersearch.app/docs/live-evidence · Markdown: https://offendersearch.app/docs/live-evidence.md

## Who live evidence is for

Some files have to hold what the registry itself showed, not only a record of it. A skilled nursing admission that must survive a survey, a visitor-management log with an audit obligation, a home care or staffing agency that keeps what the registry displayed on the day of the check, a legal or licensing file — in each of those the question later is “what did the registry’s page say when you looked?”, and a database row does not answer it.

Live evidence answers it, and it is **one field on the search you already send**: add `"evidence": "pdf"` to the `live` block of `POST /v1/search`. The search runs the live check for the registries you name and, in addition, opens each registry’s own public website, runs the search there, and prints every result page and each matching registrant’s detail page to **one PDF per registry**, behind a cover page that states the query, the registry, the capture time, the URLs captured and a content hash. Same host, same key, same header; a search without the field is unchanged, byte for byte. Most callers do not need it. This is the path for compliance-heavy flows where a record of the registry’s own page is required.

## Records or documents — a live check and a live evidence search

A [live check](https://offendersearch.app/docs/freshness.md) re-verifies a registry and gives you back **records**: normalized, de-duplicated, scored, each with a `personRef`. A live evidence search gives you the same records **and documents**: the registry’s own pages, printed as shown. Both are the same `POST /v1/search`; you name the registries the same way in both — `live.jurisdictions` — and the records arrive exactly as a live check returns them, because they come from the normal live check; the documents are added beside them.

|  | Live check | Live evidence search |
| --- | --- | --- |
| Endpoint | `POST /v1/search` | `POST /v1/search` — the same call, same key, same header |
| How you ask | `"live": { "jurisdictions": [...] }` | `"live": { "jurisdictions": [...], "evidence": "pdf" }` |
| What comes back | Records in `records[]`, each with `personRef` | The same records, plus one entry per named registry in `evidence[]` with a PDF |
| Speed | ≤2 registries may run inline; more → asynchronous | Always asynchronous (`202`) — printing takes 10 to 90 seconds per registry |
| Price | The call plus $0.02 per completed registry, $2.00 ceiling | The same, plus $0.25 per completed document, $5.00 ceiling on the documents |

[Clearances](https://offendersearch.app/docs/clearances.md) apply to the records as usual. A cleared person’s page is still printed: the page is the registry’s statement, and the clearance is your decision about it, so the document stays faithful to what the registry showed.

## The flow: request, poll, download

Send `POST /v1/search` as you always do, with `"evidence": "pdf"` in the `live` block. The registries named in `live.jurisdictions` are the ones that get a printed document — up to 20 per request.

```bash
curl https://api.offendersearch.app/v1/search \
  -H "X-API-Key: $OS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "query": { "firstName": "Jordan", "lastName": "Rivera", "dob": "1988-04-12" },
    "live": { "jurisdictions": ["CA", "NV"], "evidence": "pdf" }
  }'
```

**A live evidence search always runs asynchronously**, even for one registry: the answer is a `202` with a job handle, never an inline result. The id starts with `evs_`, and `registries` lists what will be printed.

```json
{
  "searchId": "evs_7d41e2",
  "status": "pending",
  "mode": "async",
  "registries": ["CA", "NV"],
  "pollUrl": "/v1/searches/evs_7d41e2"
}
```

Poll `GET /v1/searches/{searchId}` — the same poll as [any async search](https://offendersearch.app/docs/async-and-webhooks.md) — until `status` leaves `pending` and `running`. The finished result is the full search response exactly as `POST /v1/search` returns it, with `evidence[]` added, one entry per registry you named, and `sourceSearchId`, the id of the live search that produced the records.

```json
{
  "searchId": "evs_7d41e2",
  "sourceSearchId": "srch_9f2c1a7b",
  "status": "complete",
  "counts": { "records": 1, "recordsReturned": 1, "sourcesQueried": 2,
              "sourcesComplete": 2, "sourcesIncomplete": 0 },
  "sourceStatus": [ /* one entry per registry, as on every search */ ],
  "records": [ /* one Record per matched registrant, with personRef, as on every search */ ],
  "evidence": [
    {
      "jurisdiction": "CA",
      "status": "complete",
      "kind": "text",
      "pages": 3,
      "resultPages": 2,
      "detailPages": 1,
      "capturedAt": "2026-10-18T14:02:11+00:00",
      "sourceUrl": "https://…",
      "pageUrls": ["https://…", "https://…", "https://…"],
      "sha256": "9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08",
      "bytes": 412330,
      "downloadUrl": "/v1/searches/evs_7d41e2/evidence/CA.pdf",
      "billed": true,
      "chargeUsd": 0.25,
      "pdfBase64": "JVBERi0x…",
      "inline": true
    },
    {
      "jurisdiction": "NV",
      "status": "incomplete",
      "incompleteReason": "no_recipe",
      "detail": "This registry cannot be printed yet.",
      "billed": false
    }
  ],
  "usage": {
    "liveChecks": 2, "liveChargeUsd": 0.04,
    "liveEvidence": 1, "liveEvidenceUsd": 0.25,
    "capped": false, "display": "2 live checks · 1 document · $0.29"
  }
}
```

- **A complete entry** carries the capture: `kind`, `pages` split into `resultPages` and `detailPages`, `capturedAt` in UTC, `sourceUrl` and every `pageUrls` entry, the `sha256` of the PDF, its `bytes`, the `downloadUrl`, and the charge.
- **The PDF itself** is in `pdfBase64` when the document is 4 MB or smaller (`inline: true`). Above that, `pdfBase64` is `null`, `inline` is `false`, and the download link is the way to get it.
- **An incomplete entry** carries `incompleteReason` from a closed list — `no_recipe`, `renderer_unavailable`, `source_unreachable`, `blocked`, `timed_out`, `no_results_page`, `render_failed` or `query_unsupported` — a free-text `detail`, and `billed: false`. Branch on the reason, never on `detail`.

Download any completed document with the API key. The search must belong to your account; any other search id answers `404`. Documents are kept for **30 days**.

```bash
curl https://api.offendersearch.app/v1/searches/evs_7d41e2/evidence/CA.pdf \
  -H "X-API-Key: $OS_API_KEY" \
  -o jordan-rivera-CA.pdf
```

## What a document contains

Every PDF has the same two parts, in this order:

- **Our cover page.** The query as sent, the registry printed, the capture time in UTC, the URL of every page captured, the page count, and the SHA-256 of the document that follows — so a reviewer can tell, years later, that the file is intact and which registry and moment it describes.
- **The registry’s pages, as shown.** Every result page the search produced on the registry’s website, then the detail page of each registrant that matched the query. Nothing is re-typed or re-formatted; the page is what the registry displayed at that moment.

`kind` tells you how the registry pages were produced. `text` means they were printed from the page and the PDF is searchable. `image` means each page is a full-page capture rendered as an image — some registries only work this way, and the result is a faithful picture rather than selectable text. `mixed` means a document holds both.

**Some registries cannot be printed yet.** The list grows. A registry that cannot be printed answers `incompleteReason: "no_recipe"`, is never billed as a document, and its live check still runs and returns records as usual.

## Price, and what is never billed

- **The search is billed exactly like a live search.** The call at the base per-call rate, plus $0.02 per live source that completes, to the usual $2.00 ceiling.
- **Plus $0.25 per registry document that completes.** The evidence charge for one search never exceeds **$5.00** — a price ceiling, not a document limit.
- **Incomplete documents bill nothing.** Whatever the reason, an incomplete entry reports `billed: false`; a registry that cannot be printed yet is never billed as a document.
- **Read it off the response.** `usage.liveEvidence` is the count of billed documents and `usage.liveEvidenceUsd` the charge, beside the usual `liveChecks` and `liveChargeUsd`; each entry in `evidence[]` carries its own `billed` and `chargeUsd`.

## Limits

| Limit | Value |
| --- | --- |
| Registries per request | Up to 20 in `live.jurisdictions`. Name the registries that matter. |
| Pages per registry | Up to 10 by default (a registry’s recipe may allow more), result pages and detail pages together. |
| Retention | 30 days from `capturedAt`; after that the download link answers `404`. |
| Inline cap | 4 MB. Larger documents come only by the download link (`inline: false`). |
| Time | 10 to 90 seconds per registry; always asynchronous. |

## Endpoints

Nothing new to point at. Live evidence uses the search endpoint and its poll, plus one route for the document itself — all on `api.offendersearch.app`, with the same `X-API-Key` header as every other call.

| Endpoint | Role |
| --- | --- |
| `POST /v1/search` | Start the search, with `live.evidence: "pdf"`. Always `202`. |
| `GET /v1/searches/{searchId}` | The poll. The finished result is the full search response plus `evidence[]`. |
| `GET /v1/searches/{searchId}/evidence/{jurisdiction}.pdf` | The document itself, as `application/pdf`. |

## Live evidence search API: the search that prints the registry's page

`POST /v1/search` · auth: `X-API-Key`

The ordinary `POST /v1/search`, with `"evidence": "pdf"` added to the `live` block. The registries named in `live.jurisdictions` (up to 20) are the ones printed. The live check runs as usual, so the records come back exactly as `POST /v1/search` returns them, and each named registry's own public website is printed to one PDF behind a cover page. With the field the search always answers `202`; collect the result from `GET /v1/searches/{searchId}`. Without it, nothing changes.

### Request

**Body** (application/json)

The body of `POST /v1/search`, with `live.evidence: "pdf"`. `live.jurisdictions` names the registries to print.

The body is [the `SearchRequest` object](https://offendersearch.app/docs/search#reference-post-v1-search). The body of `POST /v1/search`: the person or place to search for, and how widely and how strictly to match.

### Response

**200** (application/json) — Only when `live.evidence` is omitted or `"none"`: the ordinary search answer, exactly as today. A live evidence search never answers `200`.

The body is [the `SearchResponse` object](https://offendersearch.app/docs/search#reference-post-v1-search). The body every sex offender search returns: the matched records, how many registries answered, and a per-registry status for each one.

**202** (application/json) — The job was accepted. Poll `pollUrl`. The search is billed like a live search — the call plus $0.02 per completed live source — and each registry document that completes adds $0.25, to a $5.00 ceiling per search.

| Field | Type | Default | Description |
| --- | --- | --- | --- |
| `searchId` | `string` |  | The job's id. Keep it: it is the id you poll, and the id the documents are downloaded under. Example `"evs_7d41e2"`. |
| `status` | `string` — one of `"pending"` |  | Always `pending` on acceptance. |
| `mode` | `string` — one of `"async"` |  | Always `async`: a live evidence search never answers inline. |
| `registries` | `array of string` |  | The registries that will be printed — `live.jurisdictions` as resolved, one entry per registry. Example `["CA","NV"]`. |
| `pollUrl` | `string` |  | Path of `GET /v1/searches/{searchId}` for this job — the same poll as any async search. Example `"/v1/searches/evs_7d41e2"`. |

**Errors**

| Status | Code | When |
| --- | --- | --- |
| 401 | — | The `X-API-Key` header is missing or the key is not valid, and no valid dashboard session was sent. |
| 402 | — | The account has no active subscription and no free-trial searches left. `detail` says which. |
| 422 | — | A field is malformed or unrecognised, `live.evidence` is not `"none"` or `"pdf"`, or `live.jurisdictions` is missing, empty or names more than 20 registries. `detail` says which. |
| 503 | `unavailable` | Live evidence is temporarily unavailable. The search was not run and nothing was billed; retry, or omit `live.evidence`. |

## Poll a live evidence search: status, records and evidence[]

`GET /v1/searches/{searchId}` · auth: `X-API-Key`

The same poll as any async search. For a live evidence search it reads the job's status and, once it has finished, the full search response plus `evidence[]`, one entry per registry named in `live.jurisdictions`.

### Request

**Path parameters**

| Field | Type | Required / default | Description |
| --- | --- | --- | --- |
| `searchId` | `string` | required | The `searchId` from the `202` of a search that sent `live.evidence: "pdf"`. Example `"evs_7d41e2"`. |

### Response

**200** (application/json) — When the job has finished (`complete`, or `partial` when a registry's live check did not finish), the full search response with `evidence[]`, `sourceSearchId` and `usage.liveEvidence` / `usage.liveEvidenceUsd`. While it is `pending` or `running`, a short body: `searchId`, `status`, `registries`, zeroed `counts`, `sourceStatus: []`, `records: []`, `evidence: []`. When the job failed: `searchId`, `status: "error"`, `error`, `records: []`, `evidence: []`.

Every field of [the `SearchResponse` object](https://offendersearch.app/docs/search#reference-post-v1-search), plus:

| Field | Type | Default | Description |
| --- | --- | --- | --- |
| `evidence` | array of [EvidenceDocument](https://offendersearch.app/docs/live-evidence#object-evidencedocument) |  | One EvidenceDocument per registry named in `live.jurisdictions`, complete or incomplete. `[]` while the job is `pending` or `running`. |
| `sourceSearchId` | `string` or null |  | The id of the live search on this account that produced `records[]`. Present once the job has finished. Example `"srch_9f2c1a7b"`. |
| `registries` | `array of string` or null |  | The registries this search prints, as acknowledged on the `202`. Present while the job is `pending` or `running`. Example `["CA","NV"]`. |

**Errors**

| Status | Code | When |
| --- | --- | --- |
| 401 | — | The `X-API-Key` header is missing or the key is not valid, and no valid dashboard session was sent. |
| 404 | — | No live evidence search with this id on this account (a search run by another account answers the same 404). The body is an [Error](https://offendersearch.app/docs/errors#object-error). |

## Download a live evidence document (PDF)

`GET /v1/searches/{searchId}/evidence/{jurisdiction}.pdf` · auth: `X-API-Key`

Download one registry's live evidence document — the registry's own public website, printed as shown behind a cover page. The path is the `downloadUrl` of the matching `evidence[]` entry. Not billed: the document was billed when it was produced.

### Request

**Path parameters**

| Field | Type | Required / default | Description |
| --- | --- | --- | --- |
| `searchId` | `string` | required | The `searchId` of a live evidence search on this account. Example `"evs_7d41e2"`. |
| `jurisdiction` | `string` | required | The `jurisdiction` of the evidence entry, as returned in `evidence[]`. Example `"CA"`. |

### Response

**200** (application/pdf) — The document: our cover page, then the registry's pages as shown.

**Errors**

| Status | Code | When |
| --- | --- | --- |
| 401 | — | The `X-API-Key` header is missing or the key is not valid. |
| 404 | — | No live evidence search with this id on this account, no completed document for this registry on that search, or the document is past its 30-day retention. The body is an [Error](https://offendersearch.app/docs/errors#object-error). |

## The EvidenceDocument object — one registry's printed page

One registry's live evidence document: the registry's own public website, printed as shown to a PDF behind a cover page. One entry per registry named in `live.jurisdictions`, in `evidence[]`. A `complete` document carries the capture and download fields; an `incomplete` one carries `incompleteReason` and `detail` and is never billed.

Returned or accepted by [`GET /v1/searches/{searchId}`](https://offendersearch.app/docs/live-evidence#reference-get-v1-searches-searchid-live-evidence).

| Field | Type | Default | Description |
| --- | --- | --- | --- |
| `jurisdiction` | `string` |  | The registry this document covers, as the two-letter code or registry id sent in `live.jurisdictions`. Example `"CA"`. |
| `status` | `string` — one of `"complete"`, `"incomplete"` |  | `complete`: the PDF was produced and can be downloaded. `incomplete`: it was not; read `incompleteReason`. |
| `kind` | `string` or null — one of `"text"`, `"image"`, `"mixed"` |  | How the registry pages were produced. `text`: printed from the page, searchable. `image`: each page is a full-page capture rendered as an image (some registries only work this way). `mixed`: both in one document. Present only when `status` is `complete`. |
| `pages` | `integer` or null |  | Pages of registry content in the PDF, after the cover page. Present only when `status` is `complete`. Example `3`. |
| `resultPages` | `integer` or null |  | How many of `pages` are result pages. Present only when `status` is `complete`. Example `2`. |
| `detailPages` | `integer` or null |  | How many of `pages` are registrant detail pages. Present only when `status` is `complete`. Example `1`. |
| `capturedAt` | `string (date-time)` or null |  | When the registry's pages were captured, in UTC. Present only when `status` is `complete`. Example `"2026-10-18T14:02:11+00:00"`. |
| `sourceUrl` | `string` or null |  | The registry website the search was run on. Present only when `status` is `complete`. Example `"https://…"`. |
| `pageUrls` | `array of string` or null |  | The URL of every page captured, in document order. Present only when `status` is `complete`. |
| `sha256` | `string` or null |  | SHA-256 of the PDF, in hex; the same value is printed on the cover page. Present only when `status` is `complete`. |
| `bytes` | `integer` or null |  | Size of the PDF in bytes. Present only when `status` is `complete`. Example `412330`. |
| `downloadUrl` | `string` or null |  | Path of `GET /v1/searches/{searchId}/evidence/{jurisdiction}.pdf` for this document, valid for 30 days. Present only when `status` is `complete`. Example `"/v1/searches/evs_7d41e2/evidence/CA.pdf"`. |
| `billed` | `boolean` |  | `true` when this document was billed ($0.25). Always `false` on an incomplete document. |
| `chargeUsd` | `number` or null |  | The charge for this document in US dollars. Present only when `status` is `complete`. Example `0.25`. |
| `pdfBase64` | `string` or null |  | The PDF, base64-encoded, when the document is 4 MB or smaller. `null` above that — use `downloadUrl`. Present only when `status` is `complete`. |
| `inline` | `boolean` or null |  | `true` when `pdfBase64` carries the document; `false` when it is available only by `downloadUrl`. Present only when `status` is `complete`. |
| `incompleteReason` | `string` or null — one of `"no_recipe"`, `"renderer_unavailable"`, `"source_unreachable"`, `"blocked"`, `"timed_out"`, `"no_results_page"`, `"render_failed"`, `"query_unsupported"` |  | Why no document was produced; set exactly when `status` is `incomplete`. `no_recipe`: this registry cannot be printed yet. `renderer_unavailable`: the printing service was not available — retry. `source_unreachable`: the registry website did not answer — retry. `blocked`: the registry website refused the visit. `timed_out`: printing did not finish in time — retry. `no_results_page`: the registry website showed no results page for this query. `render_failed`: the pages were reached but could not be printed. `query_unsupported`: this registry's website cannot search on the fields the query supplied. |
| `detail` | `string` or null |  | A sentence for logs explaining the incomplete reason. Its wording changes; branch on `incompleteReason`, never on this. |

## The EvidenceLiveUsage object — live evidence charge fields

The `usage` block of a live evidence search: every LiveUsage field — the live check is billed exactly as on the main API — plus the evidence documents.

Every field of [the `LiveUsage` object](https://offendersearch.app/docs/freshness#object-liveusage), plus:

| Field | Type | Default | Description |
| --- | --- | --- | --- |
| `liveEvidence` | `integer` |  | Live evidence documents that completed and were billed on this search. Example `1`. |
| `liveEvidenceUsd` | `number` |  | The live evidence charge for this search, in US dollars: $0.25 per completed registry document, at most $5.00. Separate from `liveChargeUsd`. Example `0.25`. |

---

# Jurisdictions & codes

> Every jurisdiction code the API accepts, how the jurisdictions array scopes a search, and why query.state filters a result rather than selecting registries.

HTML: https://offendersearch.app/docs/jurisdictions · Markdown: https://offendersearch.app/docs/jurisdictions.md

## Scoping a search

The `jurisdictions` array controls *which jurisdictions run*. Omit it or send `null` to search the full dataset — the default and the common case. Naming codes narrows the search to those jurisdictions — plus, where they cover the state, the tribal registries (`TRIBAL`) — which reduces both latency and the number of sources reported in `sourceStatus`.

- `jurisdictions: null` → the full dataset (default).
- `["IL"]` → Illinois only.
- `["IL", "IN"]` → Illinois *and* Indiana only.
- `["TX"]` → Texas, plus the tribal registries that cover Texas.

```json
{
  "query": { "firstName": "Maria", "lastName": "Lopez" },
  "jurisdictions": ["TX", "NM"]
}
```

## query.state filters a result; jurisdictions selects the search

These are two different controls. `jurisdictions` decides which jurisdictions are queried at all. `query.state` does not change that — every jurisdiction is queried and `state` narrows the answer. Set `locationScoped: true` alongside `query.state` when you explicitly want the narrower, cheaper fan-out; the response then reports `counts.sourcesSkippedByScope` and a NARROWED SEARCH warning, so the scope decision is visible in the payload.

**`query.state` filters as a union, not as a plain residence test.** A record is kept when either it has an address in that state *or* that state’s jurisdiction is the one holding it. Those are different populations — of the records held by a state registry, about 12% list a residence outside that state, and about 6% carry no address state at all and are reachable only by the second half. Every record returns `registrationState` and `addressStates` so you can tell which half matched without a second call.

```json
// Filter: query every jurisdiction, keep Texas-connected records.
{ "query": { "lastName": "Doe", "state": "TX" } }

// Scope: query only the jurisdictions covering Texas.
{ "query": { "lastName": "Doe", "state": "TX" }, "locationScoped": true }

// Scope, explicitly: query exactly these jurisdictions.
{ "query": { "lastName": "Doe" }, "jurisdictions": ["TX"] }
```

`state` accepts a 2-letter USPS code or the full state name — identical results. A value that cannot be resolved returns `422` rather than an empty result, so a typo is never mistaken for no matches.

## Jurisdiction codes

Jurisdiction codes are the USPS state and territory abbreviations — except `CNMI` and `USVI` for the Northern Mariana Islands and the US Virgin Islands — plus `TRIBAL` for the tribal registries; `GET /v1/sources` lists every id. `query.state` accepts every state and territory code below, and `registrationState` uses the same vocabulary — so a value you read off a record can be sent straight back as a filter.

| Code | Jurisdiction |
| --- | --- |
| `AL` | Alabama |
| `AK` | Alaska |
| `AZ` | Arizona |
| `AR` | Arkansas |
| `CA` | California |
| `CO` | Colorado |
| `CT` | Connecticut |
| `DE` | Delaware |
| `DC` | District of Columbia |
| `FL` | Florida |
| `GA` | Georgia |
| `HI` | Hawaii |
| `ID` | Idaho |
| `IL` | Illinois |
| `IN` | Indiana |
| `IA` | Iowa |
| `KS` | Kansas |
| `KY` | Kentucky |
| `LA` | Louisiana |
| `ME` | Maine |
| `MD` | Maryland |
| `MA` | Massachusetts |
| `MI` | Michigan |
| `MN` | Minnesota |
| `MS` | Mississippi |
| `MO` | Missouri |
| `MT` | Montana |
| `NE` | Nebraska |
| `NV` | Nevada |
| `NH` | New Hampshire |
| `NJ` | New Jersey |
| `NM` | New Mexico |
| `NY` | New York |
| `NC` | North Carolina |
| `ND` | North Dakota |
| `OH` | Ohio |
| `OK` | Oklahoma |
| `OR` | Oregon |
| `PA` | Pennsylvania |
| `RI` | Rhode Island |
| `SC` | South Carolina |
| `SD` | South Dakota |
| `TN` | Tennessee |
| `TX` | Texas |
| `UT` | Utah |
| `VT` | Vermont |
| `VA` | Virginia |
| `WA` | Washington |
| `WV` | West Virginia |
| `WI` | Wisconsin |
| `WY` | Wyoming |
| `PR` | Puerto Rico (territory) |
| `GU` | Guam (territory) |
| `USVI` | US Virgin Islands (territory) |
| `AS` | American Samoa (territory) |
| `CNMI` | Northern Mariana Islands (territory) |

---

# Clearances

> Record once that a returned person is not the subject you screen, keyed on personRef, and every later search for that subjectId honours it. No extra charge.

HTML: https://offendersearch.app/docs/clearances · Markdown: https://offendersearch.app/docs/clearances.md

## Clearances: dismiss a false-positive match once, per subject

A search for a common name returns people who are not the person you are screening. A clearance records, for one **subject** you screen — a resident, a visitor, an applicant, an employee, identified by your own `subjectId` — that one returned person **is** or **is not** that subject. Every later search that sends the same `subjectId` honours it: a person marked `not_this_person` leaves `records[]` and is listed in `cleared[]`, so the same reviewer is never asked the same question twice.

Clearances are keyed on `personRef` — the durable identifier every record and every `sources[]` entry carries (see [Record identity](https://offendersearch.app/docs/record-object.md)). They are **included in your search price, no extra charge**, and the flow is the same on the [Criminal Search API](https://offendersearch.app/docs/criminal/clearances.md).

> **A clearance applies only to the exact person cleared, never to a name or a date of birth.** The person you cleared was returned precisely because they share a name — and often a birthday — with your subject. Matching a clearance by name would hide the subject’s own record if it ever appeared. So the match is `personRef` only, and a record whose `personRef` cannot be resolved is never suppressed.

## Who uses clearances

| Who | What a clearance does for them |
| --- | --- |
| **Visitor management systems** | A regular visitor who shares a name with a registrant is shown to the desk once, reviewed once and cleared once. Every later sign-in for the same visitor id runs the full search and comes back clean, instead of asking the desk the same question each week. |
| **Skilled nursing and assisted living** | Residents are screened at referral and re-screened on a schedule; standing volunteers the same. A clearance recorded against the resident id is honoured at every re-screen, so the admissions team reviews a look-alike one time. |
| **Home care and staffing** | Caregivers and applicants are screened at hire and again between credentialing cycles. The look-alike cleared at hire stays cleared at the re-check, and a new or changed record still comes through. |
| **Schools, nonprofits and volunteer programs** | Coaches, chaperones and parent helpers who return every season. The person who reviewed the match the first time does not have to be found again the next time. |
| **Tenant screening** | An applicant’s file is one subject. A look-alike reviewed once stays cleared across the checks that file goes through, and the verdict is recorded with who decided and why. |
| **Platforms that screen for many facilities** | Send a `clientId` per facility with every search and every clearance. One facility’s verdicts never reach another facility’s results, even for the same registrant and the same subject id. |

## The clearance flow: search, review, clear, search again

### 1. Search with a subjectId

Send your id for the person being screened as `subjectId` — and, if you screen for more than one facility or client, your id for that client as `clientId`. Nothing else about the request changes. The response gains `counts.clearedSuppressed` and `cleared[]`; on a first search both are empty.

```bash
curl -X POST https://api.offendersearch.app/v1/search \\
  -H "X-API-Key: $OFFENDERSEARCH_KEY" \\
  -H "Content-Type: application/json" \\
  -d '{
        "query": { "firstName": "Jordan", "lastName": "Rivera", "dob": "1988-04-12" },
        "subjectId": "resident-48213",
        "clientId": "facility-07"
      }'
```

```json
{
  "searchId": "srch_9f2c1a7b",
  "status": "complete",
  "counts": { "records": 1, "recordsReturned": 1, "sourcesQueried": 58,
              "sourcesComplete": 58, "sourcesIncomplete": 0, "sourcesSkippedByScope": 0,
              "clearedSuppressed": 0 },
  "cleared": [],
  "records": [
    { "recordId": "rec_6d066763131ebe8c77ea",
      "personRef": "prs_3c9e1f0a7b2d4e6f8a1b",
      "name": { "first": "Jordan", "last": "Rivera", "full": "Jordan Rivera" },
      "dob": "1988-04-12", "matchState": "dob_match", "matchConfidence": 1.0,
      "source": { "jurisdiction": "TX", "personRef": "prs_3c9e1f0a7b2d4e6f8a1b",
                  "recordUrl": "https://…" } }
  ]
}
```

### 2. A person reviews the match

The registrant shares the resident’s name and date of birth, so `matchState` is `dob_match`. A reviewer compares the photograph, the registry’s address and the registry’s own page (`source.recordUrl`) with the resident in front of them and decides. Keep the `searchId`, the `personRef` and the `recordId`: the verdict cites all three.

### 3. Record the verdict

`POST /v1/clearances` with the verdict. `searchId` must be a search in your account’s 14-day history whose stored results contain the `personRef` — the proof that the person was reviewed from a real result. A second verdict for the same subject, client and person replaces the first.

```bash
curl -X POST https://api.offendersearch.app/v1/clearances \\
  -H "X-API-Key: $OFFENDERSEARCH_KEY" \\
  -H "Content-Type: application/json" \\
  -d '{
        "product": "sex_offender",
        "subjectId": "resident-48213",
        "clientId": "facility-07",
        "personRef": "prs_3c9e1f0a7b2d4e6f8a1b",
        "recordId": "rec_6d066763131ebe8c77ea",
        "searchId": "srch_9f2c1a7b",
        "verdict": "not_this_person",
        "reviewer": "admissions-desk",
        "note": "Photo and registry address do not match the resident."
      }'
```

```json
{
  "id": "clr_7d2f41c0a9b3e8f6",
  "product": "sex_offender",
  "verdict": "not_this_person",
  "personRef": "prs_3c9e1f0a7b2d4e6f8a1b",
  "recordId": "rec_6d066763131ebe8c77ea",
  "searchId": "srch_9f2c1a7b",
  "subjectId": "resident-48213",
  "clientId": "facility-07",
  "reviewer": "admissions-desk",
  "note": "Photo and registry address do not match the resident.",
  "createdAt": "2026-10-18T14:02:11+00:00",
  "revokedAt": null,
  "supersedes": null
}
```

### 4. Search again — the cleared person is gone, and accounted for

The next search for the same `subjectId` and `clientId` runs in full, then removes the cleared person. `counts.records` counts what you received; `counts.clearedSuppressed` says how many were removed, and `cleared[]` names each one with the clearance that applied, so an interface can say “1 previously cleared person hidden” and link to the decision.

```json
{
  "searchId": "srch_c41e8d20",
  "status": "complete",
  "counts": { "records": 0, "recordsReturned": 0, "sourcesQueried": 58,
              "sourcesComplete": 58, "sourcesIncomplete": 0, "sourcesSkippedByScope": 0,
              "clearedSuppressed": 1 },
  "cleared": [
    { "personRef": "prs_3c9e1f0a7b2d4e6f8a1b",
      "clearanceId": "clr_7d2f41c0a9b3e8f6",
      "verdict": "not_this_person",
      "clearedAt": "2026-10-18T14:02:11+00:00",
      "recordId": "rec_6d066763131ebe8c77ea" }
  ],
  "records": []
}
```

Send `clearanceMode: "annotate"` to keep cleared people in `records[]` with a `clearance` object attached (for an interface that greys them out), or `"ignore"` to answer as if no clearances existed. A `this_person` verdict never removes a record; it is kept and annotated in every mode. The same three fields work per row on [`POST /v1/batch`](https://offendersearch.app/docs/batch.md).

## What brings a cleared person back

A clearance is a verdict about the person as they were reviewed. When something about them changes, or the match becomes stronger than the one that was cleared, the person returns to `records[]` with `clearance.stale: true` and a `staleReason` — in every mode, and it cannot be turned off. Review the record again and record a new verdict; until you do, the person stays in the results.

| staleReason | What changed since the clearance |
| --- | --- |
| `identity_changed` | The person’s name or date of birth. |
| `offenses_changed` | Their offenses. |
| `status_changed` | Their registration status, tier or absconder / predator flag. |
| `stronger_match` | This search matched them more strongly than the search that was cleared — for example the subject’s date of birth now matches where only the name did. |

```json
{
  "recordId": "rec_6d066763131ebe8c77ea",
  "personRef": "prs_3c9e1f0a7b2d4e6f8a1b",
  "name": { "first": "Jordan", "last": "Rivera", "full": "Jordan Rivera" },
  "dob": "1988-04-12", "matchState": "dob_match",
  "clearance": {
    "clearanceId": "clr_7d2f41c0a9b3e8f6",
    "verdict": "not_this_person",
    "clearedAt": "2026-10-18T14:02:11+00:00",
    "stale": true,
    "staleReason": "offenses_changed"
  }
}
```

## Clearance rules: personRef only, per client, until revoked

- **personRef only.** A clearance names one `personRef` and suppresses only records that carry it. Never a name, never a date of birth. A record whose `personRef` cannot be resolved is never suppressed.
- **Per subject, per client.** A verdict is scoped to the `subjectId` it was recorded for, and to the `clientId` when one was sent. Nothing one client clears affects another client’s results, even for the same person.
- **Stored as hashes.** `subjectId` and `clientId` are kept only as per-account hashes, never as the ids you sent. They are echoed on the request that carried them and are `null` on `GET /v1/clearances/{clearanceId}`.
- **Proof of review.** The `searchId` must be in your 14-day search history and that search must have returned the `personRef` — otherwise `404 search_not_found` or `409 person_not_in_search`.
- **No expiry.** A clearance applies until you revoke it. Re-surfacing is how a changed person comes back; nothing comes back on a timer.
- **Revoke, don’t delete.** `DELETE` sets `revokedAt`; the next search for that subject shows the person again, and the clearance stays readable with `includeRevoked=true`.
- **Scoped to the account.** Clearances survive API key rotation and are shared by every key and dashboard user on the account.
- **Included in your search price, no extra charge.** Nothing on `/v1/clearances` is metered, and a search with a `subjectId` is billed exactly like one without.
- **Additive.** A request without `subjectId` returns exactly what it did before clearances existed — no `cleared` key, no `clearedSuppressed`, no `clearance` on any record.

```bash
curl -X DELETE https://api.offendersearch.app/v1/clearances/clr_7d2f41c0a9b3e8f6 \\
  -H "X-API-Key: $OFFENDERSEARCH_KEY"

{ "id": "clr_7d2f41c0a9b3e8f6", "revokedAt": "2026-11-02T09:15:40+00:00" }
```

## Clearance endpoints

Every route authenticates with the `X-API-Key` header or a dashboard session.

| Method | Path | What it does |
| --- | --- | --- |
| POST | `/v1/clearances` | Record a verdict for one subject and one `personRef`. `201` with the Clearance. |
| GET | `/v1/clearances` | List a subject’s clearances (`subjectId` required; `clientId`, `product`, `includeRevoked` optional). |
| GET | `/v1/clearances/{clearanceId}` | Retrieve one clearance by id. |
| DELETE | `/v1/clearances/{clearanceId}` | Revoke it. Returns `{ id, revokedAt }`. |

The search-side fields — `subjectId`, `clientId` and `clearanceMode` on the request; `cleared[]`, `counts.clearedSuppressed` and the record’s `clearance` on the response — are documented on [Search](https://offendersearch.app/docs/search.md) and [Batch](https://offendersearch.app/docs/batch.md); the objects they carry are defined below.

## POST /v1/clearances — record a verdict: request and response fields

`POST /v1/clearances` · auth: `X-API-Key`

Record that the person behind a `personRef` is (`this_person`) or is not (`not_this_person`) the subject identified by your `subjectId`. The verdict must cite the search that showed the person. A second verdict for the same subject, client and person replaces the first. Included in the search price; nothing here is metered.

### Request

**Body** (application/json)

| Field | Type | Required / default | Description |
| --- | --- | --- | --- |
| `product` | `string` — one of `"sex_offender"`, `"criminal"` | optional · default `"sex_offender"` | The dataset the verdict belongs to: `sex_offender` for a person returned by `POST /v1/search` or `POST /v1/batch`, `criminal` for one returned by `POST /v1/criminal/search`. A criminal `personRef` is scoped to one source, so a criminal clearance clears that source's records for the person — see [criminal clearances](https://offendersearch.app/docs/criminal/clearances). |
| `subjectId` | `string` | required | Your id for the person being screened, 1–128 characters — the same value you will send on later searches for them. Stored only as a per-account hash. Example `"resident-48213"`. |
| `clientId` | `string` | optional | Your facility, tenant or client id, 1–128 characters, when you screen for more than one. A clearance recorded with a `clientId` applies only to searches that send the same one. Stored only as a per-account hash. Example `"facility-07"`. |
| `personRef` | `string` | required | The person the verdict is about — the `personRef` the search returned (`prs_` and 20 hex characters). The verdict applies to this person and no one else, never to a name or a date of birth. Example `"prs_3c9e1f0a7b2d4e6f8a1b"`. |
| `recordId` | `string` | optional | The `recordId` of the result the reviewer looked at, for the audit trail. At most 64 characters. Example `"rec_6d066763131ebe8c77ea"`. |
| `searchId` | `string` | required | The search that showed this person. It must be in this account's 14-day history and its stored results must contain `personRef` — otherwise `404 search_not_found` or `409 person_not_in_search`. Example `"srch_9f2c1a7b"`. |
| `verdict` | `string` — one of `"not_this_person"`, `"this_person"` | required | `not_this_person` — the returned person is someone else; later searches for the subject suppress (or annotate) them. `this_person` — the returned person **is** the subject; later searches keep them and annotate the record so your interface can show the confirmed match. |
| `reviewer` | `string` | optional | Who decided, in your own terms — a user id, a desk, a role. At most 120 characters. Example `"admissions-desk"`. |
| `note` | `string` | optional | Why, in the reviewer's words. At most 500 characters. Example `"Photo and registry address do not match the resident."`. |

### Response

**201** (application/json) — The verdict was recorded and applies to the next search for this subject.

The body is [the `Clearance` object](https://offendersearch.app/docs/clearances#object-clearance). One verdict: the person behind a `personRef` is, or is not, the subject being screened. Returned by every `/v1/clearances` route. `subjectId` and `clientId` are echoed only on the request that carried them (create and list); on `GET /v1/clearances/{clearanceId}` they are `null`, because only a per-account hash of them is stored.

**Errors**

| Status | Code | When |
| --- | --- | --- |
| 401 | — | The `X-API-Key` header is missing or the key is not valid, and no valid dashboard session was sent. |
| 404 | `search_not_found` | `searchId` is not one of this account's searches, or it is older than the 14-day history window and its results are gone. Run the search again and clear from the new result. `detail` is `{code, message}`. |
| 409 | `person_not_in_search` | The search named by `searchId` did not return this `personRef`. A clearance must cite a search that showed the person being cleared. `detail` is `{code, message}`. |
| 422 | — | A field failed validation — an unknown `product` or `verdict`, a `subjectId` or `clientId` outside 1–128 characters, a `personRef` that is not the `prs_` value a search returned, a `reviewer` over 120 or a `note` over 500 characters, or an unknown key. `detail` says which. |

## GET /v1/clearances — list clearances: request and response fields

`GET /v1/clearances` · auth: `X-API-Key`

Every clearance recorded for one `subjectId` (and `clientId`, when you send one), newest first. Active clearances only unless `includeRevoked=true`. The ids you send are hashed before the lookup, so a listing needs the same `subjectId` and `clientId` the verdicts were recorded under.

### Request

**Query parameters**

| Field | Type | Required / default | Description |
| --- | --- | --- | --- |
| `subjectId` | `string` | required | Your id for the subject, as sent when the clearances were recorded. Example `"resident-48213"`. |
| `clientId` | `string` | optional | Your facility, tenant or client id, when the clearances were recorded with one. Example `"facility-07"`. |
| `product` | `string` — one of `"sex_offender"`, `"criminal"` | optional | Restrict to one dataset. Omit for both. |
| `includeRevoked` | `boolean` | optional · default `false` | `true` also returns revoked clearances. Default `false`: active ones only. |

### Response

**200** (application/json) — The subject's clearances, newest first; `[]` when none are recorded.

| Field | Type | Default | Description |
| --- | --- | --- | --- |
| `clearances` | array of [Clearance](https://offendersearch.app/docs/clearances#object-clearance) |  | One Clearance per verdict, with `subjectId` and `clientId` echoed from the query. |

**Errors**

| Status | Code | When |
| --- | --- | --- |
| 401 | — | The `X-API-Key` header is missing or the key is not valid, and no valid dashboard session was sent. |
| 422 | — | `subjectId` is missing or outside 1–128 characters, `clientId` is outside 1–128 characters, or `product` is not `sex_offender` or `criminal`. |

## GET /v1/clearances/{clearanceId} — one clearance: request and response fields

`GET /v1/clearances/{clearanceId}` · auth: `X-API-Key`

One clearance by id — the `clearanceId` a search response's `cleared[]` or `clearance` carries. `subjectId` and `clientId` are `null` on this route: only a per-account hash of them is stored.

### Request

**Path parameters**

| Field | Type | Required / default | Description |
| --- | --- | --- | --- |
| `clearanceId` | `string` | required | The clearance `id` (`clr_…`). Example `"clr_7d2f41c0a9b3e8f6"`. |

### Response

**200** (application/json) — The clearance, revoked or not.

The body is [the `Clearance` object](https://offendersearch.app/docs/clearances#object-clearance). One verdict: the person behind a `personRef` is, or is not, the subject being screened. Returned by every `/v1/clearances` route. `subjectId` and `clientId` are echoed only on the request that carried them (create and list); on `GET /v1/clearances/{clearanceId}` they are `null`, because only a per-account hash of them is stored.

**Errors**

| Status | Code | When |
| --- | --- | --- |
| 401 | — | The `X-API-Key` header is missing or the key is not valid, and no valid dashboard session was sent. |
| 404 | — | No clearance with that id on your account — including another account's clearance id. |

## DELETE /v1/clearances/{clearanceId} — revoke a clearance: request and response fields

`DELETE /v1/clearances/{clearanceId}` · auth: `X-API-Key`

Sets `revokedAt`. The verdict stops applying at once: the next search for that subject shows the person again. The clearance stays readable with `includeRevoked=true`, so the audit trail is not lost.

### Request

**Path parameters**

| Field | Type | Required / default | Description |
| --- | --- | --- | --- |
| `clearanceId` | `string` | required | The clearance `id` (`clr_…`). Example `"clr_7d2f41c0a9b3e8f6"`. |

### Response

**200** (application/json) — The clearance was revoked.

| Field | Type | Default | Description |
| --- | --- | --- | --- |
| `id` | `string` |  | The revoked clearance's `id`. Example `"clr_7d2f41c0a9b3e8f6"`. |
| `revokedAt` | `string (date-time)` |  | When it was revoked — now. |

**Errors**

| Status | Code | When |
| --- | --- | --- |
| 401 | — | The `X-API-Key` header is missing or the key is not valid, and no valid dashboard session was sent. |
| 404 | — | No clearance with that id on your account — including another account's clearance id. |

## The Clearance object — every field on a recorded verdict

One verdict: the person behind a `personRef` is, or is not, the subject being screened. Returned by every `/v1/clearances` route. `subjectId` and `clientId` are echoed only on the request that carried them (create and list); on `GET /v1/clearances/{clearanceId}` they are `null`, because only a per-account hash of them is stored.

Returned or accepted by [`POST /v1/clearances`](https://offendersearch.app/docs/clearances#reference-post-v1-clearances), [`GET /v1/clearances`](https://offendersearch.app/docs/clearances#reference-get-v1-clearances), [`GET /v1/clearances/{clearanceId}`](https://offendersearch.app/docs/clearances#reference-get-v1-clearances-clearanceid).

| Field | Type | Default | Description |
| --- | --- | --- | --- |
| `id` | `string` |  | `clr_` followed by an opaque id. What `GET` and `DELETE /v1/clearances/{clearanceId}` take. Example `"clr_7d2f41c0a9b3e8f6"`. |
| `product` | `string` — one of `"sex_offender"`, `"criminal"` |  | The dataset the verdict belongs to. |
| `verdict` | `string` — one of `"not_this_person"`, `"this_person"` |  | `not_this_person` suppresses (or annotates) the person on later searches for the subject; `this_person` keeps and annotates them. |
| `personRef` | `string` |  | The person the verdict is about. Example `"prs_3c9e1f0a7b2d4e6f8a1b"`. |
| `recordId` | `string` or null |  | The result the reviewer looked at, when one was cited; `null` otherwise. Example `"rec_6d066763131ebe8c77ea"`. |
| `searchId` | `string` |  | The search that showed the person. Example `"srch_9f2c1a7b"`. |
| `subjectId` | `string` or null |  | Echoed from the request that carried it; `null` on `GET /v1/clearances/{clearanceId}`, because only a hash is stored. Example `"resident-48213"`. |
| `clientId` | `string` or null |  | Echoed from the request that carried it; `null` when none was sent, and on `GET /v1/clearances/{clearanceId}`. Example `"facility-07"`. |
| `reviewer` | `string` or null |  | Who decided, as sent; `null` when not sent. |
| `note` | `string` or null |  | The reviewer's note, as sent; `null` when not sent. |
| `createdAt` | `string (date-time)` |  | When the verdict was recorded. This is the `clearedAt` a search response reports. |
| `revokedAt` | `string (date-time)` or null |  | `null` while the clearance applies; set by `DELETE /v1/clearances/{clearanceId}`. A revoked clearance is listed only with `includeRevoked=true`. |
| `supersedes` | `string` or null |  | The id of the clearance this one replaced — a second verdict for the same subject, client and `personRef` supersedes the first. `null` for a first verdict. |

## The ClearedEntry object — one person a clearance hid from this response

One record a `not_this_person` clearance removed from `records[]` for the `subjectId` sent. `cleared[]` carries one of these per suppressed record, so an interface can say how many previously cleared people are hidden and link each to its clearance.

Returned or accepted by [`POST /v1/search`](https://offendersearch.app/docs/search#reference-post-v1-search), [`GET /v1/searches/{searchId}`](https://offendersearch.app/docs/async-and-webhooks#reference-get-v1-searches-searchid), [`POST /v1/search`](https://offendersearch.app/docs/live-evidence#reference-post-v1-search-live-evidence), [`POST /v1/batch`](https://offendersearch.app/docs/batch#reference-post-v1-batch).

| Field | Type | Default | Description |
| --- | --- | --- | --- |
| `personRef` | `string` |  | The cleared person, as the search identified them. Example `"prs_3c9e1f0a7b2d4e6f8a1b"`. |
| `clearanceId` | `string` |  | The clearance that applied. `GET /v1/clearances/{clearanceId}` returns it. Example `"clr_7d2f41c0a9b3e8f6"`. |
| `verdict` | `string` — one of `"not_this_person"` |  | Always `not_this_person`; a `this_person` verdict never removes a record. |
| `clearedAt` | `string (date-time)` |  | When the clearance was recorded. |
| `recordId` | `string` |  | The `recordId` the suppressed record carries in this response's scope, so you can cite or fetch it. Example `"rec_6d066763131ebe8c77ea"`. |

## The RecordClearance object — the clearance attached to a kept record

The clearance that names a record's person, attached as `clearance` when the request carried `subjectId` and the record was kept: in `clearanceMode: "annotate"`, on a `this_person` verdict, or because a cleared person has re-surfaced (`staleReason` set). A record no clearance names carries no `clearance` key.

Returned or accepted by [`POST /v1/search`](https://offendersearch.app/docs/search#reference-post-v1-search), [`GET /v1/searches/{searchId}`](https://offendersearch.app/docs/async-and-webhooks#reference-get-v1-searches-searchid), [`GET /v1/searches/{searchId}/results`](https://offendersearch.app/docs/async-and-webhooks#reference-get-v1-searches-searchid-results), [`POST /v1/search`](https://offendersearch.app/docs/live-evidence#reference-post-v1-search-live-evidence), [`POST /v1/batch`](https://offendersearch.app/docs/batch#reference-post-v1-batch), [`GET /v1/records/{recordId}`](https://offendersearch.app/docs/record-object#reference-get-v1-records-recordid), [`GET /v1/map/records/{markerId}`](https://offendersearch.app/docs/map/open-a-record#reference-get-v1-map-records).

| Field | Type | Default | Description |
| --- | --- | --- | --- |
| `clearanceId` | `string` |  | The clearance. `GET /v1/clearances/{clearanceId}` returns it. Example `"clr_7d2f41c0a9b3e8f6"`. |
| `verdict` | `string` — one of `"not_this_person"`, `"this_person"` |  | The verdict recorded for this person and subject. |
| `clearedAt` | `string (date-time)` |  | When the verdict was recorded. |
| `stale` | `boolean` |  | `true` when this person was cleared as `not_this_person` and is shown anyway, because something about them changed since the clearance or this search matched them more strongly than the search that was cleared. Review the record again and record a new verdict; until you do, the person stays in `records[]`. |
| `staleReason` | `string` or null — one of `"identity_changed"`, `"offenses_changed"`, `"status_changed"`, `"stronger_match"` |  | Why the person re-surfaced. `identity_changed` — their name or date of birth changed. `offenses_changed` — their offenses changed. `status_changed` — their registration status, tier or absconder/predator flag changed. `stronger_match` — this search matched the person more strongly than the search that was cleared (the subject's date of birth now matches where only the name did). `null` when the person has not re-surfaced. |

## Test clearances in the API sandbox

Every clearance endpoint runs on the sandbox with a test key (os_test_…). Search a test name with a subjectId, clear one of the returned people, and search again to see them in cleared[].

- **Sandbox base URL:** `https://sandbox.offendersearch.app`. Not `https://api.offendersearch.app`, which takes live keys only.
- **Test key:** in the dashboard, Developers → API keys (https://offendersearch.app/dashboard/keys) → **Create test key**. Test keys begin `os_test_`; send yours in the `X-API-Key` header.

POST /v1/search with a subjectId

```bash
curl -X POST "https://sandbox.offendersearch.app/v1/search" \
  -H "X-API-Key: $OFFENDERSEARCH_TEST_KEY" \
  -H "Content-Type: application/json" \
  -d '{
      "query": {
        "firstName": "Name",
        "lastName": "Only"
      },
      "subjectId": "visitor-1042",
      "clientId": "school-3"
    }'
```

- Every test name: [Clearances in the API sandbox](https://offendersearch.app/docs/sandbox#clearances)
- Postman collection: https://offendersearch.app/downloads/offendersearch-sandbox.postman_collection.json
- Sex Offender API sandbox: https://offendersearch.app/docs/sandbox.md
- Run any scenario from the browser: the HTML page's "Try it here" explorer (sandbox host and `os_test_` keys only, never billed).

---

# Async search, webhooks & idempotency

> Submit a search and collect it by polling or webhook: POST /v1/searches and GET /v1/searches/{searchId}, every request and response field, and safe retries.

HTML: https://offendersearch.app/docs/async-and-webhooks · Markdown: https://offendersearch.app/docs/async-and-webhooks.md

## Choosing sync or async

Use `POST /v1/search` when a person is waiting on the answer — it is the interactive endpoint and returns in one round trip. Use `POST /v1/searches` for batch and high-volume work: submit the search, then collect the result by polling `GET /v1/searches/{searchId}` or by supplying a `webhookUrl`. Both return the same envelope; a live re-verification of more than two sources is collected through `GET /v1/searches/{searchId}` the same way.

|  | Synchronous | Asynchronous |
| --- | --- | --- |
| Endpoint | `POST /v1/search` | `POST /v1/searches` |
| Shape | One round trip; `elapsedMs` on every response | Submit now, collect when ready |
| Scope | Bounded by `deadlineMs` | Not tied to an open connection; a jurisdiction that does not finish is labelled in `sourceStatus` |
| Delivery | In the response | Poll or webhook |
| Best for | Interactive checks, anything user-facing | Bulk screening, periodic re-screens, backfills, scheduled jobs |

## POST /v1/searches — Asynchronous search — built for batch and high volume

The batch endpoint. Submit the search, get a job id back immediately, and collect the result when it is ready. Built for bulk screening, periodic re-screens, backfills and unattended scheduled jobs.

**Authentication:** `X-API-Key` header.

The async endpoint accepts the same request body as the synchronous search, plus an optional `webhookUrl`. Instead of waiting, it returns `202 Accepted` with a `searchId` and a `resultsUrl` right away and runs the search in the background; when it finishes, every jurisdiction is reported in `sourceStatus`, exactly as on a synchronous search. A `live` block is accepted here but not run: send it to `POST /v1/search`, which runs a live check of more than two registries as a job you poll.

Because you are not holding a connection open, nothing on your side waits on the search — which is what makes this the right endpoint for bulk screening a roster, re-screening a population on a schedule, backfills, and unattended jobs. The search works to the same per-jurisdiction time limits as a synchronous one, and a jurisdiction that does not finish is labelled in `sourceStatus`, never left out silently.

Retrieve results by polling `GET /v1/searches/{searchId}` until `status` is `complete`, or supply a `webhookUrl` and we will POST the finished `SearchResponse` to it — no polling required.

Reach for `POST /v1/search` instead when a person is waiting on the answer: that is the interactive endpoint and it returns in one round trip. Both endpoints return the same envelope and Record schema — the choice is about how you collect the result. A live re-verification of more than two sources is collected through `GET /v1/searches/{searchId}` the same way.

Every accepted request is a new job and is billed as one search, so keep the `searchId` you were given and poll it rather than submitting the same search again. See Idempotency.

### What you can do

- **Built for volume.** Nothing waits on an open connection. Submit many, collect the results as they finish.
- **Webhook or poll.** Get notified via webhookUrl, or poll the results URL on your own schedule.
- **Same query surface.** All query fields, jurisdictions, match and include carry over. A live block is accepted but not run on this endpoint.
- **One job per request.** Each accepted request is its own job and its own search; store the searchId and poll it rather than resubmitting.

### Request

**cURL**

```bash
curl https://api.offendersearch.app/v1/searches \
  -H "X-API-Key: $OFFENDERSEARCH_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "query": { "lastName": "Doe" },
    "jurisdictions": null,
    "webhookUrl": "https://acme.example/hooks/os"
  }'
```

**Node**

```javascript
const res = await fetch("https://api.offendersearch.app/v1/searches", {
  method: "POST",
  headers: {
    "X-API-Key": process.env.OFFENDERSEARCH_KEY,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    query: { lastName: "Doe" },
    jurisdictions: null,
    webhookUrl: "https://acme.example/hooks/os",
  }),
});

const { searchId, resultsUrl, status } = await res.json();
console.log(status, resultsUrl); // "pending", "/v1/searches/srch_9f2a7c"
```

**Python**

```python
import os, requests

resp = requests.post(
    "https://api.offendersearch.app/v1/searches",
    headers={"X-API-Key": os.environ["OFFENDERSEARCH_KEY"]},
    json={
        "query": {"lastName": "Doe"},
        "jurisdictions": None,
        "webhookUrl": "https://acme.example/hooks/os",
    },
)
job = resp.json()
print(job["status"], job["resultsUrl"])
```

### Response

```json
{
  "searchId": "srch_9f2a7c",
  "status": "pending",
  "jurisdictionsQueried": 58,
  "estimatedCompletionSec": 20,
  "resultsUrl": "/v1/searches/srch_9f2a7c"
}
```

Returns 202 Accepted with status "pending"; poll resultsUrl or wait for the webhook.

## Async search API request and response fields

`POST /v1/searches` · auth: `X-API-Key`

Submit a search and collect the result later, by polling or by webhook. Accepts every SearchRequest field plus `webhookUrl`, including a `live` block (the named registries are re-verified live inside the job and billed as on `POST /v1/search`), and returns `202` with a job id immediately.

### Request

**Body** (application/json)

Every field of [the `SearchRequest` object](https://offendersearch.app/docs/search#reference-post-v1-search), plus:

| Field | Type | Required / default | Description |
| --- | --- | --- | --- |
| `webhookUrl` | `string (uri)` or null | optional | A URL to receive the finished result. One `POST` with the same body `GET /v1/searches/{searchId}` returns, sent once with a 10-second timeout and not retried. Poll `resultsUrl` for the authoritative result. Must be an `https://` URL on a public host name or public IP; anything else (a malformed URL, `http://`, `localhost`, a private, loopback or link-local address) is refused with `422`. Redirects are not followed. |

### Response

**202** (application/json) — The job was accepted and is billed as one search. Poll `resultsUrl`.

| Field | Type | Default | Description |
| --- | --- | --- | --- |
| `searchId` | `string` |  | The job id. Poll `GET /v1/searches/{searchId}`. Example `"srch_9f2c1a7b"`. |
| `status` | `string` — one of `"pending"`, `"running"` |  | `pending` on acceptance. |
| `jurisdictionsQueried` | `integer` |  | How many registries the job will search. |
| `estimatedCompletionSec` | `integer` |  | Seconds until the job is expected to finish (20). Example `20`. |
| `resultsUrl` | `string` |  | The path to poll for status and results. Example `"/v1/searches/srch_9f2c1a7b"`. |

**Errors**

| Status | Code | When |
| --- | --- | --- |
| 401 | — | The `X-API-Key` header is missing or the key is not valid. |
| 402 | — | The account has no active subscription and no free-trial searches left. `detail` says which. |
| 402 | — | The request sent `proof` and billing is not enabled on the account. |
| 422 | — | A field is malformed or unrecognised (an unknown jurisdiction code, an unknown `match` value, a filter placed outside `query`), or the query narrows on nothing. `detail` says which. |

## GET /v1/searches/{searchId} — Get a search

Fetch the current status and results of an asynchronous search.

**Authentication:** `X-API-Key` header.

Once the job finishes, returns the same `SearchResponse` the synchronous endpoint returns, with `status` `complete` or `partial`. While it is `pending` or `running`, `records` and `sourceStatus` are empty and `counts.records` is 0; poll again until the status changes.

Poll on your own cadence (a few seconds is typical), or skip polling entirely by supplying a `webhookUrl` on the original request.

### Request

**cURL**

```bash
curl https://api.offendersearch.app/v1/searches/srch_9f2a7c \
  -H "X-API-Key: $OFFENDERSEARCH_KEY"
```

**Node**

```javascript
// Poll until the search is complete.
async function poll(searchId) {
  for (;;) {
    const res = await fetch(
      `https://api.offendersearch.app/v1/searches/${searchId}`,
      { headers: { "X-API-Key": process.env.OFFENDERSEARCH_KEY } },
    );
    const data = await res.json();
    if (data.status === "complete" || data.status === "error") return data;
    await new Promise((r) => setTimeout(r, 2000));
  }
}

const result = await poll("srch_9f2a7c");
console.log(result.counts.records, "records");
```

**Python**

```python
import os, time, requests

def poll(search_id):
    url = f"https://api.offendersearch.app/v1/searches/{search_id}"
    headers = {"X-API-Key": os.environ["OFFENDERSEARCH_KEY"]}
    while True:
        data = requests.get(url, headers=headers).json()
        if data["status"] in ("complete", "error"):
            return data
        time.sleep(2)

result = poll("srch_9f2a7c")
print(result["counts"]["records"], "records")
```

### Response

```json
{
  "searchId": "srch_9f2a7c",
  "status": "complete",
  "elapsedMs": 41230,
  "counts": { "records": 3 },
  "sourceStatus": [ /* … per-jurisdiction status … */ ],
  "records": [ /* … scored, de-duplicated records … */ ]
}
```

Returns 404 if the searchId does not exist. status stays pending or running until the job finishes.

## Get an async search: status and result fields

`GET /v1/searches/{searchId}` · auth: `X-API-Key`

Read an async job's status and, once it has finished, its full result.

### Request

**Path parameters**

| Field | Type | Required / default | Description |
| --- | --- | --- | --- |
| `searchId` | `string` | required | The id returned by `POST /v1/searches` (or by a live search's acknowledgement). Example `"srch_9f2c1a7b"`. |

### Response

**200** (application/json) — When the job has finished, the full search response. While it is `pending` or `running`, a short body: `searchId`, `status`, `counts` (`records`: 0, `sourcesQueried`, `sourcesIncomplete`: 0), `sourceStatus: []`, `records: []` and `proof: {"status": "none"}`. When the job failed: `searchId`, `status: "error"`, `error` and `records: []`.

The body is [the `SearchResponse` object](https://offendersearch.app/docs/search#reference-post-v1-search). The body every sex offender search returns: the matched records, how many registries answered, and a per-registry status for each one.

**Errors**

| Status | Code | When |
| --- | --- | --- |
| 401 | — | The `X-API-Key` header is missing or the key is not valid. |
| 402 | — | The account has no active subscription and no free-trial searches left. `detail` says which. |
| 404 | — | No search with this id on this account (a search run by another account answers the same 404). The body is an [Error](https://offendersearch.app/docs/errors#object-error). |

## Stored search results API: re-open a past search

`GET /v1/searches/{searchId}/results` · auth: `X-API-Key or session`

Re-open a past search on this account and get back exactly the records it returned. The search is not run again and the call is not billed.

### Request

**Path parameters**

| Field | Type | Required / default | Description |
| --- | --- | --- | --- |
| `searchId` | `string` | required | The `searchId` of a search on this account. Example `"srch_9f2c1a7b"`. |

### Response

**200** (application/json) — The stored results.

| Field | Type | Default | Description |
| --- | --- | --- | --- |
| `searchId` | `string` |  | The search's id. |
| `ranAt` | `string (date-time)` |  | When the search ran. |
| `status` | `string` or null |  | The search's `status` when it ran. |
| `query` | `object` |  | The query that was sent, with empty fields removed. |
| `records` | array of [Record](https://offendersearch.app/docs/record-object#record-fields) |  | The records the search returned, as they were returned. |
| `storedCount` | `integer` |  | Records filed with the search. |
| `totalCount` | `integer` |  | Records the search matched. Higher than `storedCount` when the search matched more records than are filed per search. |
| `retentionDays` | `integer` |  | How many days results are kept before they are erased. |

**202** (application/json) — The async search is still running. Poll `GET /v1/searches/{searchId}`; the results are filed here when it completes.

| Field | Type | Default | Description |
| --- | --- | --- | --- |
| `searchId` | `string` |  | The search's id. |
| `status` | `string` — one of `"pending"`, `"running"` |  | The job's status. |
| `detail` | `string` |  | What to do next, as a sentence. |

**Errors**

| Status | Code | When |
| --- | --- | --- |
| 401 | — | The `X-API-Key` header is missing or the key is not valid. |
| 402 | — | The account has no active subscription and no free-trial searches left. `detail` says which. |
| 410 | — | The results are past the retention window and have been erased, or this account has no such search. Run the search again. |

## Webhooks

Supply a `webhookUrl` on an async search and the finished `SearchResponse` is POSTed to it when the search completes. Delivery is **one attempt** with a 10-second timeout: it is not retried and not signed. Treat it as a notification, then confirm the result by fetching `GET /v1/searches/{searchId}` with your API key — that response is the source of truth, and polling it always works even if the webhook never arrives.

```json
{
  "searchId": "srch_9f2a7c",
  "status": "complete",
  "counts": { "records": 3, "sourcesQueried": 58,
              "sourcesComplete": 58, "sourcesIncomplete": 0 },
  "sourceStatus": [],
  "records": []
}
```

Async-search webhooks are unsigned and sent once, so never act on the payload alone: fetch `GET /v1/searches/{searchId}` with your API key to confirm, and keep polling as the fallback. (Monitoring alert webhooks are different: each is signed with the monitor's own secret — see the Monitoring API's Delivery page.)

```javascript
app.post("/hooks/os", express.json(), async (req, res) => {
  res.sendStatus(200);             // acknowledge promptly

  // The webhook is a notification: it is unsigned and sent once.
  // Fetch the search with YOUR key and trust that response instead.
  const { searchId } = req.body;
  const r = await fetch(
    `https://api.offendersearch.app/v1/searches/${searchId}`,
    { headers: { "X-API-Key": process.env.OS_API_KEY } });
  if (r.ok) enqueue(searchId, await r.json());   // de-duplicate on searchId
});
```

## Idempotency

Every request `POST /v1/searches` accepts is a new job, billed as one search at acceptance. The API does not read an idempotency header, so make retries safe on your side: persist the `searchId` from the `202` the moment you receive it, and recover by polling that id rather than submitting the same search again. A dropped connection on the submit itself is the one case this cannot cover: when no `202` arrived, you cannot know whether the job was accepted.

---

# Batch & CSV search

> Run up to 1000 lookups in one call. Post a JSON array, a JSON envelope with batch-wide options, or a text/csv body; results return in order, fault-isolated.

HTML: https://offendersearch.app/docs/batch · Markdown: https://offendersearch.app/docs/batch.md

## One row in, one result out

The batch endpoint is the shape to reach for when you already hold a list: a roster to screen, a CSV export to reconcile, a scheduled re-check of a population. Each row runs through the same engine as `POST /v1/search`, so every row result carries the search’s `status`, `counts` and `warnings`, and records in the same Record schema with their labelled `matchState`. A row carries no `sourceStatus`: its `counts.sourcesIncomplete` and `warnings` say whether it was searched to the end.

- **Three accepted body shapes.** A bare JSON array of `Query` objects, a JSON envelope `{ "queries": [...], ...options }` whose non-`queries` keys apply to every row, or a `text/csv` body whose header row names Query fields.
- **Input order is preserved.** Each result carries its 0-based `index`.
- **Rows are fault-isolated.** A row that fails when it is searched is reported with `status: "error"` in place and never aborts the rest of the batch. A JSON row carrying an unknown field rejects the whole request with `422` before any row runs — CSV columns that are not query fields are ignored instead.
- **1000 rows per call.** A larger batch returns `413`.

**Billing is per search, not per request.** A batch is one HTTP call, but each search in it is metered as one search — a batch of 100 rows is 100 metered searches. A batch runs in **Regular** mode: it reads the continuously-updated corpus, so there is no per-source live charge. Live re-verification is not offered in a batch.

## POST /v1/batch — Batch / CSV search

Run many lookups in one call — row in, row out. Send a JSON array of queries, a JSON envelope with batch-wide options, or a text/csv body. Each row runs through the same engine as /v1/search and results come back in input order.

**Authentication:** `X-API-Key` header.

The batch endpoint provides legacy CSV-batch parity: **one row = one call in, one result out**. Post a JSON array of `Query` objects, a JSON envelope `{ "queries": [...], ...options }` where the non-`queries` keys (`jurisdictions`, `match`, `recordTypes`, `locationScoped`, `include`, `deadlineMs`, `onDeadline`) apply to every row, or a `text/csv` body whose header row names Query fields (`firstName,lastName,state,dob,city,zipcode,address,age,q`).

Rows run with bounded server-side concurrency and results return in the same order you sent them. A row that fails when it is searched is reported with `status: "error"` **in place** — it never aborts the rest of the batch. A JSON row carrying an unknown field is different: the whole request is a `422` before any row runs, exactly as the same row would be on `/v1/search`. The maximum is **1000 rows** per call (a larger batch returns `413`).

**Billing is per search, not per request.** A batch is one HTTP call but each search in it is billed as one search — a batch of 100 rows = 100 metered searches, each at the graduated per-call rate. A batch runs in **Regular** mode: it reads the continuously-updated corpus, so there is no per-source live charge, and live re-verification is not offered in a batch.

For very large or long-running workloads, the asynchronous endpoint is the other batch-shaped option: submit each search and collect it later, without holding a connection open.

### What you can do

- **JSON or CSV.** Post a JSON array, a JSON envelope with batch-wide options, or a text/csv body — whatever your pipeline already produces.
- **Row-in / row-out.** Results return in input order, each tagged with its 0-based index.
- **Fault-isolated.** A row that errors when searched is reported with status:"error" in place and never aborts the batch. A JSON row with an unknown field rejects the whole request with 422.
- **Up to 1000 rows.** One call handles up to 1000 queries; larger batches return 413.

### Request

**cURL**

```bash
# JSON envelope: batch-wide options apply to every row
curl https://api.offendersearch.app/v1/batch \
  -H "X-API-Key: $OFFENDERSEARCH_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "queries": [
      { "firstName": "John", "lastName": "Smith", "state": "FL" },
      { "firstName": "Jane", "lastName": "Doe",   "state": "TX" }
    ],
    "match": "balanced"
  }'

# …or upload a CSV whose header row names Query fields
curl https://api.offendersearch.app/v1/batch \
  -H "X-API-Key: $OFFENDERSEARCH_KEY" \
  -H "Content-Type: text/csv" \
  --data-binary $'firstName,lastName,state\nJohn,Smith,FL\nJane,Doe,TX'
```

**Node**

```javascript
const res = await fetch("https://api.offendersearch.app/v1/batch", {
  method: "POST",
  headers: {
    "X-API-Key": process.env.OFFENDERSEARCH_KEY,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    queries: [
      { firstName: "John", lastName: "Smith", state: "FL" },
      { firstName: "Jane", lastName: "Doe", state: "TX" },
    ],
    match: "balanced",
  }),
});

const { count, results } = await res.json();
// results come back in input order; a failed row is status:"error", never aborts the batch
for (const r of results) console.log(r.index, r.status, r.counts?.records ?? 0);
```

**Python**

```python
import os, requests

resp = requests.post(
    "https://api.offendersearch.app/v1/batch",
    headers={"X-API-Key": os.environ["OFFENDERSEARCH_KEY"]},
    json={
        "queries": [
            {"firstName": "John", "lastName": "Smith", "state": "FL"},
            {"firstName": "Jane", "lastName": "Doe", "state": "TX"},
        ],
        "match": "balanced",
    },
)
data = resp.json()
print(data["count"], "rows")
for r in data["results"]:
    print(r["index"], r["status"], r.get("counts", {}).get("records", 0))
```

### Response

```json
{
  "count": 2,
  "results": [
    { "index": 0, "status": "complete",
      "counts": { "records": 1, "sourcesQueried": 58 /* … */ },
      "warnings": [],
      "records": [ /* … scored, de-duplicated records … */ ] },
    { "index": 1, "status": "complete",
      "counts": { "records": 0, "sourcesQueried": 58 /* … */ },
      "warnings": [], "records": [] }
  ]
}
```

Results are in input order. A failed row is { "index": n, "status": "error", "error": "…" } in place. Returns 413 if the batch exceeds 1000 rows.

## Batch sex offender search API request and response fields

`POST /v1/batch` · auth: `X-API-Key or session`

Run up to 1000 searches in one call, one result per input row, in input order. Each row is billed as one search.

### Request

**Body** (application/json)

Three forms. A JSON array of [Query](https://offendersearch.app/docs/search#object-query) objects; the JSON envelope below, whose options apply to every row; or a `text/csv` body whose header row names Query fields (`firstName,lastName,state,dob,city,zipcode,address,age,q`). An unknown key in a JSON row is a `422`; an unknown CSV column is ignored. A row may also carry `subjectId`, `clientId` and `clearanceMode` beside its Query fields — each row is one subject being screened, and the row's result then honours that subject's [clearances](https://offendersearch.app/docs/clearances) exactly as `POST /v1/search` does.

| Field | Type | Required / default | Description |
| --- | --- | --- | --- |
| `queries` | array of [Query](https://offendersearch.app/docs/search#object-query) | required | The rows, one Query each, at most 1000. |
| `jurisdictions` | `array of string` | optional | Registry codes to search for every row. Omit to search every US registry. |
| `match` | `string` — one of `"strict"`, `"balanced"`, `"broad"` | optional | Name matching for every row; same values as `SearchRequest.match` (default `balanced`). |
| `recordTypes` | `array of string` | optional | Record types for every row; `["sex_offender"]` is the only value. |
| `locationScoped` | `boolean` | optional | Same meaning as `SearchRequest.locationScoped`, for every row. |
| `include` | `array of string` | optional | Accepted for compatibility; `stateData` is on every row's records by default. `exclude: ["stateData"]` drops it batch-wide. |
| `deadlineMs` | `integer` | optional · default `120000` | Per-row time bound in milliseconds, 1000 to 600000. |
| `onDeadline` | `string` — one of `"partial"`, `"error"` | optional · default `"partial"` | What a row does at `deadlineMs`; same values as `SearchRequest.onDeadline`. |

### Response

**200** (application/json) — Every row was attempted. A row that failed carries `status: "error"` in place and does not stop the others.

| Field | Type | Default | Description |
| --- | --- | --- | --- |
| `count` | `integer` |  | Rows processed. |
| `results` | `array of object` |  | One entry per input row, in input order. |
| `results[].index` | `integer` |  | The row's 0-based position in the input. |
| `results[].status` | `string` |  | `complete`, `partial` or `error`, with the same meaning as the search response's `status`. |
| `results[].counts` | `object` |  | The same counts a search response carries, for this row. |
| `results[].counts.records` | `integer` |  | Total matched records for this row. |
| `results[].counts.sourcesQueried` | `integer` |  | Registries queried for this row. |
| `results[].counts.sourcesIncomplete` | `integer` |  | Registries not searched to the end for this row. Check it per row. |
| `results[].counts.sourcesComplete` | `integer` |  | Registries searched to the end for this row. |
| `results[].counts.sourcesSkippedByScope` | `integer` |  | Registries skipped because `locationScoped` narrowed the search. 0 unless `locationScoped` was sent. |
| `results[].counts.recordsReturned` | `integer` |  | Records this row carries. Equal to `records` unless the row was capped. |
| `results[].counts.clearedSuppressed` | `integer` |  | Records a `not_this_person` [clearance](https://offendersearch.app/docs/clearances) removed from this row. Present only when the row sent `subjectId`. |
| `results[].warnings` | `array of string` |  | Sentences naming anything that shortened this row. `[]` when nothing did. A batch row has no `sourceStatus`, so this is its completeness signal with `counts.sourcesIncomplete`. |
| `results[].records` | array of [Record](https://offendersearch.app/docs/record-object#record-fields) |  | The row's matched records. `[]` on an error row. |
| `results[].cleared` | array of [ClearedEntry](https://offendersearch.app/docs/clearances#object-clearedentry) |  | Present only when the row sent `subjectId`: the people a `not_this_person` [clearance](https://offendersearch.app/docs/clearances) removed from this row. `[]` when none were. |
| `results[].error` | `string` |  | Present only when `status` is `error`: why the row failed — the same `detail` that search returns on its own. |

**Errors**

| Status | Code | When |
| --- | --- | --- |
| 401 | — | The `X-API-Key` header is missing or the key is not valid. |
| 402 | — | The account has no active subscription and no free-trial searches left. `detail` says which. |
| 402 | — | A free-trial account sent more rows than it has searches left. |
| 413 | — | More than 1000 rows. |
| 422 | — | The body is not a JSON array, a JSON envelope with a `queries` array, or a CSV with a header row; a JSON row carries an unknown key or a value of the wrong type (`detail` names the row index and the field); or the batch is empty. |

## The CSV form

Post a `text/csv` body whose header row names `Query` fields — `firstName`, `lastName`, `state`, `dob`, `city`, `zipcode`, `address`, `age`, `q`. Every row is a query, and the response is the same JSON envelope as the JSON form.

```bash
curl https://api.offendersearch.app/v1/batch \
  -H "X-API-Key: $OFFENDERSEARCH_KEY" \
  -H "Content-Type: text/csv" \
  --data-binary @roster.csv

# roster.csv
# firstName,lastName,state,dob
# John,Smith,FL,1980-04-12
# Jane,Doe,TX,
```

```json
{
  "count": 2,
  "results": [
    { "index": 0, "status": "complete",
      "counts": { "records": 1, "sourcesQueried": 58,
                  "sourcesComplete": 58, "sourcesIncomplete": 0 },
      "warnings": [],
      "records": [ /* … */ ] },
    { "index": 1, "status": "partial",
      "counts": { "records": 0, "sourcesQueried": 58,
                  "sourcesComplete": 57, "sourcesIncomplete": 1 },
      "warnings": [ "INCOMPLETE SEARCH: 1 of 58 registries could not be searched to completion — …" ],
      "records": [] }
  ]
}
```

**Read each row’s own counts.** Row-level completeness is reported per row, exactly as it is on a single search — row 1 above returned no records, but one jurisdiction did not complete, so it is *not determined* rather than *no match*.

## Batch or async?

|  | Batch | Async |
| --- | --- | --- |
| Unit | Many queries, one call | One query, collected later |
| Delivery | In the response, in input order | Poll (or a one-attempt webhook) |
| Ceiling | 1000 rows per call | One search per job; nothing waits on an open connection |
| Use it for | Rosters, CSV reconciliation, scheduled re-screens | Very broad single searches, unattended jobs |

## Test batch search in the API sandbox

POST /v1/batch runs on the sandbox with a test key (os_test_…). Send the sex offender test names as rows: each row gets the same answer it gets from POST /v1/search, in input order, never billed.

- **Sandbox base URL:** `https://sandbox.offendersearch.app`. Not `https://api.offendersearch.app`, which takes live keys only.
- **Test key:** in the dashboard, Developers → API keys (https://offendersearch.app/dashboard/keys) → **Create test key**. Test keys begin `os_test_`; send yours in the `X-API-Key` header.

POST /v1/batch

```bash
curl -X POST "https://sandbox.offendersearch.app/v1/batch" \
  -H "X-API-Key: $OFFENDERSEARCH_TEST_KEY" \
  -H "Content-Type: application/json" \
  -d '[
      {
        "firstName": "Clear",
        "lastName": "Visitor"
      },
      {
        "firstName": "Exact",
        "lastName": "Match",
        "dob": "1980-01-01"
      },
      {
        "firstName": "Exact",
        "lastName": "Match"
      }
    ]'
```

- Every test name: [Sex offender search test names](https://offendersearch.app/docs/sandbox#sex-offender-test-names)
- Postman collection: https://offendersearch.app/downloads/offendersearch-sandbox.postman_collection.json
- Sex Offender API sandbox: https://offendersearch.app/docs/sandbox.md
- Run any scenario from the browser: the HTML page's "Try it here" explorer (sandbox host and `os_test_` keys only, never billed).

---

# Front-desk visitor screening

> Add a sex offender registry check to front-desk visitor sign-in: what to send from the ID, mapping results to Clear, Review or Match, and the audit trail.

HTML: https://offendersearch.app/docs/front-desk-visitor-screening · Markdown: https://offendersearch.app/docs/front-desk-visitor-screening.md

## Front-desk visitor screening: what to send from the ID

This guide is for teams building a sex offender registry check into a front-desk sign-in: a visitor management product, a school platform, or a district’s own app. The product side of the same workflow is on https://offendersearch.app/visitor-screening-api and https://offendersearch.app/school-visitor-screening-api.

Send three fields from the visitor’s ID: `firstName`, `lastName` and `dob` as `YYYY-MM-DD`. Add your own ids for the visitor (`subjectId`) and for the school or district (`clientId`). Omit `jurisdictions`: the default search covers 58 registries, so a visitor registered in another state is found at the desk as readily as a local one.

```json
{
  "query": { "firstName": "James", "lastName": "Smith", "dob": "1984-03-09" },
  "subjectId": "visitor-1042",
  "clientId": "district-17/school-3"
}
```

## Why date of birth matters in visitor screening

A name alone is not an identity. A common name matches many registrants, and none of them can be told apart from the visitor without more information. With the date of birth, every record whose full date of birth disagrees with the ID is left out, and the records that remain say how their date of birth was checked in `matchState`. With a date of birth, a common name usually returns zero or one person. A record from a registry that publishes only a birth year, an age, or no birth information stays in the answer, labelled `year_match`, `age_match` or `no_dob_age_year`, because it cannot be ruled out. Those are the records your desk reviews.

## Reading a visitor screening result: Clear, Review, Match

Map every response to one of three states. Take the strongest state any record reaches: one Match record makes the whole check a Match.

| State | Rule | What it means at the desk |
| --- | --- | --- |
| Clear | `status` is `"complete"` and `counts.records` is `0`. | No registrant matches the visitor. Continue the sign-in and print the badge. |
| Review | At least one record, and none meets the Match rule: `year_match`, `age_match`, `no_dob_age_year`, a `dob_match` below 0.90, and every record from a search sent without a `dob` (`matchState: null`). | A possible match. A staff member compares the photo and details with the ID before the visitor goes further. |
| Match | At least one record has `matchState: "dob_match"` and `matchConfidence` of 0.90 or higher. | A strong match: the visitor’s full date of birth matches a registrant with the same name. Alert an administrator quietly and follow the site’s protocol. |

`matchConfidence` measures how much identity evidence the record carries: a full date of birth and both names on file score 0.90, and 1.00 when more than one registry holds the person. A `dob_match` record is never capped, so it scores 0.90 or higher whenever both names are on file. But an exact-name record with a date of birth on file also scores 0.90 when you sent no `dob`, and nothing about the visitor was checked. Only `matchState` says the visitor’s date of birth was compared, so the rule reads both.

| matchState on the record | matchConfidence | Desk state |
| --- | --- | --- |
| dob_match, first and last name on file | 0.90 – 1.00 | Match |
| dob_match, a name missing from the record | 0.70 – 0.80 | Review |
| year_match | up to 0.85 | Review |
| age_match | up to 0.70 | Review |
| no_dob_age_year | up to 0.70 | Review |
| null (no dob sent) | up to 1.00 | Review |

Every state is a statement about the registry search, not about the person. A staff member confirms every Review and Match against the ID and the registry photo before anyone acts on it.

## Visitor screening desk UI: what staff see

1. Scan the ID: first name, last name and date of birth.
2. Search: `POST /v1/search` with `subjectId` and `clientId`.
3. Map the answer to Clear, Review or Match. The visitor’s screen shows none of it.
   - **Clear:** print the badge; log the searchId, time and state.
   - **Review:** the visitor waits; staff compare the photo, date of birth and details with the ID. Not this person: record a clearance and print the badge. Cannot rule it out: escalate to an administrator.
   - **Match:** no badge prints; a quiet alert goes to the designated administrator with the photo; the administrator confirms against the ID and follows the written protocol.

Never show a result on a screen the visitor or the line can see. For each candidate the staff screen shows the photo (`images[0].url`) beside the ID photo; name and `dob` (or `birthYear` or `age`); `registrationState` and addresses; how the record matched, in plain words; and the registry’s own page, `source.recordUrl`. Do not deny entry on a Review alone. State laws differ on when a registrant may be on school grounds, so the response to a confirmed match belongs to district policy and counsel.

## Repeat visitors: clearances for visitor screening

Send your stable id for the visitor as `subjectId` on every search. When a reviewer decides a returned person is not that visitor, record it with `POST /v1/clearances` (`verdict: "not_this_person"`, `reviewer`, `note`, and the `searchId`, `personRef` and `recordId`). Later searches with the same `subjectId` and `clientId` remove that person from `records[]`, list them in `cleared[]` and count them in `counts.clearedSuppressed`. A clearance names one `personRef`, never a name or a date of birth; a change to the person brings them back with `clearance.stale: true`. `clearanceMode` is `"suppress"` by default, or `"annotate"` / `"ignore"`. No extra charge, no expiry until revoked. See [Clearances](https://offendersearch.app/docs/clearances.md).

## Visitor screening for platforms serving many schools and districts

- **One account, one key per environment.** Every key on the account can search; separate keys can be rotated or revoked on their own.
- **`clientId` per school or district**, up to 128 printable characters, on every search and every clearance. Clearances are scoped to it, so one district’s decisions never change another’s results. It takes effect alongside a `subjectId`.
- **`subjectId` unique across your platform.** Both ids are stored only as per-account hashes.
- **Usage per school or district.** Usage and the invoice are per account. To report or bill each district, count the `searchId`s you stored against each `clientId`.
- Pre-registered visitors can be screened before the day with [Batch & CSV](https://offendersearch.app/docs/batch.md), which takes the same three fields per row.

## Visitor screening audit trail and data retention

Store one row per check, Clear ones included: the `searchId`; the timestamp from your own clock; the desk state; the `clientId` and `subjectId`; and for Review and Match, each candidate’s `personRef` and `recordId`, who reviewed it, the decision and any clearance `id`.

We keep each search and its results for 14 days. In that window it appears in the dashboard’s search history, a clearance can cite it, and [POST /v1/report](https://offendersearch.app/docs/reports.md) can turn it into a timestamped PDF. After 14 days the stored results are erased, so keep in your own records whatever your retention policy requires.

## Visitor screening speed and registry coverage

A search is designed to be sub-second, and every response carries `elapsedMs` so you can measure it in your own flow. Each search covers 58 registries: the 50 states, DC and the US territories.

## Visitor screening and the FCRA

A visitor check decides who is escorted today. Results from `POST /v1/search` are not a consumer report and may not be used for FCRA-covered decisions. When a result will help decide whether to hire or engage someone, such as a substitute teacher, a coach or a contracted caregiver, that check is a consumer report and runs as an FCRA order through FCRA Partner Access. See the [FCRA API](https://offendersearch.app/docs/fcra.md).

## Visitor screening integration code in Node and Python

A complete minimal integration: search at sign-in, map the answer to Clear, Review or Match, and record a reviewer’s decision as a clearance. It points at the sandbox; set `OFFENDERSEARCH_BASE` and `OFFENDERSEARCH_KEY` to go live.

```javascript
// desk-screening.mjs — Node 18+ (fetch is built in)
const BASE = process.env.OFFENDERSEARCH_BASE ?? 'https://sandbox.offendersearch.app';
const KEY = process.env.OFFENDERSEARCH_KEY;

// A Match is a record whose full date of birth matched the visitor's ID and
// whose first and last name are both on file: matchState "dob_match" scores 0.90+.
const MATCH_MIN_CONFIDENCE = 0.90;

async function call(path, body) {
  const res = await fetch(BASE + path, {
    method: 'POST',
    headers: { 'X-API-Key': KEY, 'Content-Type': 'application/json' },
    body: JSON.stringify(body),
  });
  return res.json();
}

/** Clear | Review | Match for one search response. */
export function deskState(result) {
  if (result.status === 'complete' && result.counts.records === 0) return 'clear';
  const strong = result.records.some(
    (r) => r.matchState === 'dob_match' && r.matchConfidence >= MATCH_MIN_CONFIDENCE,
  );
  return strong ? 'match' : 'review';
}

/** Run at sign-in, after the ID is scanned. Show the result to staff only. */
export async function screenVisitor({ visitorId, schoolId, firstName, lastName, dob }) {
  const result = await call('/v1/search', {
    query: { firstName, lastName, dob },  // dob as YYYY-MM-DD, from the ID
    subjectId: visitorId,                 // your stable id for this visitor
    clientId: schoolId,                   // your id for the school or district
  });
  return {
    state: deskState(result),
    searchId: result.searchId,
    checkedAt: new Date().toISOString(),
    // What the staff screen shows for Review and Match.
    candidates: result.records.map((r) => ({
      personRef: r.personRef,
      recordId: r.recordId,
      name: r.name.full,
      dob: r.dob ?? r.birthYear ?? null,
      age: r.age,
      photo: r.images[0]?.url ?? null,
      registrationState: r.registrationState,
      matchState: r.matchState,
      matchConfidence: r.matchConfidence,
      registryPage: r.source?.recordUrl ?? null,
    })),
  };
}

/** A reviewer decided a returned person is NOT the visitor at the desk. */
export async function clearCandidate({ visitorId, schoolId, searchId, candidate, reviewer, note }) {
  return call('/v1/clearances', {
    product: 'sex_offender',
    subjectId: visitorId,
    clientId: schoolId,
    personRef: candidate.personRef,
    recordId: candidate.recordId,
    searchId,
    verdict: 'not_this_person',
    reviewer,
    note,
  });
}

// Try it against the sandbox: prints "match".
const check = await screenVisitor({
  visitorId: 'visitor-1042', schoolId: 'district-17/school-3',
  firstName: 'Exact', lastName: 'Match', dob: '1980-01-01',
});
console.log(check.state, check.searchId);
```

```python
"""desk_screening.py — Python 3.9+, requests."""
import os
from datetime import datetime, timezone

import requests

BASE = os.environ.get("OFFENDERSEARCH_BASE", "https://sandbox.offendersearch.app")
KEY = os.environ["OFFENDERSEARCH_KEY"]

# A Match is a record whose full date of birth matched the visitor's ID and
# whose first and last name are both on file: matchState "dob_match" scores 0.90+.
MATCH_MIN_CONFIDENCE = 0.90


def _call(path, body):
    r = requests.post(BASE + path, headers={"X-API-Key": KEY}, json=body, timeout=30)
    return r.json()


def desk_state(result):
    """Clear | Review | Match for one search response."""
    if result["status"] == "complete" and result["counts"]["records"] == 0:
        return "clear"
    strong = any(
        r["matchState"] == "dob_match" and r["matchConfidence"] >= MATCH_MIN_CONFIDENCE
        for r in result["records"]
    )
    return "match" if strong else "review"


def screen_visitor(visitor_id, school_id, first_name, last_name, dob):
    """Run at sign-in, after the ID is scanned. Show the result to staff only."""
    result = _call("/v1/search", {
        "query": {"firstName": first_name, "lastName": last_name, "dob": dob},
        "subjectId": visitor_id,   # your stable id for this visitor
        "clientId": school_id,     # your id for the school or district
    })
    return {
        "state": desk_state(result),
        "searchId": result["searchId"],
        "checkedAt": datetime.now(timezone.utc).isoformat(),
        "candidates": [
            {
                "personRef": r["personRef"],
                "recordId": r["recordId"],
                "name": r["name"]["full"],
                "dob": r["dob"] or r["birthYear"],
                "age": r["age"],
                "photo": r["images"][0]["url"] if r["images"] else None,
                "registrationState": r["registrationState"],
                "matchState": r["matchState"],
                "matchConfidence": r["matchConfidence"],
                "registryPage": (r.get("source") or {}).get("recordUrl"),
            }
            for r in result["records"]
        ],
    }


def clear_candidate(visitor_id, school_id, search_id, candidate, reviewer, note):
    """A reviewer decided a returned person is NOT the visitor at the desk."""
    return _call("/v1/clearances", {
        "product": "sex_offender",
        "subjectId": visitor_id,
        "clientId": school_id,
        "personRef": candidate["personRef"],
        "recordId": candidate["recordId"],
        "searchId": search_id,
        "verdict": "not_this_person",
        "reviewer": reviewer,
        "note": note,
    })


if __name__ == "__main__":
    # Try it against the sandbox: prints "match".
    check = screen_visitor("visitor-1042", "district-17/school-3",
                           "Exact", "Match", "1980-01-01")
    print(check["state"], check["searchId"])
```

## Test visitor screening in the API sandbox

Run each of these against `https://sandbox.offendersearch.app` with a test key and check that your app reaches the desk state shown. See [Sandbox & test keys](https://offendersearch.app/docs/sandbox.md) and the Postman collection at https://offendersearch.app/downloads/offendersearch-sandbox.postman_collection.json.

| Send | What comes back | Desk state |
| --- | --- | --- |
| `firstName: Clear · lastName: Visitor` | Clear visitor | Clear |
| `firstName: Exact · lastName: Match · dob: 1980-01-01` | Exact match, date of birth verified | Match |
| `firstName: Exact · lastName: Match` | Exact match, no date of birth sent | Review |
| `firstName: Exact · lastName: Match · dob: 1990-05-05` | Exact match name, different date of birth | Clear |
| `firstName: Name · lastName: Only` | Name only — possible matches | Review |
| `firstName: Alias · lastName: Match` | Matched through an alias | Review |
| `firstName: Out · lastName: State · state: TX` | Registered in another state | Review |
| `firstName: Multi · lastName: State` | One person on two registries | Review |
| `firstName: Homeless · lastName: Registrant` | Homeless registrant | Review |

---

# Sex offender API reference

> Every sex offender API endpoint with its request and response fields, and every object it returns — Record, SourceRef, SourceStatus — each defined once.

HTML: https://offendersearch.app/docs/api-reference · Markdown: https://offendersearch.app/docs/api-reference.md

## How the sex offender API reference is organised

Every endpoint documents what it is sent and what it returns in two tables, next to the guide that explains it. Shared objects — the Record a search returns, the per-registry SourceStatus, the Error body — are defined once and linked from every table that carries them.

Every endpoint here also runs on the [API sandbox](https://offendersearch.app/docs/sandbox.md) with a test key, never billed, against fixed test names. For a worked integration from request to staff screen, see the [front-desk visitor screening guide](https://offendersearch.app/docs/front-desk-visitor-screening.md).

## API reference — every product

Every product has its own reference of endpoints and objects, an enums page and a product-specific OpenAPI document; the whole contract is /openapi.json.

- Sex Offender Search API: 17 endpoints — reference https://offendersearch.app/docs/api-reference · enums https://offendersearch.app/docs/enums · OpenAPI https://offendersearch.app/openapi/sex-offender.json

- Criminal Records API: 9 endpoints — reference https://offendersearch.app/docs/criminal/api-reference · enums https://offendersearch.app/docs/criminal/enums · OpenAPI https://offendersearch.app/openapi/criminal.json

- Monitoring API: 6 endpoints — reference https://offendersearch.app/docs/monitoring/api-reference · enums https://offendersearch.app/docs/monitoring/enums · OpenAPI https://offendersearch.app/openapi/monitoring.json

- FCRA Partner API (approved partners): 67 endpoints — reference https://offendersearch.app/docs/fcra/api-reference · enums https://offendersearch.app/docs/fcra/enums · OpenAPI https://offendersearch.app/openapi/fcra.json

- Offender Map API: 9 endpoints — reference https://offendersearch.app/docs/map/api-reference · enums https://offendersearch.app/docs/map/enums · OpenAPI https://offendersearch.app/openapi/map.json

Dashboard-only routes (account, keys, usage, billing, team, BAA) use a signed-in session and are not part of the public API.

## Sex offender API endpoints — request and response fields

Each endpoint links to its reference block: a Request table (headers, path, query and body fields, with type, required and default) and a Response table (every field, with type and when it is null).

| Endpoint | What it does |
| --- | --- |
| [`POST /v1/search`](https://offendersearch.app/docs/search#reference-post-v1-search) | **Search.** Search every US sex offender registry in one call. Send a SearchRequest; get back one de-duplicated, scored result set with a status for every registry searched. |
| [`POST /v1/searches`](https://offendersearch.app/docs/async-and-webhooks#reference-post-v1-searches) | **Async search.** Submit a search and collect the result later, by polling or by webhook. Accepts every SearchRequest field plus `webhookUrl`, including a `live` block (the named registries are re-verified live inside the job and billed as on `POST /v1/search`), and returns `202` with a job id immediately. |
| [`GET /v1/searches/{searchId}`](https://offendersearch.app/docs/async-and-webhooks#reference-get-v1-searches-searchid) | **Get a search.** Read an async job's status and, once it has finished, its full result. |
| [`GET /v1/searches/{searchId}/results`](https://offendersearch.app/docs/async-and-webhooks#reference-get-v1-searches-searchid-results) | **Stored search results.** Re-open a past search on this account and get back exactly the records it returned. The search is not run again and the call is not billed. |
| [`POST /v1/search`](https://offendersearch.app/docs/live-evidence#reference-post-v1-search-live-evidence) | **Start a live evidence search.** The ordinary `POST /v1/search`, with `"evidence": "pdf"` added to the `live` block. The registries named in `live.jurisdictions` (up to 20) are the ones printed. The live check runs as usual, so the records come back exactly as `POST /v1/search` returns them, and each named registry's own public website is printed to one PDF behind a cover page. With the field the search always answers `202`; collect the result from `GET /v1/searches/{searchId}`. Without it, nothing changes. |
| [`GET /v1/searches/{searchId}`](https://offendersearch.app/docs/live-evidence#reference-get-v1-searches-searchid-live-evidence) | **Poll a live evidence search.** The same poll as any async search. For a live evidence search it reads the job's status and, once it has finished, the full search response plus `evidence[]`, one entry per registry named in `live.jurisdictions`. |
| [`GET /v1/searches/{searchId}/evidence/{jurisdiction}.pdf`](https://offendersearch.app/docs/live-evidence#reference-get-v1-searches-searchid-evidence-jurisdiction-pdf) | **Download an evidence document.** Download one registry's live evidence document — the registry's own public website, printed as shown behind a cover page. The path is the `downloadUrl` of the matching `evidence[]` entry. Not billed: the document was billed when it was produced. |
| [`POST /v1/batch`](https://offendersearch.app/docs/batch#reference-post-v1-batch) | **Batch search.** Run up to 1000 searches in one call, one result per input row, in input order. Each row is billed as one search. |
| [`POST /v1/report`](https://offendersearch.app/docs/reports#reference-post-v1-report) | **Verification report.** One consolidated PDF for a search you already ran, with a source citation on every record. The search's recorded criteria are run again when you request it. |
| [`POST /v1/searches/{searchId}/proof`](https://offendersearch.app/docs/reports#reference-post-v1-searches-searchid-proof) | **Proof documents.** Render per-registry proof documents for a search you already ran. Needs billing on the account. |
| [`GET /v1/proof-docs/{token}`](https://offendersearch.app/docs/reports#reference-get-v1-proof-docs-token) | **Fetch a proof document.** Download one rendered proof document by the token in its `documents[].url`. |
| [`GET /v1/records/{recordId}`](https://offendersearch.app/docs/record-object#reference-get-v1-records-recordid) | **Get a record.** Fetch one Record by the `recordId` or the registry `uuid` a search returned. A `recordId` resolves while the search that returned it is retained (14 days). |
| [`GET /v1/sources`](https://offendersearch.app/docs/freshness#reference-get-v1-sources) | **List sources.** The coverage catalog: every registry the API searches, by code, with its coverage and health. No API key required. |
| [`POST /v1/clearances`](https://offendersearch.app/docs/clearances#reference-post-v1-clearances) | **Record a clearance.** Record that the person behind a `personRef` is (`this_person`) or is not (`not_this_person`) the subject identified by your `subjectId`. The verdict must cite the search that showed the person. A second verdict for the same subject, client and person replaces the first. Included in the search price; nothing here is metered. |
| [`GET /v1/clearances`](https://offendersearch.app/docs/clearances#reference-get-v1-clearances) | **List a subject's clearances.** Every clearance recorded for one `subjectId` (and `clientId`, when you send one), newest first. Active clearances only unless `includeRevoked=true`. The ids you send are hashed before the lookup, so a listing needs the same `subjectId` and `clientId` the verdicts were recorded under. |
| [`GET /v1/clearances/{clearanceId}`](https://offendersearch.app/docs/clearances#reference-get-v1-clearances-clearanceid) | **Retrieve a clearance.** One clearance by id — the `clearanceId` a search response's `cleared[]` or `clearance` carries. `subjectId` and `clientId` are `null` on this route: only a per-account hash of them is stored. |
| [`DELETE /v1/clearances/{clearanceId}`](https://offendersearch.app/docs/clearances#reference-delete-v1-clearances-clearanceid) | **Revoke a clearance.** Sets `revokedAt`. The verdict stops applying at once: the next search for that subject shows the person again. The clearance stays readable with `includeRevoked=true`, so the audit trail is not lost. |

## Sex offender API objects — Record, SourceRef, SourceStatus and more

Each object is defined once, on the page linked here. Wherever an endpoint or another object carries it, the type links back to that one definition.

| Object | What it is |
| --- | --- |
| [`Query`](https://offendersearch.app/docs/search#object-query) | Who or where to search for. Every field is optional; send what you know. A name, a date of birth or age, or a location narrows the search, and a query that narrows on nothing is refused with a `422` rather than answered with a partial list. |
| [`LiveBlock`](https://offendersearch.app/docs/freshness#object-liveblock) | Asks for named registries to be re-checked at query time (Live verification). Omit it for the Regular answer. Send `jurisdictions` or `scope`, not both. Add `evidence: "pdf"` to also receive each named registry's own page as a PDF. |
| [`SourceStatus`](https://offendersearch.app/docs/result-completeness#object-sourcestatus) | One registry's outcome within a search. Each registry the search touched has one entry in `sourceStatus[]`, so coverage is stated per response rather than assumed. |
| [`LiveUsage`](https://offendersearch.app/docs/freshness#object-liveusage) | The live-check charge summary. Present only on the result of a search that carried a `live` block — the inline response, or the polled result of a live job; its presence is the signal that the answer was re-verified live. |
| [`MeterEvent`](https://offendersearch.app/docs/freshness#object-meterevent) | One billable unit behind a live result. Present only on a live result, in `meterEvents[]`. |
| [`EvidenceLiveUsage`](https://offendersearch.app/docs/live-evidence#object-evidenceliveusage) | The `usage` block of a live evidence search: every LiveUsage field — the live check is billed exactly as on the main API — plus the evidence documents. |
| [`EvidenceDocument`](https://offendersearch.app/docs/live-evidence#object-evidencedocument) | One registry's live evidence document: the registry's own public website, printed as shown to a PDF behind a cover page. One entry per registry named in `live.jurisdictions`, in `evidence[]`. A `complete` document carries the capture and download fields; an `incomplete` one carries `incompleteReason` and `detail` and is never billed. |
| [`ProofRequest`](https://offendersearch.app/docs/reports#object-proofrequest) | Asks for per-registry proof documents: the registries to render and the format. Billing must be enabled on the account. Each rendered document is billed as one PDF, at the same rate as a verification report. |
| [`ProofBundle`](https://offendersearch.app/docs/reports#object-proofbundle) | The proof documents rendered for a search. `{"status": "none"}` when no proof was requested. |
| [`Record`](https://offendersearch.app/docs/record-object#record-fields) | One registrant, normalized to the same shape across every US registry. Every key is present on every record; an empty value is `""`, `[]` or `null` as stated per field, never a missing key. |
| [`Name`](https://offendersearch.app/docs/record-object#object-name) | A person's name as the registry publishes it, split into parts. Each part is `""` when the registry does not publish it. |
| [`Address`](https://offendersearch.app/docs/record-object#object-address) | One published address. A record carries every address the registry publishes, each typed. |
| [`Offense`](https://offendersearch.app/docs/record-object#object-offense) | One offense as the registry publishes it. Every field is present; a field the registry does not publish is `""` (or `null` for `federal`). Dates are ISO-8601, at the precision the registry published. |
| [`SourceRef`](https://offendersearch.app/docs/record-object#object-sourceref) | Where a record came from: the registry, its own link to the registrant, and three timestamps. `source` is the registry that supplied the record's top-level values; `sources[]` lists every registry that holds the person. |
| [`StateData`](https://offendersearch.app/docs/record-object#object-statedata) | The extended per-state detail. Returned only when the request sends `include: ["stateData"]`; otherwise `stateData` is `null` and `omittedFields` names it. Each field is `""`, `[]` or `null` when the registry does not publish it. |
| [`Error`](https://offendersearch.app/docs/errors#object-error) | The error body. `detail` is a sentence you can log or show; the HTTP status is the value to branch on. |
| [`RateLimitError`](https://offendersearch.app/docs/errors#object-ratelimiterror) | The `429 Too Many Requests` body. The `Retry-After` header carries the same wait as `detail.retryAfterSeconds`. |
| [`Clearance`](https://offendersearch.app/docs/clearances#object-clearance) | One verdict: the person behind a `personRef` is, or is not, the subject being screened. Returned by every `/v1/clearances` route. `subjectId` and `clientId` are echoed only on the request that carried them (create and list); on `GET /v1/clearances/{clearanceId}` they are `null`, because only a per-account hash of them is stored. |
| [`ClearedEntry`](https://offendersearch.app/docs/clearances#object-clearedentry) | One record a `not_this_person` clearance removed from `records[]` for the `subjectId` sent. `cleared[]` carries one of these per suppressed record, so an interface can say how many previously cleared people are hidden and link each to its clearance. |
| [`RecordClearance`](https://offendersearch.app/docs/clearances#object-recordclearance) | The clearance that names a record's person, attached as `clearance` when the request carried `subjectId` and the record was kept: in `clearanceMode: "annotate"`, on a `this_person` verdict, or because a cleared person has re-surfaced (`staleReason` set). A record no clearance names carries no `clearance` key. |

## Test the sex offender API endpoints in the sandbox

Every endpoint in this reference also runs on the sandbox with a test key (os_test_…): the same paths, request fields and response shapes, against fixed test names, never billed.

- **Sandbox base URL:** `https://sandbox.offendersearch.app`. Not `https://api.offendersearch.app`, which takes live keys only.
- **Test key:** in the dashboard, Developers → API keys (https://offendersearch.app/dashboard/keys) → **Create test key**. Test keys begin `os_test_`; send yours in the `X-API-Key` header.

POST /v1/search

```bash
curl -X POST "https://sandbox.offendersearch.app/v1/search" \
  -H "X-API-Key: $OFFENDERSEARCH_TEST_KEY" \
  -H "Content-Type: application/json" \
  -d '{
      "query": {
        "firstName": "Exact",
        "lastName": "Match",
        "dob": "1980-01-01"
      }
    }'
```

- Every test name: [Other sandbox endpoints](https://offendersearch.app/docs/sandbox#other-endpoints)
- Postman collection: https://offendersearch.app/downloads/offendersearch-sandbox.postman_collection.json
- Sex Offender API sandbox: https://offendersearch.app/docs/sandbox.md
- Run any scenario from the browser: the HTML page's "Try it here" explorer (sandbox host and `os_test_` keys only, never billed).

---

# The Record object

> One normalized 37-key record across 58 jurisdictions: identity, addresses, offense, stateData, flags, images and per-source provenance. Every field explained.

HTML: https://offendersearch.app/docs/record-object · Markdown: https://offendersearch.app/docs/record-object.md

## One schema across 58 jurisdictions

Every match in a search response is a normalized Record — 37 top-level keys, with nested `name`, `addresses[]`, `offense` and `offenses[]`, the 36-field extensive `stateData` block, and per-source provenance. It is a strict superset of the legacy record shape plus scoring, verification, and provenance fields. The same schema is returned by `/v1/search` and by `/v1/records/{id}`, so one type definition covers the whole API.

## sources[] — which jurisdictions is this person on?

A person can appear on more than one registry: registered in one state, working in another, and listed federally as well. They come back as one record, not three — and `sources[]` names every jurisdiction that record was built from, one entry per jurisdiction, de-duplicated.

| Key | What it holds |
| --- | --- |
| `jurisdiction` | The jurisdiction’s code (`IL`, `CNMI`, `TRIBAL`…) — the same vocabulary `jurisdictions` accepts. |
| `registryName` | The registry’s own name, in full, as that jurisdiction publishes it. This is the name to show a user or print in a report — the specimen values in the payloads below are placeholders, not the strings any particular registry returns. |
| `recordUrl` | That jurisdiction’s own link to this registrant. `""` where the jurisdiction publishes no addressable page per registrant. |
| `recordedAt` / `lastCheckedAt` | When this jurisdiction’s copy of the record was first recorded, and when it was last confirmed. |
| `sourceUpdatedAt` | The date the jurisdiction itself states it last changed the record; `null` where none is published. |

`source` (singular) is whichever entry supplied the top-level values; it always appears in `sources[]` too. Which of the three identifiers on a record to store is the subject of the next section.

## Record identity

A record carries three identifiers, and each answers a different question. Read them as a set and store the one that matches the question you will ask later.

| Field | What it identifies |
| --- | --- |
| `personRef` | **The person behind a listing, within one registry** — `prs_` and 20 hex characters. It stays the same when a registry republishes the listing under a new number, so it is the value to store when you want to recognise the same person next time: a diff between two runs, a roster re-screen, a monitor. Every entry in `sources[]` carries its own `personRef`; the top-level one belongs to `source`. |
| `recordId` | **This merged result, for this query** — `rec_` and 20 hex characters. It is what `GET /v1/records/{recordId}` takes, and it is the handle to cite when you mean a specific result: a dispute, a report, a line in an audit file. It describes the merge that produced the record, so the same person can carry a different `recordId` on a state-scoped search and on a search of every US registry. Keep it for citing; do not key a person on it. |
| `sources[].recordUrl` | **A link for a person to follow** — the registry’s own page, so a reviewer can verify the entry at the source. On some registries it is a registry-wide page rather than the registrant’s own, and it is `""` where the registry publishes no page per registrant. It is not a key: do not de-duplicate or diff on it. |

**Store `personRef` with its `jurisdiction` to recognise the same person next time.** Keep `recordId` to cite a specific result, and show `recordUrl` to whoever needs to check the registry’s page. Some registries re-issue the number a listing is published under; a search never returns the same registrant twice from one registry, the superseded number still resolves on `GET /v1/records/{recordId}`, and `personRef` does not change.

`personRef` is also what a clearance names: tell us once that a returned person is not the subject you are screening, and every later search for that subject honours it, at no extra charge. See [Clearances](https://offendersearch.app/docs/clearances.md).

## Reading empty values

**No key is ever omitted.** Every top-level key is present on every record, on every endpoint, in every mode — so you test the value, never for key existence. There are three empty values and they mean different things:

| Value | Meaning |
| --- | --- |
| `""` | No value is held for this field on this record. That is a property of the jurisdiction — either it publishes no such field, or it publishes one and this registrant has none recorded. |
| `null` | Not known or not applicable; the precise meaning is per-field. On `flags.absconder` / `flags.predator` it means the jurisdiction does not publish it — which is not `false`. |
| `[]` | No items of this kind are held (no aliases, no addresses) — same reading as `""`, plus a third case on the array fields. |

Read `""` as “no value on file for this field”, never as a statement about the person. Jurisdictions differ in which fields they publish at all, so `marks: ""` means either that the jurisdiction publishes no such field, or that it publishes one and this registrant has none recorded.

**The array fields carry a third case: the jurisdiction does not publish that category for anybody.** `stateData.vehicles`, `stateData.professionalLicenses` and the non-residence entries of `addresses[]` return `[]` when the registrant genuinely has none *and* when that jurisdiction never publishes the category. Read `[]` as “none known”, never as “none exists”. Vehicles are published by only some jurisdictions.

**Nothing is held back by default.** `stateData` is populated on every record, like `offenses` and `images`, so an empty value is a fact about the registrant. The one way to get a `null` that is not a fact is to ask for a lighter payload with `exclude: ["stateData"]` — the response then lists it in `omittedFields`, so you never have to guess which case you are in.

## Types and formats to key your parser on

`age` is a **string**, not a number. `addresses[].type` is an **open vocabulary** — beyond `residence`, `employment` and `school` you will also see `last_known` (Minnesota) and `other`, so always have a default branch. Every date field is **ISO-8601**.

**Date format, as of the 2026-08-04 contract revision.** The four `offense` date fields and the five `stateData` ones are ISO-8601. A partial date stays partial — a jurisdiction that publishes only a month or a year gives you `"1998-11"` or `"1998"`, and the companion `datePrecision` object names the precision for every date key. Nothing is discarded: where a jurisdiction publishes something that is not a date, the field is `""` and its literal text is kept in `datesAsPublished`.

**`dob` shape, as of the 2026-08-06 contract revision.** `dob` is guaranteed to be a full `YYYY-MM-DD` date or `null`. Where a jurisdiction publishes only a birth year, `dob` is `null` and the year is in the integer field `birthYear`. If you have persisted `-01-01` birthdays saved from this API, re-fetch those records: the ones whose `dobPrecision` is `"year"` now return `dob: null` with the year in `birthYear`, and the ones whose `dobPrecision` is `"exact"` are real 1 January birthdays and are unchanged.

There is no date filter on the `offense` or `stateData` dates — `dob` is the one date you can narrow a query on, alongside the `createdAt*` / `updatedAt*` provenance ranges.

## Field reference — every field on the sex offender Record object

One registrant, normalized to the same shape across every US registry. Every key is present on every record; an empty value is `""`, `[]` or `null` as stated per field, never a missing key.

Returned or accepted by [`POST /v1/search`](https://offendersearch.app/docs/search#reference-post-v1-search), [`GET /v1/searches/{searchId}`](https://offendersearch.app/docs/async-and-webhooks#reference-get-v1-searches-searchid), [`GET /v1/searches/{searchId}/results`](https://offendersearch.app/docs/async-and-webhooks#reference-get-v1-searches-searchid-results), [`POST /v1/search`](https://offendersearch.app/docs/live-evidence#reference-post-v1-search-live-evidence), [`POST /v1/batch`](https://offendersearch.app/docs/batch#reference-post-v1-batch), [`GET /v1/records/{recordId}`](https://offendersearch.app/docs/record-object#reference-get-v1-records-recordid), [`GET /v1/map/records/{markerId}`](https://offendersearch.app/docs/map/open-a-record#reference-get-v1-map-records).

| Field | Type | Default | Description |
| --- | --- | --- | --- |
| `recordId` | `string` |  | The handle for this result: `rec_` and 20 hex characters. Use it with `GET /v1/records/{recordId}`, and cite it when you mean a specific result (a dispute, a report). It identifies this merged result, so it changes when the query scope changes which registries merge into the person; do not key a person on it. Store `personRef` with its `jurisdiction` for that. A registry identifier that a registry has since replaced still resolves on `GET /v1/records/{recordId}` to the person's current record. Example `"rec_ab12cd34ef56gh78ij90"`. |
| `personRef` | `string` |  | The person behind this listing within the registry named in `source`: `prs_` and 20 hex characters. It stays the same when that registry republishes the listing under a new number, so it is the value to store to recognise the same person next time. Each `sources[]` entry carries its own `personRef`. Example `"prs_3c9e1f0a7b2d4e6f8a1b"`. |
| `uuid` | `string` |  | The registry's own id for the person, verbatim; `""` when the registry publishes none. Unique only together with `source.jurisdiction`. Example `"IL:X24A0926"`. |
| `recordType` | `string` — one of `"sex_offender"` | default `"sex_offender"` | Always `sex_offender` on this endpoint. |
| `matchConfidence` | `number` or null |  | A 0–1 score of how much identity evidence supports the match. Widened name matches are capped (a nickname at 0.75; an initial, prefix, typo or middle-name match at 0.60), so a widened match never reads as certain. Branch on `matchState` for date-of-birth confirmation. `null` when unscored. |
| `matchBasis` | `array of string` |  | Why the record is in the result. Tokens shaped `field:strategy` (`lastName:exact`, `firstName:nickname`, `alias:prefix`) are the match reasons. Bare `lastName`, `firstName` and `dob` say only that the record has that field. `matchDetail` carries the same facts already separated. |
| `matchDetail` | `object` |  | The same information as `matchBasis`, split into its parts. |
| `matchDetail.strategies` | `object` |  | How each name field matched, as `{field: strategy}`. Keys are `lastName`, `firstName` and, when an alias matched, `alias`. Example `{"lastName":"exact","firstName":"nickname"}`. |
| `matchDetail.fieldsPresent` | `array of string` |  | Identity fields the record carries (`lastName`, `firstName`, `dob`). Example `["lastName","firstName","dob"]`. |
| `matchDetail.signals` | `array of string` — one of `"matchedLegalName"`, `"matchedAlias"`, `"matchedMiddleName"`, `"unverifiable"`, `"linkedByRegistryId"` |  | Facts about the match as a whole: `matchedLegalName`, `matchedAlias`, `matchedMiddleName` (your given name is the person's middle name), `unverifiable` (no birth data to check). `linkedByRegistryId`: the record was pulled in through a registry id that links it to a matched record rather than by its own name. |
| `matchDetail.matchedNameType` | `string` or null — one of `"legal"`, `"alias"` |  | `legal` or `alias`; `null` when no name was queried. |
| `matchDetail.verification` | `string` or null |  | The `dobVerification` token; `null` when no `dob` or `age` was queried. |
| `matchDetail.other` | `array of string` |  | Present only when the record carries a match token outside the vocabularies above, so no token is dropped. |
| `matchedName` | `object` or null |  | Which name matched your query and whether it was the registered name or an alias. `null` when the query carried no name. |
| `matchedName.value` | `string` |  | The name string that matched. |
| `matchedName.type` | `string` — one of `"legal"`, `"alias"` |  | `legal` for the registered name, `alias` for one of the record's aliases. |
| `name` | [Name](https://offendersearch.app/docs/record-object#object-name) |  | The registered name. See the Name object. |
| `aliases` | `array of string` |  | Other names the registry publishes for the person, verbatim. Shapes vary (`SURNAME, GIVEN` and `Given Surname` both occur), so do not parse positionally. `[]` when the registry publishes none for the person. |
| `nicknames` | `array of string` |  | Nickname equivalents of `name.first` from our fixed given-name table (`Robert` gives `Bob`, `Bobby`, `Rob`…). Computed by OffenderSearch for name recall; not registry data. `[]` when the name has none. Example `["john","johnny","jack"]`. |
| `dob` | `string (date)` or null |  | Date of birth as a full `YYYY-MM-DD` date, or `null`. Never a year alone and never a partial date. `null` when the registry publishes only a year (in `birthYear`) or only an age (in `age`); `dobPrecision` says which. |
| `birthYear` | `integer` or null |  | Year of birth as an integer whenever the registry published a full date or a year. Never derived from an age. `null` when neither was published. Example `1976`. |
| `dobPrecision` | `string` — one of `"exact"`, `"year"`, `"year_month"`, `"unknown"` |  | How much of the birth date the registry published. `exact`: a full date, in `dob`. `year`: a year only, in `birthYear`, and `dob` is `null`. `unknown`: neither; read `age`. `year_month` is reserved and not currently emitted. |
| `age` | `string` |  | Age in years as a string (`"58"`), as published. `""` when the registry publishes no age. |
| `sex` | `string` |  | Sex as the registry publishes it (`Male`, `M`). Not normalized across registries. `""` when not published. |
| `race` | `string` |  | Race as the registry publishes it. Not normalized. Where a registry publishes one column for race and ethnicity, Hispanic values are in `ethnicity` and the rest in `race`, so read the two together. `""` when not published. |
| `ethnicity` | `string` |  | Ethnicity as the registry publishes it (`Hispanic`, `Non-Hispanic`). Not normalized. `""` when not published. |
| `height` | `string` |  | Height as published, with the registry's own format (`5'10''`, `510`). `""` when not published. |
| `weight` | `string` |  | Weight as published (`165lbs`). `""` when not published. |
| `eyeColor` | `string` |  | Eye color as published. `""` when not published. |
| `hairColor` | `string` |  | Hair color as published. `""` when not published. |
| `marks` | `string` |  | Scars, marks and tattoos as the registry records them, free text. `""` when the registry publishes none for the person. Example `"Tattooed Arm, left upper; Scar on Chest; Pierced ear, left"`. |
| `addresses` | array of [Address](https://offendersearch.app/docs/record-object#object-address) |  | Every address the registry publishes for the person, each typed (`residence`, `employment`, `school`…). `[]` when none is published. See the Address object. |
| `registrationState` | `string` |  | The state or territory whose registry holds the person — not where they live. In the same vocabulary `query.state` accepts. `""` when the holding registry is not a state registry (a tribal registry, for example); `source.jurisdiction` then carries its code. Example `"FL"`. |
| `addressStates` | `array of string` |  | Every distinct state in `addresses[]`, in first-seen order. A person can have addresses in several states. `[]` when no published address carries a state. Example `["FL","GA"]`. |
| `offense` | [Offense](https://offendersearch.app/docs/record-object#object-offense) |  | The primary offense; the same object as `offenses[0]`. Always an object, never `null`. See the Offense object. |
| `offenses` | array of [Offense](https://offendersearch.app/docs/record-object#object-offense) |  | Every published offense, the primary one first. Returned on every record. |
| `stateData` | [StateData](https://offendersearch.app/docs/record-object#object-statedata) or null |  | Extended per-state detail, populated on every record by default. `null` only when the request sent `exclude: ["stateData"]` (then listed in `omittedFields`) or when the registry publishes none of it. See the StateData object. |
| `flags` | `object` |  | Registry designations. Each is `true` or `false` when the registry publishes it and `null` when it does not — `null` is not `false`. |
| `flags.absconder` | `boolean` or null |  | `true` when the registry reports the person as an absconder; `false` when it reports they are not; `null` when it does not publish this. |
| `flags.predator` | `boolean` or null |  | `true` when the registry designates the person a predator; `false` when it reports they are not; `null` when it does not publish this. |
| `housingStatus` | `string` or null — one of `"homeless"`, `"incarcerated"`, `"housed"` |  | Whether the registrant is housed, homeless or incarcerated, normalized from however the registry states it. `null` when the registry states none of these. |
| `images` | `array of object` |  | Photos the registry publishes. `[]` when the registry publishes none. Returned on every record. |
| `images[].url` | `string (uri)` |  | The photo URL. A photo we host (`https://photos.offendersearch.app/v1/media/…`) is signed: it loads in a plain `<img>` tag with no API key, for at least 7 days and any number of loads. Use it exactly as returned; after it expires, search again for a fresh link or fetch the bare URL with your `X-API-Key`. |
| `source` | [SourceRef](https://offendersearch.app/docs/record-object#object-sourceref) or null |  | The registry that supplied this record's top-level values. Always also present in `sources[]`. See the SourceRef object. |
| `sources` | array of [SourceRef](https://offendersearch.app/docs/record-object#object-sourceref) |  | Every registry that holds this person, one entry each, each with its own link to the registrant. More than one entry is cross-registry corroboration. `sources[].recordUrl` with its `jurisdiction` is the durable key to store for a person. |
| `matchState` | `string` or null — one of `"dob_match"`, `"year_match"`, `"age_match"`, `"no_dob_age_year"`, `"age_mismatch"`, `"dob_near_match"`, `"dob_mismatch"` |  | How this record was checked against the `dob` or `age` you sent, strongest first. `dob_match`: the registry's full date equals yours. `year_match`: the registry publishes only a year and it equals your date's year. `age_match`: the registry publishes only an age and it agrees with your date. `no_dob_age_year`: the registry publishes none of these, so nothing could be checked; the record matched on name and `unverified` is `true`. `age_mismatch`: the published age contradicts your date; returned only with `onAgeMismatch: "flag"`. `dob_near_match`: you sent `dobTolerance` and the registry's full date is a likely typo of yours (year off, or day and month swapped); returned unverified. `dob_mismatch`: excluded from results, documented for completeness. `null` when the query carried no `dob` or `age`. See [Searching by date of birth](https://offendersearch.app/docs/date-of-birth). |
| `dobVerification` | `string` — one of `""`, `"dob_match"`, `"year_match"`, `"age_match"`, `"unverified_no_dob_or_age"`, `"dob_mismatch(filtered)"`, `"age_mismatch(filtered)"`, `"age_mismatch(flagged)"`, `"dob_near_match"` |  | The engine's raw DOB/age verification token. Read `matchState` instead — it is the clean vocabulary (`dob_match`, `year_match`, `age_match`, `no_dob_age_year`, `age_mismatch`, `dob_mismatch`, or `null` when nothing was scored). The `(filtered)` tokens surface only where the contract exposes rejected candidates; `""` = no DOB or age was sent. |
| `unverified` | `boolean` |  | `true` when the record publishes no date of birth, birth year or age to check your query against. It is returned on the name and flagged. |
| `clearance` | [RecordClearance](https://offendersearch.app/docs/clearances#object-recordclearance) |  | The [clearance](https://offendersearch.app/docs/clearances) that names this person, present only when the request carried `subjectId` and this record was kept despite — or because of — a verdict: `annotate` mode, a `this_person` verdict, or a cleared person who has re-surfaced (`staleReason` set). Absent on every other record; a search without `subjectId` never carries it. |

## Example record

```json
{
  "recordId": "rec_717a89b01deda9457ced",
  "personRef": "prs_3c9e1f0a7b2d4e6f8a1b",
  "uuid": "0000000",
  "recordType": "sex_offender",
  "matchConfidence": 1.0,
  "matchBasis": ["lastName", "firstName", "dob", "lastName:exact", "name_match"],
  "matchDetail": {
    "strategies": { "lastName": "exact" },
    "fieldsPresent": ["lastName", "firstName", "dob"],
    "signals": ["matchedLegalName"],
    "matchedNameType": "legal",
    "verification": null
  },
  "matchedName": { "value": "EXAMPLE PLACEHOLDER SURNAME", "type": "legal" },
  "name": {
    "first": "EXAMPLE", "middle": "PLACEHOLDER", "last": "SURNAME",
    "suffix": "", "full": "EXAMPLE PLACEHOLDER SURNAME"
  },
  "aliases": [],
  "nicknames": [],
  "dob": "1968-02-09",
  "birthYear": 1968,
  "dobPrecision": "exact",
  "age": "58",
  "sex": "M",
  "race": "White",
  "ethnicity": "",
  "height": "5'10''",
  "weight": "165lbs",
  "eyeColor": "Hazel",
  "hairColor": "Brown",
  "marks": "Tattoo on L_arm , Scar on (Leg Right)",
  "addresses": [
    {
      "type": "residence", "line1": "1 EXAMPLE DR", "city": "MIDDLETOWN",
      "county": "Butler", "state": "OH", "zipcode": "45042",
      "lat": null, "lng": null
    }
  ],
  "registrationState": "OH",
  "addressStates": ["OH"],
  "offense": {
    "crime": "Rape",
    "statute": "2907.02",
    "riskLevel": "(Pre AWA) Sexual Predator",
    "tier": "(Pre AWA) Sexual Predator",
    "convictionDate": "1988-10-11",
    "registrationDate": "",
    "releaseDate": "1999-11-18",
    "caseNumber": "",
    "victimAge": "Juvenile",
    "victimSex": "Male",
    "jurisdiction": "OH",
    "offenseDate": "",
    "datePrecision": {
      "convictionDate": "exact",
      "offenseDate": "none",
      "registrationDate": "none",
      "releaseDate": "exact"
    },
    "datesAsPublished": {
      "convictionDate": "10/11/1988",
      "releaseDate": "11/18/1999"
    },
    "convictionCounty": "",
    "convictionCity": "",
    "convictionCount": "",
    "federal": null
  },
  "offenses": [ /* offenses[0] is the same object as offense; any further offenses follow */ ],
  "stateData": null,
  "flags": { "absconder": null, "predator": true },
  "images": [],
  "housingStatus": null,
  "source": {
    "jurisdiction": "OH",
    "registryName": "State Sex Offender Registry",
    "recordUrl": "https://…",
    "personRef": "prs_3c9e1f0a7b2d4e6f8a1b",
    "recordedAt": "2026-08-02T00:00:00Z",
    "lastCheckedAt": "2026-08-02T00:00:00Z",
    "sourceUpdatedAt": null
  },
  "sources": [
    {
      "jurisdiction": "OH",
      "registryName": "State Sex Offender Registry",
      "recordUrl": "https://…",
      "personRef": "prs_3c9e1f0a7b2d4e6f8a1b",
      "recordedAt": "2026-08-02T00:00:00Z",
      "lastCheckedAt": "2026-08-02T00:00:00Z",
      "sourceUpdatedAt": null
    }
  ],
  "dobVerification": "",
  "matchState": null,
  "unverified": false
}
```

What to notice: `ethnicity`, `registrationDate` and `caseNumber` are `""` — Ohio does not publish them. `federal` is `null`, meaning Ohio publishes no federal-vs-state column; only Oklahoma does. `flags.absconder` is `null` (Ohio does not publish it) while `flags.predator` is `true`. `stateData` is `null` only because this call omitted `include`; `images` is empty because this record has no photo — `images` and `offenses` are never withheld. `matchState` is `null` because the query supplied no `dob` or `age`. And `birthYear` is `1968` even though the year was never published on its own — it is the year of the full date, so year logic reads one field whatever the jurisdiction published.

## The Name object

A person's name as the registry publishes it, split into parts. Each part is `""` when the registry does not publish it.

Returned or accepted by [`POST /v1/search`](https://offendersearch.app/docs/search#reference-post-v1-search), [`GET /v1/searches/{searchId}`](https://offendersearch.app/docs/async-and-webhooks#reference-get-v1-searches-searchid), [`GET /v1/searches/{searchId}/results`](https://offendersearch.app/docs/async-and-webhooks#reference-get-v1-searches-searchid-results), [`POST /v1/search`](https://offendersearch.app/docs/live-evidence#reference-post-v1-search-live-evidence), [`POST /v1/batch`](https://offendersearch.app/docs/batch#reference-post-v1-batch), [`GET /v1/records/{recordId}`](https://offendersearch.app/docs/record-object#reference-get-v1-records-recordid), [`GET /v1/map/records/{markerId}`](https://offendersearch.app/docs/map/open-a-record#reference-get-v1-map-records).

| Field | Type | Default | Description |
| --- | --- | --- | --- |
| `first` | `string` |  | Given name. |
| `middle` | `string` |  | Middle name or names. |
| `last` | `string` |  | Surname. |
| `suffix` | `string` |  | Suffix (`JR`, `III`). |
| `full` | `string` |  | The parts joined in order: first, middle, last, suffix. |

## The Address object — registrant address fields

One published address. A record carries every address the registry publishes, each typed.

Returned or accepted by [`POST /v1/search`](https://offendersearch.app/docs/search#reference-post-v1-search), [`GET /v1/searches/{searchId}`](https://offendersearch.app/docs/async-and-webhooks#reference-get-v1-searches-searchid), [`GET /v1/searches/{searchId}/results`](https://offendersearch.app/docs/async-and-webhooks#reference-get-v1-searches-searchid-results), [`POST /v1/search`](https://offendersearch.app/docs/live-evidence#reference-post-v1-search-live-evidence), [`POST /v1/batch`](https://offendersearch.app/docs/batch#reference-post-v1-batch), [`GET /v1/records/{recordId}`](https://offendersearch.app/docs/record-object#reference-get-v1-records-recordid), [`GET /v1/map/records/{markerId}`](https://offendersearch.app/docs/map/open-a-record#reference-get-v1-map-records).

| Field | Type | Default | Description |
| --- | --- | --- | --- |
| `type` | `string` | default `"residence"` | The kind of address: `residence`, `employment`, `school`, `last_known` or `other`. Treat it as an open set and handle a value you do not recognise. Example `"residence"`. |
| `line1` | `string` |  | Street line as published. Some registries publish a block rather than a house number, and an employment or school line can begin with the employer or school name. |
| `city` | `string` |  | City. |
| `county` | `string` |  | County as published. |
| `state` | `string` |  | Two-letter state code. |
| `zipcode` | `string` |  | ZIP code as published. |
| `lat` | `number` or null |  | Latitude, when the address has a published or computed location; `null` otherwise. `null` does not mean the address is missing. |
| `lng` | `number` or null |  | Longitude, when the address has a published or computed location; `null` otherwise. |

## The Offense object — offense and conviction fields

One offense as the registry publishes it. Every field is present; a field the registry does not publish is `""` (or `null` for `federal`). Dates are ISO-8601, at the precision the registry published.

Returned or accepted by [`POST /v1/search`](https://offendersearch.app/docs/search#reference-post-v1-search), [`GET /v1/searches/{searchId}`](https://offendersearch.app/docs/async-and-webhooks#reference-get-v1-searches-searchid), [`GET /v1/searches/{searchId}/results`](https://offendersearch.app/docs/async-and-webhooks#reference-get-v1-searches-searchid-results), [`POST /v1/search`](https://offendersearch.app/docs/live-evidence#reference-post-v1-search-live-evidence), [`POST /v1/batch`](https://offendersearch.app/docs/batch#reference-post-v1-batch), [`GET /v1/records/{recordId}`](https://offendersearch.app/docs/record-object#reference-get-v1-records-recordid), [`GET /v1/map/records/{markerId}`](https://offendersearch.app/docs/map/open-a-record#reference-get-v1-map-records).

| Field | Type | Default | Description |
| --- | --- | --- | --- |
| `crime` | `string` |  | The offense description as published. |
| `statute` | `string` |  | The statute cited, as published. |
| `riskLevel` | `string` |  | The registry's risk classification, verbatim (`Tier 3`, `Level 2`, `Sexually Violent Predator`). Each state uses its own scale, so values are not comparable across states. `""` when the registry publishes none. It does not carry registration status; that is `stateData.status`. |
| `tier` | `string` |  | The registry's tier, where it publishes one separately from `riskLevel`, verbatim. `""` when not published. |
| `convictionDate` | `string` |  | Conviction date, ISO-8601: `YYYY-MM-DD`, or `YYYY-MM` / `YYYY` when the registry publishes only a month or a year. `""` when not published. `datePrecision.convictionDate` states which. |
| `offenseDate` | `string` |  | When the offense was committed, same format as `convictionDate`. A different fact from the conviction date. |
| `registrationDate` | `string` |  | Registration date, same format as `convictionDate`. |
| `releaseDate` | `string` |  | Release date, same format as `convictionDate`. |
| `datePrecision` | `object` |  | For each of the four date fields, how much of it the registry published: `exact`, `year_month`, `year`, `none`, or `unparseable`. Always all four keys. |
| `datesAsPublished` | `object` |  | The registry's original text for any date that was reformatted or could not be read, keyed by field (`{"convictionDate": "10/11/1988"}`). `{}` when every date was published as emitted. |
| `caseNumber` | `string` |  | Court case number as published. |
| `victimAge` | `string` |  | Victim age as published. |
| `victimSex` | `string` |  | Victim sex as published. |
| `jurisdiction` | `string` |  | The two-letter state where the conviction was entered. |
| `convictionCounty` | `string` |  | County where the conviction was entered. Not the registrant's county of residence. |
| `convictionCity` | `string` |  | City where the conviction was entered. |
| `convictionCount` | `string` |  | How many convictions this offense entry represents, as published. `""` when not published; it does not mean one. |
| `federal` | `boolean` or null |  | `true` when the registry marks the conviction as federal, `false` when it marks it as state, `null` when it does not publish this. |

## The SourceRef object — source registry and record link fields

Where a record came from: the registry, its own link to the registrant, and three timestamps. `source` is the registry that supplied the record's top-level values; `sources[]` lists every registry that holds the person.

Returned or accepted by [`POST /v1/search`](https://offendersearch.app/docs/search#reference-post-v1-search), [`GET /v1/searches/{searchId}`](https://offendersearch.app/docs/async-and-webhooks#reference-get-v1-searches-searchid), [`GET /v1/searches/{searchId}/results`](https://offendersearch.app/docs/async-and-webhooks#reference-get-v1-searches-searchid-results), [`POST /v1/search`](https://offendersearch.app/docs/live-evidence#reference-post-v1-search-live-evidence), [`POST /v1/batch`](https://offendersearch.app/docs/batch#reference-post-v1-batch), [`GET /v1/records/{recordId}`](https://offendersearch.app/docs/record-object#reference-get-v1-records-recordid), [`GET /v1/map/records/{markerId}`](https://offendersearch.app/docs/map/open-a-record#reference-get-v1-map-records).

| Field | Type | Default | Description |
| --- | --- | --- | --- |
| `jurisdiction` | `string` |  | The registry's code (`IL`). Example `"IL"`. |
| `registryName` | `string` |  | The registry's name. |
| `recordUrl` | `string (uri)` |  | The registry's own link to this registrant, for a reviewer to follow and double-check the match on the registry's site. On some registries it is a registry-wide page rather than the registrant's own; `""` when the registry publishes no page per registrant. It is a link, not a key: store `personRef` with `jurisdiction` to recognise the person. |
| `personRef` | `string` or null |  | The person behind this registry's listing: `prs_` and 20 hex characters, the same value when the registry republishes the listing under a new number. `null` when this entry carries no person reference. Example `"prs_3c9e1f0a7b2d4e6f8a1b"`. |
| `recordedAt` | `string (date-time)` or null |  | When OffenderSearch first recorded this registry's record, ISO-8601. `query.createdAtStart` and `createdAtEnd` filter on it. |
| `lastCheckedAt` | `string (date-time)` or null |  | When this registry's record was last confirmed, ISO-8601. |
| `sourceUpdatedAt` | `string (date-time)` or null |  | When the registry itself says it last changed the record, ISO-8601; `null` when the registry publishes no such date. `query.updatedAtStart` and `updatedAtEnd` filter on it. |

## The StateData object — extended per-state registry fields

The extended per-state detail. Returned only when the request sends `include: ["stateData"]`; otherwise `stateData` is `null` and `omittedFields` names it. Each field is `""`, `[]` or `null` when the registry does not publish it.

Returned or accepted by [`POST /v1/search`](https://offendersearch.app/docs/search#reference-post-v1-search), [`GET /v1/searches/{searchId}`](https://offendersearch.app/docs/async-and-webhooks#reference-get-v1-searches-searchid), [`GET /v1/searches/{searchId}/results`](https://offendersearch.app/docs/async-and-webhooks#reference-get-v1-searches-searchid-results), [`POST /v1/search`](https://offendersearch.app/docs/live-evidence#reference-post-v1-search-live-evidence), [`POST /v1/batch`](https://offendersearch.app/docs/batch#reference-post-v1-batch), [`GET /v1/records/{recordId}`](https://offendersearch.app/docs/record-object#reference-get-v1-records-recordid), [`GET /v1/map/records/{markerId}`](https://offendersearch.app/docs/map/open-a-record#reference-get-v1-map-records).

| Field | Type | Default | Description |
| --- | --- | --- | --- |
| `stateOffenderId` | `string` |  | The registry's own offender number. |
| `status` | `string` |  | Where the registrant stands with the registry, in its own words (`Compliant`, `Absconded`, `Confinement`, `Released - Subject to Registration`). Each state has its own vocabulary; match on the exact strings the state you care about publishes. Not a risk level. |
| `designation` | `string` |  | The registry's statutory classification, verbatim (`Sexual Predator`, `Sexual Offender`). |
| `registrationEnds` | `string` |  | When the registration term ends, ISO-8601 at the published precision. `""` when not published or when the registry publishes a duration instead of a date (`Lifetime`, `15 Years`) — then `datePrecision.registrationEnds` is `unparseable` and the text is in `datesAsPublished`. |
| `datePrecision` | `object` |  | For each date field on this object, how much of it the registry published: `exact`, `year_month`, `year`, `none`, or `unparseable`. |
| `datesAsPublished` | `object` |  | The registry's original text for any date field that was reformatted or is not a date (`{"registrationEnds": "Lifetime"}`). `{}` when none. |
| `verificationRequirement` | `string` |  | How often the registrant must verify with the registry, as published. |
| `lawAgency` | `string` |  | The law enforcement agency responsible for the registrant. |
| `judgmentOfConvictionUrl` | `string (uri)` |  | Link to the judgment of conviction, where the registry publishes one. |
| `vehicles` | `array of object` |  | Vehicles the registrant has reported. Keys vary by registry; the common ones are listed below. `[]` when none are published. |
| `vehicles[].plate` | `string` |  | License plate as printed (`UT F814NW`). |
| `vehicles[].make` | `string` |  | Make (`Ford`). |
| `vehicles[].model` | `string` |  | Model (`F150`). |
| `vehicles[].year` | `string` |  | Model year, as a string (`"2018"`). |
| `vehicles[].color` | `string` |  | Color as published. |
| `photos` | `array of object` |  | Additional photos the registry publishes in its extended detail. |
| `complianceStatus` | `string` |  | Registration compliance as published (`Compliant`, `Non-Compliant`). |
| `isLifetimeRegistration` | `boolean` or null |  | `true` when registration is for life, `false` when the registry states a fixed term, `null` when not published. |
| `lastVerificationDate` | `string` |  | When the registrant last verified with the registry, ISO-8601. |
| `addressVerificationDate` | `string` |  | When the registrant's address was last verified, ISO-8601. |
| `incarcerationStatus` | `string` |  | Custody status as published (`Incarcerated`, `Released`). |
| `comments` | `string` |  | Free-text remarks from the registry. |
| `criminalHistory` | `string` |  | Narrative criminal history, as published. |
| `adjudication` | `string` |  | Adult or juvenile adjudication, as published. |
| `registrationDuration` | `string` |  | The registration term as text (`10 years`, `Lifetime`). |
| `skinTone` | `string` |  | Skin tone as published (Iowa). |
| `residencyRestriction` | `string` |  | Residency restriction, free text (Iowa). |
| `employmentRestriction` | `string` |  | Employment restriction, free text (Iowa). |
| `exclusionZones` | `array of string` |  | Areas the registrant is barred from (Iowa). |
| `district` | `string` |  | Police district (District of Columbia). |
| `psa` | `string` |  | Police Service Area (District of Columbia). |
| `quadrant` | `string` |  | City quadrant: NW, NE, SW or SE (District of Columbia). |
| `birthCity` | `string` |  | Place of birth, city. |
| `birthState` | `string` |  | Place of birth, state. |
| `birthCountry` | `string` |  | Place of birth, country. |
| `sentenceCompletionDate` | `string` |  | When the sentence completes, ISO-8601. Distinct from `registrationEnds` and from `offense.releaseDate`. |
| `registrationStarts` | `string` |  | When registration began, ISO-8601. |
| `professionalLicenses` | `array of string` |  | Professional licenses the registrant holds, as the registry prints them. |
| `shoeSize` | `string` |  | Shoe size (Texas). Example `"10½"`. |
| `build` | `string` |  | Body build (Minnesota). Example `"Large"`. |
| `shoeWidth` | `string` |  | Shoe width code such as `D` or `EEE` (Texas). Example `"D"`. |

## GET /v1/records/{recordId} — Get a record

Fetch a single normalized record by id — for re-displaying or refreshing a specific person you already found.

**Authentication:** `X-API-Key` header.

Pass **either** identifier a search published for the person: our `recordId` (`rec_…`) or the registry’s own `uuid`. This is our equivalent of a legacy `uuid` / `personUuid` lookup. Returns the full Record object, including every source that corroborated the person.

A `recordId` resolves from the results of the search that returned it, on the account that ran it, for as long as that search is retained (14 days). A `uuid` resolves against the full dataset, for as long as the registry keeps publishing it.

**A `404` means the identifier is not current — never that the person is unregistered.** A `uuid` belongs to the publishing jurisdiction, and jurisdictions re-issue their own identifiers, sometimes for an entire registry at once; the registrant is then published under a new `uuid`. Re-search by name and state and store the id the new search returns. Treat a `uuid` as a cache key to refresh, not as a primary key.

**Contract revision 2026-08-04 — `recordId` is namespaced by jurisdiction.** `recordId` is derived from jurisdiction + `uuid`, so it is unique across jurisdictions and remains deterministic for a given merge. Values issued before that revision are superseded: re-run your searches and key on `sources[].recordUrl` with its `jurisdiction`, which is the durable identifier.

**A `uuid` is unique only together with its jurisdiction, so this endpoint can return `409`.** It is the jurisdiction’s own identifier, and jurisdictions assign them independently — `20059` identifies a Florida registrant, a Pennsylvania one *and* a Wisconsin one; 55,893 identifiers are shared across jurisdictions, covering 147,624 records. This endpoint returns a single record and does not disambiguate on your behalf: an explicit `409` is the correct contract when an identifier is ambiguous. Use `recordId`, which is namespaced per jurisdiction and never collides.

### Request

**cURL**

```bash
curl https://api.offendersearch.app/v1/records/rec_4b1e \
  -H "X-API-Key: $OFFENDERSEARCH_KEY"
```

**Node**

```javascript
const res = await fetch(
  "https://api.offendersearch.app/v1/records/rec_4b1e",
  { headers: { "X-API-Key": process.env.OFFENDERSEARCH_KEY } },
);
const record = await res.json();
console.log(record.name.full, record.source.jurisdiction);
```

**Python**

```python
import os, requests

resp = requests.get(
    "https://api.offendersearch.app/v1/records/rec_4b1e",
    headers={"X-API-Key": os.environ["OFFENDERSEARCH_KEY"]},
)
record = resp.json()
print(record["name"]["full"], record["source"]["jurisdiction"])
```

### Response

```json
{
  "recordId": "rec_4b1e",
  "uuid": "b1e4-…",
  "recordType": "sex_offender",
  "name": { "first": "John", "middle": "A", "last": "Doe", "full": "John A. Doe" },
  "dob": "1980-04-12",
  "dobPrecision": "exact",
  "dobVerification": "dob_match",
  "unverified": false,
  "source": {
    "jurisdiction": "NJ",
    "registryName": "State Sex Offender Registry",
    "recordUrl": "https://…",
    "lastCheckedAt": "2026-07-25T09:14:00Z"
  }
}
```

404 when no record carries this identifier. A recordId resolves while the search that returned it is retained (14 days); after that, re-search by name and state, because the registry may also have re-issued its uuid. 409 when the identifier matches records in more than one jurisdiction; the detail names them, and you disambiguate by using the recordId.

## Get a sex offender record by id: request and response fields

`GET /v1/records/{recordId}` · auth: `X-API-Key`

Fetch one Record by the `recordId` or the registry `uuid` a search returned. A `recordId` resolves while the search that returned it is retained (14 days).

### Request

**Path parameters**

| Field | Type | Required / default | Description |
| --- | --- | --- | --- |
| `recordId` | `string` | required | A `recordId` (`rec_…`) or a registry `uuid` from a search result. Example `"rec_ab12cd34ef56gh78ij90"`. |

### Response

**200** (application/json) — The record.

The body is [the `Record` object](https://offendersearch.app/docs/record-object#record-fields). One registrant, normalized to the same shape across every US registry. Every key is present on every record; an empty value is `""`, `[]` or `null` as stated per field, never a missing key.

**Errors**

| Status | Code | When |
| --- | --- | --- |
| 401 | — | The `X-API-Key` header is missing or the key is not valid. |
| 402 | — | The account has no active subscription and no free-trial searches left. `detail` says which. |
| 404 | — | No record carries this identifier. A `recordId` resolves while the search that returned it is retained (14 days); after that, run the search again for a current `recordId`, or look the person up by registry `uuid` and state. A `404` never means the person is unregistered. |
| 409 | — | A `uuid` matches records in more than one registry. `detail` names them; fetch by `recordId` instead. |

---

# Verification reports

> Generate a branded, timestamped PDF of a search you already ran, with a source citation on every record — one consolidated document for your audit file.

HTML: https://offendersearch.app/docs/reports · Markdown: https://offendersearch.app/docs/reports.md

## A defensible artifact for your audit file

A verification report is a branded, timestamped PDF rendered from a search you already ran — the same name and identifiers are re-read against the stored data at render time, so the report carries its own timestamp (parameters that do not apply to a document — radius, free text, match tuning, live, clearances — are not carried) — showing every matching offender and every field of the standard record, with each record’s photo where the registry publishes one and a source citation on every record. It is your report of public-record data, clearly labeled as OffenderSearch output; it does not reproduce, mirror, or impersonate any government website. It is a separate, callable endpoint any valid key can use — there is no per-key entitlement — billed at $0.02 per document.

Request one by passing the `searchId` of a prior `/v1/search` or `/v1/searches` call on your account — up to 7 days afterward — plus, optionally, the `viewerName` and `viewerEmail` of whoever is viewing it. Because the search call was already billed, the report meters only the +$0.02 PDF. The response is a single consolidated PDF for the whole search, with a source-attribution section and the report id in the `X-Report-Id` header.

The document contains: the search criteria and when the report was generated; every matching record with every field of the standard record (not the extended `stateData` block), its photo where one is published, and the labelled `matchState`; a source-attribution section citing the publishing jurisdiction for each record; the viewer identity and stated purpose where you supplied them; the report id; and a legal disclaimer.

**The report runs the search again when you request it.** It takes the name, date of birth, age, city, state, ZIP and jurisdiction criteria recorded with the `searchId` and runs them against the data at that moment, so the document reflects that moment rather than replaying the original response; filters beyond those (county, radius, address, free text, prefix or match settings) are not carried over. To keep the exact records a search returned, read them back with `GET /v1/searches/{searchId}/results`.

## POST /v1/report — Verification report

A branded, timestamped PDF report of a search you already ran, with a source citation on every record — a defensible artifact for your audit file. One consolidated document per search: your report of public-record data, clearly labeled as OffenderSearch output; it does not reproduce, mirror, or impersonate any government website.

**Authentication:** `X-API-Key` header.

Pass the `searchId` of a search you already ran — up to **7 days** afterward — and you get back **one consolidated PDF**, never a separate document per source. The report runs that search’s name, date of birth, age, city, state, ZIP and jurisdiction criteria again when you request it (an async search records only its name, date of birth, state and jurisdictions), so it reflects the data at that moment. Other filters on the original search — county, radius, address, free text, prefix or match settings — are not carried into the report, and a search whose only criteria were among them (a radius on its own, say) returns `422`. A one-shot mode is also supported: send an inline `query` instead of a `searchId` and the endpoint runs the search itself, which meters a search call **as well as** the PDF.

The report captures who viewed it (the optional `viewerName` / `requesterName`) and when, the search criteria, each matching offender, and a **source-attribution** section that cites the source of the data — plus a legal disclaimer. It is available to every account and billed at $0.02 per document; because the underlying search was already billed, the `searchId` path meters only the PDF. Omit the call and there is no extra charge.

The response is `application/pdf`, delivered as a file attachment. The generated report id is returned in the `X-Report-Id` header and printed on the document.

### What you can do

- **One consolidated document.** A single PDF for the whole search — not one document per source.
- **Full source attribution.** Cites the source of every record, with a citation on each.
- **Every standard field.** Each matching record with every field of the standard record and its photo where the registry publishes one. The extended stateData block is not included.
- **Names the viewer.** viewerName / requesterName, plus optional viewerEmail, purpose and reference, are printed on the report for your audit file. All are optional — the viewer identity is a record, not an access gate.
- **Audit-ready & clearly labeled.** Clearly labeled as OffenderSearch output and carries a legal disclaimer; it does not reproduce or impersonate any government site.

### Request

**cURL**

```bash
curl -X POST https://api.offendersearch.app/v1/report \
  -H "X-API-Key: $OFFENDERSEARCH_KEY" \
  -H "Content-Type: application/json" \
  -o report.pdf -D - \
  -d '{
    "searchId": "srch_9f2c1a7b3e4d",
    "viewerName": "Jane Doe, ACME HR",
    "purpose": "Volunteer background screening"
  }'
# -o writes the PDF to report.pdf; -D - prints the response headers,
# including X-Report-Id, to stdout.
```

**Node**

```javascript
import { writeFileSync } from "node:fs";

const res = await fetch("https://api.offendersearch.app/v1/report", {
  method: "POST",
  headers: {
    "X-API-Key": process.env.OFFENDERSEARCH_KEY,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    searchId: "srch_9f2c1a7b3e4d",            // id of a search you already ran
    viewerName: "Jane Doe, ACME HR",          // optional — printed on the PDF
    purpose: "Volunteer background screening", // optional
  }),
});

const reportId = res.headers.get("X-Report-Id");
writeFileSync(`${reportId}.pdf`, Buffer.from(await res.arrayBuffer()));
console.log("saved consolidated report", reportId);
```

**Python**

```python
import os, requests

resp = requests.post(
    "https://api.offendersearch.app/v1/report",
    headers={"X-API-Key": os.environ["OFFENDERSEARCH_KEY"]},
    json={
        "searchId": "srch_9f2c1a7b3e4d",              # id of a search you already ran
        "viewerName": "Jane Doe, ACME HR",            # optional — printed on the PDF
        "purpose": "Volunteer background screening",  # optional
    },
)
report_id = resp.headers["X-Report-Id"]
with open(f"{report_id}.pdf", "wb") as f:            # response body is the PDF
    f.write(resp.content)
print("saved consolidated report", report_id)
```

### Response

```json
HTTP/1.1 200 OK
Content-Type: application/pdf
Content-Disposition: attachment; filename="offendersearch-verification-rpt_9f2c1a7b.pdf"
X-Report-Id: rpt_9f2c1a7b

%PDF-1.7 …(binary PDF body: cover, search criteria, matching
records, a source-attribution section, and
the legal disclaimer)…
```

Returns application/pdf as a file attachment; the report id is in the X-Report-Id header. 400 when neither a searchId nor a query was supplied; 401 for a missing or invalid key or session; 404 when the searchId is unknown on this account; 410 when the search is older than the 7-day report window; 422 when the query is invalid (e.g. faceId).

## Verification report API request and response fields

`POST /v1/report` · auth: `X-API-Key or session`

One consolidated PDF for a search you already ran, with a source citation on every record. The search's recorded criteria are run again when you request it.

### Request

**Body** (application/json)

| Field | Type | Required / default | Description |
| --- | --- | --- | --- |
| `searchId` | `string` or null | optional | The `searchId` of a `POST /v1/search` or `POST /v1/searches` call on this account, up to 7 days old. The report runs that search's recorded name, date of birth, age, city, state, ZIP and jurisdiction criteria again, and only the PDF is billed. Example `"srch_9f2c1a7b3e4d"`. |
| `query` | [Query](https://offendersearch.app/docs/search#object-query) | optional | One-shot mode: run this search now and report on it. Ignored when `searchId` is sent. See the Query object. |
| `jurisdictions` | `array of string` or null | optional | One-shot mode only: registry codes to search. Ignored when `searchId` is sent. |
| `locationScoped` | `boolean` | optional · default `false` | One-shot mode only: same meaning as on `POST /v1/search`. |
| `viewerName` | `string` or null | optional | Who is viewing the report. Printed at the top of the PDF as a record; it does not control access. Example `"Jane Doe, HR Compliance"`. |
| `viewerEmail` | `string` or null | optional | The viewer's email. Printed on the PDF. Example `"jane@acme.example"`. |
| `requesterName` | `string` or null | optional | Alias of `viewerName`. |
| `purpose` | `string` or null | optional | The stated purpose of the lookup. Printed on the PDF. Example `"Volunteer background screening"`. |
| `reference` | `string` or null | optional | Your own case or reference id. Printed on the PDF. Example `"case-2026-0417"`. |

### Response

**200** (application/pdf) — The report PDF, sent as an attachment. The `X-Report-Id` response header carries the report id, which is also printed on the document.

**Errors**

| Status | Code | When |
| --- | --- | --- |
| 400 | — | Neither `searchId` nor `query` was sent. |
| 401 | — | The `X-API-Key` header is missing or the key is not valid. |
| 402 | — | The account has no active subscription and no free-trial searches left. `detail` says which. |
| 404 | — | The `searchId` is not a search on this account. |
| 410 | — | The search is older than the 7-day report window. Run the search again. |
| 422 | — | A field is malformed, or the criteria the report can run narrow on nothing (a search whose only filter was a radius, for example). |

## Proof documents API request and response fields

`POST /v1/searches/{searchId}/proof` · auth: `X-API-Key (billing enabled)`

Render per-registry proof documents for a search you already ran. Needs billing on the account.

### Request

**Path parameters**

| Field | Type | Required / default | Description |
| --- | --- | --- | --- |
| `searchId` | `string` | required | The `searchId` of a search on this account. Example `"srch_9f2c1a7b"`. |

**Body** (application/json)

The body is [the `ProofRequest` object](https://offendersearch.app/docs/reports#object-proofrequest). Asks for per-registry proof documents: the registries to render and the format. Billing must be enabled on the account. Each rendered document is billed as one PDF, at the same rate as a verification report.

### Response

**200** (application/json) — The documents rendered for the requested registries.

The body is [the `ProofBundle` object](https://offendersearch.app/docs/reports#object-proofbundle). The proof documents rendered for a search. `{"status": "none"}` when no proof was requested.

**Errors**

| Status | Code | When |
| --- | --- | --- |
| 401 | — | The `X-API-Key` header is missing or the key is not valid. |
| 402 | — | Billing is not enabled on the account. |
| 404 | — | No search with this id on this account (a search run by another account answers the same 404). The body is an [Error](https://offendersearch.app/docs/errors#object-error). |
| 422 | — | `registries` is missing or empty, or the body carries an unknown field. |

## The ProofRequest object — proof document request fields

Asks for per-registry proof documents: the registries to render and the format. Billing must be enabled on the account. Each rendered document is billed as one PDF, at the same rate as a verification report.

Returned or accepted by [`POST /v1/search`](https://offendersearch.app/docs/search#reference-post-v1-search), [`POST /v1/search`](https://offendersearch.app/docs/live-evidence#reference-post-v1-search-live-evidence), [`POST /v1/searches/{searchId}/proof`](https://offendersearch.app/docs/reports#reference-post-v1-searches-searchid-proof).

| Field | Type | Required / default | Description |
| --- | --- | --- | --- |
| `registries` | `array of string` | required | Registry codes to render proof for, at least one (`["IL", "IN"]`). A registry with no proof template is skipped and noted. |
| `format` | `string` — one of `"pdf"`, `"html"` | optional · default `"pdf"` | Document format: `pdf` or `html`. |

## The ProofBundle object — proof document response fields

The proof documents rendered for a search. `{"status": "none"}` when no proof was requested.

Returned or accepted by [`POST /v1/search`](https://offendersearch.app/docs/search#reference-post-v1-search), [`GET /v1/searches/{searchId}`](https://offendersearch.app/docs/async-and-webhooks#reference-get-v1-searches-searchid), [`POST /v1/search`](https://offendersearch.app/docs/live-evidence#reference-post-v1-search-live-evidence), [`POST /v1/searches/{searchId}/proof`](https://offendersearch.app/docs/reports#reference-post-v1-searches-searchid-proof).

| Field | Type | Default | Description |
| --- | --- | --- | --- |
| `status` | `string` — one of `"none"`, `"rendering"`, `"ready"` |  | `ready`: at least one document rendered. `none`: nothing was rendered. `rendering` is reserved and not returned today. |
| `billedDocuments` | `integer` |  | Documents rendered and billed on this request, one PDF each. A registry with no proof template is not counted and not billed. |
| `documents` | `array of object` |  | One entry per requested registry. |
| `documents[].registry` | `string` |  | The registry code. |
| `documents[].format` | `string` — one of `"pdf"`, `"html"` |  | `pdf` or `html`. |
| `documents[].url` | `string` |  | Where to fetch the document (`GET /v1/proof-docs/{token}`). |
| `documents[].note` | `string` |  | Why a document was not rendered, when it was not. |

## Fetch a proof document

`GET /v1/proof-docs/{token}` · auth: `X-API-Key`

Download one rendered proof document by the token in its `documents[].url`.

### Request

**Path parameters**

| Field | Type | Required / default | Description |
| --- | --- | --- | --- |
| `token` | `string` | required | The token from a ProofBundle document URL. |

### Response

**200** (application/pdf or text/html) — The document, in the format it was requested in.

**Errors**

| Status | Code | When |
| --- | --- | --- |
| 401 | — | The `X-API-Key` header is missing or the key is not valid. |
| 402 | — | The account has no active subscription and no free-trial searches left. `detail` says which. |
| 404 | — | No document with this token. |
