Skip to Content

Inspect

POST
/v1/inspect

Detects the format of a document and checks it, without processing it. Returns the format facts of source, plus checks. Every format is accepted: a file Papyrus cannot process is reported with the type it was detected as, or as unknown.

Use it to route documents before sending them to Markdown or render, or to flag uploads whose name does not match their content. A failed check never rejects the file.

Inspect produces no file, so the response has no result and the request takes no output or destination. An http(s) URL without an extension in its path takes the extension of the response Content-Type, so extensionMatch then compares the content with what the server declared.

Authorization

HTTPBearer
headerAuthorizationBearer <token>

Static API key from PAPYRUS_API_KEY

Request Body

  1. body
source*Source

file://, http(s):// URL or :///

options?

Operation options, omitted fields take their defaults

Response Body

Source facts and checks

application/json
  1. response

No artifact is produced, so there is no result (adr/inspect.md)

source*

The input document

options*

The request options with defaults applied

checks*

Checks run on the source

{
  "source": {
    "uri": "file://file",
    "name": "sample.pdf",
    "size": 584,
    "mimeType": "application/pdf",
    "extension": "pdf",
    "label": "pdf",
    "group": "document"
  },
  "options": {},
  "checks": {
    "extensionMatch": true
  }
}