NairaCheck
API reference menu

Document Verification

Verify a document

Check a single PDF or image for tampering, edits and AI generation. Each document is judged on its own evidence, never compared with earlier submissions, and comes back with a verdict, a risk score and the findings behind them.

POST/v1/document/verify
GET/v1/document/health

Authentication

Send an API key from the API key portal using the Bearer scheme. The key needs the document:verify scope; a key without it gets 403 INSUFFICIENT_SCOPE. One key can carry both document:verify andcac:search.

Header
Authorization: Bearer nck_live_...

The health endpoint needs no key. It returns status, engine_version, whether the OCR and AI layers are up, and max_document_mb.

Request body

Send JSON with exactly one document source. Supplying both returnsAMBIGUOUS_DOCUMENT; neither returns MISSING_DOCUMENT.

FieldTypeRequiredMeaning
documentUrlstringOne of the twoPublic http(s) URL of the file, fetched by NairaCheck. Google Drive share links are accepted.
documentBase64stringOne of the twoThe file itself, base64-encoded. A data: URL prefix is tolerated.
fileNamestringNoFile name to report back, used with documentBase64.
referenceIdstringNoYour own ID for the submission, echoed back as reference_id.
documentTypestringNoA hint for the AI review, e.g. "bank statement" or "electricity token receipt".
includeOverlaysbooleanNoAdds annotated page images (overlays) with flagged regions boxed.
skipReasoningbooleanNotrue runs the deterministic forensic checks only and skips the AI review.

You can also upload the file as multipart/form-data in a field named file, with the optional fields above as form fields. Booleans are sent as the string true.

Upload a file
curl --request POST 'https://api.nairacheck.com/v1/document/verify' \
  --max-time 90 \
  --header "Authorization: Bearer $NAIRACHECK_API_KEY" \
  --form file=@statement.pdf \
  --form referenceId=ref_123 \
  --form documentType="bank statement"

Document URLs

The URL must return the file itself, not a page that displays it.

  • Google Drive share links (/file/d/<id>/view,open?id=, uc?id=) are converted to a direct download automatically. Sharing must be set to Anyone with the link, or the request fails with DOWNLOAD_FAILED.
  • Up to 5 redirects are followed. Hosts that resolve to private or internal addresses are refused with HOST_NOT_ALLOWED, at every hop.
  • A URL that returns a web page, such as a viewer or sign-in page, fails with URL_RETURNED_WEB_PAGE.
  • Sites whose bot protection refuses every non-browser client fail with DOWNLOAD_BLOCKED. Upload the file instead, or serve it from storage you control, such as a signed URL.

Accepted documents

  • PDF, PNG, JPEG, WEBP, TIFF, BMP and single-frame GIF.
  • Up to 5 MB, whether uploaded, sent as base64 or downloaded. Larger files return DOCUMENT_TOO_LARGE.
  • PDFs up to 20 pages; more returns TOO_MANY_PAGES.
  • The type is read from the file's bytes, not its name or Content-Type. A renamed file is accepted but raises EXTENSION_MISMATCH.
  • Video and animated GIF, WEBP or PNG are rejected with 415. Encrypted PDFs return ENCRYPTED_DOCUMENT.

Verdicts

recommendation is a signal for your system, not a decision.

VerdictRisk scoreRecommendationTypical evidence
AUTHENTICBelow 30ACCEPTNo findings, or only INFO/LOW ones, and the AI review finds the document consistent.
SUSPICIOUS30–59MANUAL_REVIEWMEDIUM findings (re-saved, modified after creation, inconsistent regions) or an uncertain AI review.
TAMPERED60 or aboveREJECTA CRITICAL or HIGH construction finding, or an alteration the AI review confirms.

The risk is the higher of the forensic score and the average of the forensic score and the AI review's likelihood, with a floor of 70 on any CRITICAL finding. The AI review can raise the risk with evidence the forensic checks can't see, such as bad arithmetic, but it can't talk away hard construction evidence.

Response fields

