cardinal

Routes

Every HTTP path a Cardinal node answers, and which code answers it.

A node matches paths top to bottom. The host picks the site, and an unknown host is a 404. Every /api error uses the {"error": {...}} envelope.

API

PathAnswered byDetails
/healthRouterAuth and setup API
/api/auth/*RouterLogin, logout, me, keys, passwords, sessions
/api/setup/*Routerstate, regional-data, complete
/api/website/languageRouterLanguage picker cookie
/api/email/unsubscribeRouterA mail's unsubscribe link
/api/telegram/webhookRouterTelegram bot updates
/api/realtime/token, /api/realtime/websocketRouter, endpointRealtime
/api/desk/bootRouterThe desk's start-up data, with an ETag
/api/rec/*, /api/meta/*CardinalWeb.ApiREST API
/api/rpc/*CardinalWeb.ApiRPC functions
/api/file, /api/file/:nameCardinalWeb.ApiUpload and download
/api/desk/meta/:rectypeCardinalWeb.ApiThe desk meta bundle
/api/desk/client-script/:rectypeCardinalWeb.ApiEnabled Client Scripts as one JavaScript module
/api/desk/messages/:langCardinalWeb.ApiAn enabled Language's translation dictionary
/api/desk/user-settings/:rectypeCardinalWeb.ApiSaved list and report state, GET and POST
/api/print/pdf, /api/print/reportCardinalWeb.ApiPDFs
/api/blob/:app/*keyCardinalWeb.ApiFiles an app stores in the bucket, for signed-in users
/api/<app>/<route>The app's api_routes moduleOnly on a site with the app installed
Any other /api/*Router404

Desk endpoints

Method and pathNeedsAnswers
GET /api/desk/bootA session, or a guest on an unclaimed siteUser, roles, locale, settings, preferences, unread notifications, the RecType index, modules, workspaces, app plugins and versions, plus csrf_token. 304 when the ETag matches
GET /api/desk/meta/:rectype?v=TAGRead on the RecType{meta, children}: layout, field UI, list config and indicators. Cached as immutable when v is the current x-cardinal-meta
GET /api/desk/client-script/:rectype?v=TAGRead on the RecTypeA JavaScript module, cached the same way
GET /api/desk/messages/:lang?v=TAGA signed-in user, or a guest on an unclaimed siteOne JSON object of catalog keys. 404 for a code that is not enabled
GET, POST /api/desk/user-settings/:rectypeRead on the RecTypeThe saved state. POST merges top-level keys

:rectype may be the RecType name or its desk slug, such as sales-invoice.

PDFs

PathParametersNeeds
GET /api/print/pdfrectype, name, and optional format, settings, no_letterhead, letterhead, _langRead and print on the Record
GET /api/print/reportname, filters (a JSON object), and the letter head and language parametersThe report and print rights

Both render through Gotenberg and write an Access Log row. A sidecar that does not answer within 30 seconds is a 503.

curl -o inv.pdf -H "Authorization: token $KEY:$SECRET" \
  'https://erp.acme.com/api/print/pdf?rectype=Sales%20Invoice&name=SINV-0001'

Static files

PathServes
/desk, /desk/*The desk's index.html. The desk's own router shows its 404
/assets/desk/*The desk bundle, immutable
/assets/web/*The website bundle the auth pages load
/assets/apps/*Each app's desk plugin bundle
/assets/<app>/assets/*, /assets/<app>/<mount>/assets/*An app's own frontend files
/<mount>/*An app's own frontend, on a site with the app. A guest goes to /login

Bundles go out as their .gz copies to clients that accept gzip.

Website

Every other GET or HEAD goes to the website router. Other methods get 405.

These routes are reserved for core's own pages, and an app cannot claim them:

RoutePage
/loginLogin and forgot password
/logoutEnds the session
/update-passwordSet a password from a link, or change it
/accept-inviteAccept a User Invitation
/meThe signed-in user's page
/update-profile/<user>The edit-profile Web Form
/printviewA Record's print as HTML
/robots.txt, /sitemap.xmlCrawlers

The rest come from apps' www/ pages, Web Pages, Web Forms, redirects and route rules.

On this page