KERNIT Documentation

POST/hyperlink
API version2026-05-12Version policy

POST /hyperlink

/hyperlink is the direct one-step endpoint. It is useful for trusted automated workflows, but KERNIT recommends scan/resolve/apply when users need to review wrong-link risk.

POST /hyperlink

One-step DOCX hyperlinking#

Uploads a DOCX and returns linked output without an intermediate review step. Use scan/resolve/apply when wrong-link correction matters.

AuthBearer API key BillingConsumes document-processing 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 DOCX package.
settingsstringNoJSON string matching HyperlinkSettings.

Example Request#

curl -X POST https://api.kernit.org/hyperlink \
  -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 \
  -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', {
  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',
        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

OpenAPI-backed request builder for this operation.

2 request fields 1 required 7 responses

Request Preview

Fill request fields to preview multipart form data.

Response Output

Response output will appear here.

Responses#

StatusMeaningSchema
200Base64 DOCX and link statistics.ApplyResult
400Invalid request shape, missing file, invalid JSON, or rejected DOCX.ErrorResponse
401Missing or invalid authorization.ErrorResponse
402No credits or plan allowance available.ErrorResponse
413DOCX exceeds the current 25 MB limit.ErrorResponse
429Per-key or organization request rate limit exceeded.ErrorResponse
defaultUnexpected KERNIT-side service error.ErrorResponse

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"
}
402 No credits or plan allowance available.
{
  "error": "No credits remaining"
}
413 DOCX exceeds the current 25 MB limit.
{
  "error": "File exceeds 25MB limit"
}

Implementation Edge Cases#

CaseExpected handling
Wrong-link riskUse the one-step route only when the input is predictable. Use scan/resolve/apply when reviewers need to correct targets first.
Missing API keyReturn 401. Production automation should send Authorization: Bearer sk_kernit_live_... on api.kernit.org.
Rate limit exceededReturn 429 with retry_after when rate limiting is configured. Keep the operation pending until the delay passes.
No document allowanceReturn 402. This is a billing or plan state, not a request-shape problem.

When to Use It#

Use one-step whenUse review flow when
Documents are internally generated and predictable.Documents come from varied authors or journals.
Your product has no human review step.Wrong links must be corrected before output.
You only need conservative internal links.You apply resolver evidence or retarget decisions.
Was this page useful?Send a lightweight docs feedback event.
Last updated: May 12, 2026Canonical: https://kernit.org/docs/api/direct-hyperlink/