FieldTypeMeaning
statusCOMPLETED | FAILEDWhether the document was analysed. On FAILED, read error and message; there is no verdict.
verdictenumAUTHENTIC, SUSPICIOUS or TAMPERED, derived from risk_score. The field to branch on.
risk_score0–100Combined risk from the forensic score and the AI review.
recommendationenumACCEPT, MANUAL_REVIEW or REJECT. A signal; your system owns the decision.
summarystringTwo or three sentences for a reviewer explaining the verdict.
reference_idstringYour referenceId, echoed back.
document.sha256hexHash of the exact bytes analysed. Proves which file the verdict applies to and finds re-submissions.
document.kind / media_typestringpdf or image, detected from the file's bytes rather than its name.
forensics.score0–100Sum of finding points, capped at 100. Deterministic: the same file always scores the same.
forensics.worst_severityenumThe most severe finding, INFO to CRITICAL. Any CRITICAL finding puts the risk at 70 or above.
forensics.findings[]listEvidence from the deterministic checks, highest points first. See finding fields below.
reasoning.availablebooleanWhether the AI review ran. When false, reasoning.error says why and the verdict is forensic-only.
reasoning.tamper_likelihood0–100The AI review's estimate that the document was altered. It can raise the risk but never lower it below the forensic score.
reasoning.verdictenumThe AI review's own verdict before combination. Disagreement with verdict is worth a reviewer's eye.
reasoning.findings[]list{severity, category, location, observation}: visual, typography, arithmetic, consistency, metadata or content issues.
reasoning.consistency_checks[]list{check, passed, detail}: totals, tax rates, dates and ID formats. Any passed: false is a concrete reason to doubt the document.
reasoning.forensic_review[]list{code, assessment, note}: the AI review's view of each forensic finding — CONFIRMED, PLAUSIBLY_BENIGN or NOT_VISIBLE. It does not change the score.
reasoning.key_fields[]list{name, value}: names, amounts, IDs and dates read off the document. Not verified against any source.
reasoning.ai_generatedobject{likelihood, indicators}: the estimate that the whole document was made by an image model, with the evidence seen. Counts toward risk_score like tamper_likelihood.
fingerprintobjectMetadata, structure, fonts, text source, OCR confidence and provenance. Background for analysts.
layersobjectWhich analysis layers ran. If one is unavailable the verdict rests on fewer signals.
storageobject{stored, record_id}: the ID of the retained audit record. Quote it when contacting support.
overlays[]list{page, findings, png_base64}, only when includeOverlays is set. Never retained.
processing_msintegerTime from the request arriving to the result being ready. Also sent as the X-Processing-Time-Ms header.

Findings

Each entry in forensics.findings has these fields.

FieldMeaning
codeMachine-readable finding type (table below).
severityINFO, LOW, MEDIUM, HIGH or CRITICAL.
pointsContribution to forensics.score.
layerintake, metadata, structure, typography, ocr, ela or provenance.
detailHuman-readable explanation.
page, bboxWhere it was found. bbox is [x0, y0, x1, y1] in PDF points for PDFs and pixels for images.
evidenceRaw values behind the finding, such as the two fonts or the creator/producer pair.

Finding codes

