Zum Inhalt springen

Upload a file (hochladen): a Beleg, receipt or invoice as PDF, picture (JPEG, PNG, WebP, HEIC) or E-Rechnung (XML, media_type application/xml), content base64. Stored unchanged in the Belegablage; returns its SHA-256 hash. Step 1 of 2: then put it into the inbox with beleg.deliver (pages: [hash]), which reads it. A picture is also prepared (deskewed, cropped, contrast) and checked against the quality limits: content_hash and quality.

POST
/v1/commands/file.store
Code sample: Shell / cURL
curl --request POST \
--url https://example.com/v1/commands/file.store \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{ "dry_run": false, "origin": { "display_name": "example", "id": "example", "kind": "example" }, "payload": { "content": "example", "media_type": "example" }, "rationale": "example" }'
Idempotency-Key
string

A repeated key returns the first result without running the Command again.

Decuma-Mandant
string format: uuid

The Mandant a session acts on; an API-Schlüssel is bound to its own.

Media typeapplication/json
object
dry_run

Dry run: the checks of executing, then the handler in a transaction that is always rolled back; nothing is logged, sent or kept. The answer is then a BefehlPruefung (as command.check) with the handler’s result as output, not the result below.

boolean
origin

Who or what a call comes from beyond its Actor, set by the caller (an automation, an integration): stored and hashed with the log entry, shown and filtered in the Verlauf.

object
display_name
required

The name a person reads in the Verlauf, 1 to 120 characters.

string
id
required

The caller’s own id of it, 1 to 200 characters.

string
kind
required

What kind of caller, 1 to 40 of a-z, 0-9 and _ (for example automation, integration).

string
payload
object
content
required

The content, base64. Not written to the Command-Log.

string
media_type
required
string
rationale

Why the Actor issues this; stored in the Command-Log.

string

Result

Media typeapplication/json
object
content_hash
required

SHA-256 of the prepared copy of a picture (deskewed, cropped, contrast), hex: what the reading port receives. The hash of the file itself when nothing is prepared.

string
hash
required

SHA-256 of the content, hex: the page reference of beleg.deliver.

string
media_type
required
string
quality

The quality gate of a picture (JPEG, PNG, WebP); none for other files.

Any of:

The verdict of the quality gate on a picture, under the installation’s limits (file.quality_limits).

object
accepted
required
boolean
measured
required

What the analysis of a picture measured.

object
brightness
required

Mean brightness of the paper after the contrast step, 0 to 255.

number format: float
cut_off
required

The document runs over one to three edges of the picture.

boolean
decoded
required

False when the file could not be decoded as a picture; every other value is then 0.

boolean
fill
required

Share of the picture the document takes, 0 to 1.

number format: float
glare
required

Share of the document covered by burnt-out highlights, 0 to 1.

number format: float
height
required
integer format: uint32
sharpness
required

Edge sharpness, 0 to 1: the steepest brightness steps relative to the contrast.

number format: float
skew_degrees
required

Deviation of the document from upright, in degrees.

number format: float
text_height

Height of a line of text on the prepared page (the median), in pixels; 0 when no line was found.

number format: float
0
width
required

Size of the picture as stored, in pixels (after its orientation tag).

integer format: uint32
problem

Why not, as a code.

Any of:

Why a picture is below the limits.

string
Allowed values: unreadable low_resolution too_dark glare blurred too_far cut_off
reason

Why not, one sentence.

string | null
size
required
integer format: uint

Example

{
"quality": {
"measured": {
"text_height": 0
},
"problem": "unreadable"
}
}

Problem

Media typeapplication/problem+json
object
code
required
string
Allowed values: validation not_authenticated not_allowed needs_human second_factor_required unknown_command idempotency_conflict not_found conflict busy internal
detail

What is wrong.

string
next_command

The Command the next step names, whatever the language of next_step.

string | null
next_step

What to do next.

string
retry_payload

Fields that complete the refused call when the refusal carries a proposal: merged into its payload, the same call goes through.

object | null
status
required
integer
title
required
string
type
required
string

Example

{
"code": "validation"
}