KERNIT Documentation

POST/hyperlink-scan
API version2026-05-12Version policy

POST /hyperlink-scan

/hyperlink-scan reads a DOCX and returns review rows without writing links. It is the first step for reviewable integrations and the safest way to inspect a document before apply.

POST /hyperlink-scan

Reads a DOCX manuscript and returns citation, bibliography, DOI, figure, table, equation, section, appendix, algorithm, and listing review data without modifying the file.

AuthBearer API key BillingScan is review preparation and normally does not consume final apply allowance. Hosthttps://api.kernit.org

Contract Source#

This reference is backed by /docs/openapi.json. The source schema lives in app/docs/openapi.json, so request fields, response schemas, examples, and validation stay tied to one API contract.

Request Fields#

Defined by the OpenAPI contract requestBody multipart/form-data.

FieldTypeRequiredDescription
filestring:binaryYesValid Microsoft Word DOCX package. Maximum size is 25 MB.
settingsstringNoJSON string matching HyperlinkSettings. Defaults are conservative.

Example Request#

curl -X POST https://api.kernit.org/hyperlink-scan \
  -H "Authorization: Bearer sk_kernit_live_YOUR_KEY" \
  -F "file=@paper.docx" \
  -F 'settings={"refs":true,"figures":"number","tables":"number","equations":"number","sections":"number","doi":true}'

Code Examples#

curl
curl -X POST https://api.kernit.org/hyperlink-scan \
  -H "Authorization: Bearer sk_kernit_live_YOUR_KEY" \
  -F "file=@paper.docx" \
  -F 'settings={"refs":true,"figures":"number","tables":"number","equations":"number","sections":"number","doi":true}'
JavaScript
const apiKey = 'sk_kernit_live_YOUR_KEY';
const form = new FormData();
form.append('file', fileInput.files[0]);
form.append('settings', "{\"refs\":true,\"figures\":\"number\",\"tables\":\"number\",\"equations\":\"number\",\"sections\":\"number\",\"doi\":true,\"crossref\":true}");

const response = await fetch('https://api.kernit.org/hyperlink-scan', {
  method: 'POST',
  headers: { Authorization: 'Bearer ' + apiKey },
  body: form
});

const text = await response.text();
Python
import requests

api_key = 'sk_kernit_live_YOUR_KEY'

with open('paper.docx', 'rb') as docx:
    response = requests.post(
        'https://api.kernit.org/hyperlink-scan',
        headers={'Authorization': f'Bearer {api_key}'},
        files={'file': ('paper.docx', docx, 'application/vnd.openxmlformats-officedocument.wordprocessingml.document')},
        data={
        'settings': "{\"refs\":true,\"figures\":\"number\",\"tables\":\"number\",\"equations\":\"number\",\"sections\":\"number\",\"doi\":true,\"crossref\":true}",
    },
    timeout=480
    )

print(response.status_code)
print(response.text)

Try This Endpoint#

POST /hyperlink-scan

OpenAPI-backed request builder for this operation.

2 request fields 1 required 5 responses

Request Preview

Fill request fields to preview multipart form data.

Response Output

Response output will appear here.

Responses#

StatusMeaningSchema
200Review packet with scan token and candidate links.ScanPacket
400Invalid request shape, missing file, invalid JSON, or rejected DOCX.ErrorResponse
401Missing or invalid authorization.ErrorResponse
413DOCX exceeds the current 25 MB limit.ErrorResponse
defaultUnexpected KERNIT-side service error.ErrorResponse

Example Success Body#

{
  "scanFingerprint": "sha256:2a71...",
  "scanToken": "eyJhbGciOiJIUzI1NiIs...",
  "summary": {
    "estimatedLinkCount": 47,
    "unmatchedCount": 3,
    "targetCount": 28
  },
  "matches": [
    {
      "refId": "r1",
      "sourceText": "[1]",
      "status": "ready",
      "targetId": "b1"
    }
  ],
  "targets": [
    {
      "targetId": "b1",
      "label": "Reference 1",
      "type": "reference"
    }
  ]
}

Error Examples#

400 Invalid request shape, missing file, invalid JSON, or rejected DOCX.
{
  "error": "Invalid JSON in form data"
}
401 Missing or invalid authorization.
{
  "error": "Missing authorization header"
}
413 DOCX exceeds the current 25 MB limit.
{
  "error": "File exceeds 25MB limit"
}
default Unexpected KERNIT-side service error.
{
  "error": "Processing failed"
}

Implementation Edge Cases#

CaseExpected handling
Malformed settings JSONReturn 400 and ask the caller to fix settings before scanning again. Do not apply defaults silently in an integration UI.
Invalid or damaged DOCXReturn 400 with a request-shape error. Ask the user to re-save the file in Word before retrying.
File over 25 MBReturn 413. Keep this as a file-size issue, not a scan-token or auth issue.
Ambiguous citation graphReturn matches with unmatched, low-confidence, held, or identity-change statuses so the reviewer can decide before apply.

Operational Notes#

  • Store scanToken and scanFingerprint with the review session.
  • Do not mutate settings before apply.
  • Expose low-confidence, unmatched, duplicate, and identity-changing rows first in your UI.

Settings Reference#

FieldDefaultDescription
citeStyleautoDetect numbered, author-date, superscript, or hybrid citation patterns.
refsfalseLink in-text citations to matching bibliography entries.
figuresnumberLink figure mentions such as Fig. 2 or Figure 2 to captions.
tablesnumberLink table mentions to table titles or captions.
equationsnumberLink equation mentions such as Eq. (4) to equation targets.
sectionsnumberLink section references to numbered section headings.
appendicesnumberLink appendix references to appendix targets.
doifalseDetect DOI and URL text in references and convert it to external links.
crossreffalseResolve references with Crossref evidence before applying DOI links.
refTitleLinkfalseUse a resolved title as the hyperlink text when the reference contains DOI evidence.
linkColor#0077BDSet citation link color. Use auto to preserve source text color.
xrefLinkColor#0077BDSet non-citation cross-reference link color.
urlFontOptional font override for DOI and URL links.
suffixDisambiguationOptInfalseEnable suffix recalculation support for ambiguous author-year citations when available.
Was this page useful?Send a lightweight docs feedback event.
Last updated: May 12, 2026Canonical: https://kernit.org/docs/api/scan/