CodeSeverity (points)Meaning
INTRA_WORD_FONT_SWITCHCRITICAL (40; +10 for the 2nd and 3rd)One word drawn in two fonts. Editors start a new text run at the cursor; document generators never do.
FOREIGN_FONTHIGH (25)A font used for a handful of spans, through a different font technology or not embedded: text added by another tool.
DUPLICATE_FONT_SUBSETSMEDIUM (6 each, max 18)One font family embedded several times on a page, meaning more than one writing pass.
COVERING_SHAPEHIGH (20)A box or image painted after the text it overlaps, so the text underneath was blanked out.
MARKUP_ANNOTATIONHIGH (20)Free text, stamp, ink or similar annotations overlaid on the page.
INCREMENTAL_UPDATESMEDIUM (9 each, max 18)Revisions appended after the original was written. Linearisation and digital signatures are discounted.
EMBEDDED_JAVASCRIPTMEDIUM (8)The PDF contains JavaScript.
EDITING_SOFTWAREHIGH (25)Creator, producer or EXIF names an editor such as Photoshop, Canva, iLovePDF or Sejda.
RESAVED_AFTER_EXPORTHIGH (20)The original creator was kept but the file was rewritten by a re-save tool such as macOS Preview.
PRODUCER_CHAIN_MISMATCHMEDIUM (15)The creator and producer don't belong together.
RESAVE_PRODUCERLOW (5)Written by a re-save tool, with no originating application recorded.
MODIFIED_AFTER_CREATIONMEDIUM (12)The modification date is more than a minute after the creation date.
MODIFIED_BEFORE_CREATIONHIGH (18)Dates that can't both be true, so they were set by hand.
FUTURE_CREATION_DATE / FUTURE_MODIFICATION_DATEHIGH (20)Dated in the future.
NO_CREATION_DATELOW (4)The PDF records no creation date.
METADATA_STRIPPEDINFO (0)The image has no EXIF. Normal for screenshots and messaging apps.
TEXT_LAYER_NOT_VISIBLEMEDIUM (12)Most of the PDF's text layer can't be seen on the rendered page, so text is hidden or covered.
NUMBERS_ONLY_IN_PIXELSMEDIUM (5 each, max 15)Numbers visible on the page are missing from the text layer, so they may have been pasted in as an image.
ELA_INCONSISTENT_REGIONSLOW/MEDIUM (max 14)Regions recompress differently from the rest of the image. Advisory: check whether they cover a value.
EXTENSION_MISMATCHLOW (5)The file name's extension doesn't match its contents.
PSEUDO_TEXTHIGH (35)Image or scanned page with 100+ words, mostly not real words and read with low confidence: AI-generated small print, or a capture too poor to verify.
AI_GENERATED_PROVENANCECRITICAL (60)Content Credentials or XMP declare the file was made by an AI model.
AI_EDITED_PROVENANCEHIGH (35)Content Credentials declare a real image edited with AI.
SYNTHETIC_PROVENANCEMEDIUM (15)Content Credentials declare the file was created digitally rather than captured.
AI_GENERATOR_METADATAHIGH (35)Image-generator settings embedded in the file, as written by Stable Diffusion tools.
CONTENT_CREDENTIALSINFO (0)Content Credentials present with no AI claim, e.g. a camera's digital capture.

Timing and limits

  • Forensic-only requests (skipReasoning: true) typically take 0.5–1 s. With the AI review, expect 15–30 s. Set a client timeout of at least 60 seconds.
  • Every verify response carries X-Processing-Time-Ms, equal to processing_ms. Subtract it from the time your client measured to see what the network added.
  • Each key has a per-minute limit, 10 requests by default. Authenticated responses carryX-RateLimit-Limit, X-RateLimit-Remaining andX-RateLimit-Reset; over the limit you get 429 RATE_LIMITED withRetry-After.
  • Failures return {"status": "FAILED", "error": "<CODE>", "message": "…"}. See errors and limits for every code.

Data handling

  • The document's bytes are never stored.
  • The analysis result is retained as an audit record, including failed requests after authentication.storage.record_id identifies it. Overlay images are not retained.
  • A documentUrl is recorded with its query string removed, because signed URLs carry credentials there.
  • Requests rejected for authentication or rate limits are not recorded.

Known limits

  • Construction evidence is strongest on born-digital PDFs. A document that was printed and photographed, or screenshotted, loses its construction history, so expect more SUSPICIOUS thanTAMPERED verdicts.
  • AI-generated documents are caught on evidence, not guaranteed. Without Content Credentials, garbled text or a visible watermark, only the AI review's judgement remains, which on its own can reachSUSPICIOUS but not TAMPERED.
  • A legitimately assembled PDF, such as a statement with a stamped page appended by a second tool, can raise font findings. reasoning.forensic_review says when a finding looks benign.