REST API
Every Command and every query of the registry is one route: POST /v1/commands/{name} changes something, POST /v1/queries/{name} reads. The body is {"payload": {...}}; a Command also takes rationale (stored in the Command-Log) and, where it is offered, dry_run: true (the checks and the handler run, then everything is rolled back: nothing is kept, logged or sent). The instance serves its OpenAPI 3.1 document at /v1/openapi.json; every operation is listed in the API reference.
First call
Section titled “First call”decuma dev --seed muster-gmbh (see Demo instance) prints address and api-key:
export DECUMA_URL=http://127.0.0.1:<port> DECUMA_API_KEY=<api-key>curl -s -X POST "$DECUMA_URL/v1/queries/journal.list" \ -H "Authorization: Bearer $DECUMA_API_KEY" -H 'Content-Type: application/json' \ -d '{"payload": {"pro_seite": 5}}'An API-Schlüssel is bound to its Mandant and carries a Freigabeklasse; what it may do without a person is set by the Freigaberichtlinie. A Freigabe of a Meldung, a yearly return or a payment is given by a person in the web app, never by a key. The SDKs wrap these routes: SDKs.
The sections below are what the web app relies on; it is a client of this API and nothing else. Every Command and query by domain, with payload and result: App contract.
Transport
Section titled “Transport”POST /v1/commands/{name}andPOST /v1/queries/{name}, body{"payload": {...}}(rationaleoptional).- Every request of the app carries
X-Decuma-Client: web. The session cookie is accepted only together with this header, so a foreign page cannot trigger a Command (a request without it isnot_authenticated). Accept-Language: deoren: the language the app shows. It chooses the language ofdetail,next_step, warningtext, readiness texts and outgoing mail. Without it the Account’s storedspracheapplies, then English.Decuma-Mandant: <uuid>on every Mandant-scoped call (scope “Mandant” in the App contract).- Session: a successful
session.sign_inwithX-Decuma-Client: websets the cookiedecuma_sitzung(HttpOnly, SameSite=Strict, Path=/, Secure except underdecuma dev, Max-Age until the session expires) and leavestokenout of the body.session.sign_out,session.end_all,account.deleteandaccount.reset_passwordclear it. - A repeated
Idempotency-Keywith the same payload returns the first result unchanged and runs nothing, plus the warningdublette(“this request arrived before”) unless the first result carries one. Access is checked first; a counted limit of the installation (Policy::limit, ADR 0054) does not refuse the repeat. - A refusal is
application/problem+json:{type, title, status, code, detail, next_step, next_command};next_commandis the Command the English next step names (null when it names none), the same in every language, for an agent. Codes and statuses:validation422,not_authenticated401,not_allowedandneeds_human403,unknown_commandandnot_found404,idempotency_conflictandconflict409,internal500. The app rendersdetailandnext_stepas they arrive. - A successful Command or query may carry
warnings: [{code, text, next_command?}]in its result object (a result that is not an object comes as{result, warnings});next_commandis the Command or query the English text names, the same in every language, for an agent; the German text is read by people and names no Command or field. One mechanism of the executor adds them for every Command and query on REST, MCP and the CLI (a warning a result carries as a field already is not repeated). The app shows them with one component (Warnungen); the Fristen screen showsannual_return_questionas its note with a link to Steuern > Einstellungen.
Routes besides the registry
Section titled “Routes besides the registry”| Route | Use |
|---|---|
GET / and static files |
the embedded app (app/dist); Content-Security-Policy: default-src 'self'; img-src 'self' data: blob:; frame-src 'self' blob:; style-src 'self' 'unsafe-inline'; frame-ancestors 'none'; base-uri 'none'; files under assets/ are cached as immutable, everything else no-cache; without a build of the app / is a one-line placeholder |
GET /bank/callback |
the app (index.html), where a bank sends the account holder back with state and code or error (ADR 0058). The app reads the query once, removes it from the address (history.replaceState), never shows or logs it, and calls bank_connection.complete |
GET /health |
{status, time} |
GET /v1/openapi.json |
the OpenAPI document of this instance |
GET /v1/files/{ref} |
download of a file reference (download_url of mandant.export). Same credentials and headers as a Mandant query (X-Decuma-Client: web, the cookie, Decuma-Mandant); the app fetches it and saves the blob. Bound to the session or key that asked for it; expires at gueltig_bis. |
POST /v1/files and GET /v1/files/{hash} |
upload and download of a Beleg’s file (Books 1); both are in the OpenAPI document. CLI: a base64 field (contentEncoding: base64) takes @PATH, decuma download <hash or ref> --to <path> downloads |
GET /dev/post |
decuma dev only: the mail sink, [{an, betreff, text, link}], oldest first |
PUT /dev/clock |
decuma dev only: {time} moves the instance clock |
List queries
Section titled “List queries”mandant.list, api_key.list and session.list take one parameter schema (Listenabfrage) and answer one shape (Liste):
- Payload, every field optional:
text(substring, case-insensitive, over the list’s text columns),vonandbis(datesYYYY-MM-DD, inclusive, over the list’s date column),filter({column: [values]}, the list’s categorical columns),sortierung(columnascending or-columndescending),seite(from 1, default 1),pro_seite(default 50, at most 500),format(jsondefault, orcsv). - Result:
{zeilen: [...], gesamt, alle, seite, pro_seite, csv}:zeilenis the page,gesamtthe number of rows after the filters,allebefore them (“n von m”),csvwithformat: "csv"every filtered row in the sorted order as CSV text (null otherwise). A technical list refusescsvwithvalidation.
| List | text | date | categorical | sortable | CSV |
|---|---|---|---|---|---|
mandant.list |
anzeigename |
erstellt_am |
mandantenart |
anzeigename, mandantenart, erstellt_am |
yes |
api_key.list |
bezeichnung |
erstellt_am |
status (aktiv, widerrufen, abgelaufen) |
bezeichnung, erstellt_am, gueltig_bis |
no |
session.list |
adresse |
erstellt_am |
erstellt_am, laeuft_ab_am |
no |