Skip to content
CliprWiki

HTTP API

Conventions of the JSON API and the complete list of endpoints.

Clipr's interface talks to the server only through this API. It is built for Clipr's own interface, not as a public, versioned interface – endpoints may change with any version.

Conventions

  • Format: JSON both ways; uploads as multipart/form-data.
  • Session: cookie __Host-clipr_session (HttpOnly, Secure, SameSite=Strict). Without a valid session, protected endpoints answer 401.
  • CSRF: every writing request (POST, PUT, PATCH, DELETE) needs the header x-clipr-request: 1; an Origin, if present, must match the own host. Foreign pages cannot send the header without a CORS grant.
  • Language: x-clipr-lang: de|en (set by the interface), otherwise Accept-Language. Error messages come in that language.
  • Two-factor requirement: if a session does not meet the requirement (CLIPR_2FA_REQUIRED), only setup, account info, reading settings and signing out are allowed; everything else answers 403 with "gate": true.
  • Vault: while it is locked, ticket endpoints answer 423 with "code": "vault_locked".
  • Sizes: JSON bodies at most 256 KB, uploads according to CLIPR_MAX_UPLOAD_MB, at most 10 files per request.

Errors

{"error": "Field “Title” missing", "code": "validation", "field": "title"}
Status Meaning
400 Invalid request (JSON, parameters)
401 Not signed in (unauthenticated)
403 CSRF check (csrf), missing rights or two-factor requirement (gate)
404 Not found – also for objects of other accounts
409 Conflict, e.g. duplicate
413 Request too large
422 Validation (validation, with field)
423 Vault locked (vault_locked)
429 Too many attempts (throttling)

Endpoints

Path parameters in curly braces are numeric IDs (except {sid} for sessions). Public without sign-in are only sign-in, registration, password links, activation, invitation preview, /api/health and the SSO endpoints.

Sign-in and session

Method Path Purpose
GET /api/auth/config Public sign-in options (registration, passkeys)
POST /api/auth/login Sign in; may ask for the second factor
POST /api/auth/mfa Second factor: TOTP or backup code
POST /api/auth/mfa/passkey/options Second factor: prepare passkey challenge
POST /api/auth/mfa/passkey Second factor: verify passkey response
POST /api/auth/logout Sign out
GET /api/auth/me Signed-in account, offers, invitations, storage
POST /api/auth/register Register (if enabled)
POST /api/auth/verify Confirm email address
POST /api/auth/resend Resend confirmation email
POST /api/auth/activate/info Check activation link (account created by admins)
POST /api/auth/activate Activate account, set password
POST /api/auth/forgot Request reset link
POST /api/auth/reset Reset password via link
POST /api/auth/password Change password
GET /api/auth/sessions Signed-in devices
DELETE /api/auth/sessions/{sid} Sign out one device

Account and two-factor

Method Path Purpose
PATCH /api/account Change profile (name, username)
DELETE /api/account Delete account (with password)
POST /api/account/email Change email address (confirmation link)
GET /api/account/events Security log
GET /api/account/mfa Two-factor status
POST /api/account/mfa/totp/setup Set up authenticator app: key and QR code
POST /api/account/mfa/totp/confirm Confirm authenticator app with a code
POST /api/account/mfa/totp/disable Remove authenticator app
POST /api/account/mfa/passkeys/options Prepare passkey registration
POST /api/account/mfa/passkeys Register passkey
POST /api/account/mfa/passkeys/{pid}/delete Remove passkey
POST /api/account/mfa/backup Regenerate backup codes
GET /api/settings Account settings
PUT /api/settings Change settings
GET /api/export Backup as ZIP

Vault

Method Path Purpose
GET /api/vault Mode, locked, lock time
POST /api/vault/enable Turn vault on
POST /api/vault/unlock Unlock with vault password
POST /api/vault/recover Unlock with recovery code
POST /api/vault/lock Lock
POST /api/vault/password Change vault password
POST /api/vault/recovery-code Generate new recovery code
POST /api/vault/disable Turn vault off

Tickets and stacks

Method Path Purpose
GET /api/meta Fixed lists: reasons for lifted train binding, pass types, deadlines
GET /api/tickets All tickets, stacks, suggestions, notices, outbox
POST /api/tickets/upload Import files (multipart, field files, optional force_kind)
POST /api/tickets/seen Mark tickets as seen
POST /api/notices/ack Acknowledge notices
POST /api/tickets/bulk-status Set status for several tickets (e.g. archive)
GET /api/tickets/{tid} One ticket with journeys and sharing
PATCH /api/tickets/{tid} Change ticket
DELETE /api/tickets/{tid} Delete or return ticket
POST /api/tickets/{tid}/reprocess Re-detect
GET /api/tickets/{tid}/file Original file (decrypted)
GET /api/tickets/{tid}/ocr-layer Recognised text with positions for the text layer
GET /api/tickets/{tid}/code.png Code image
GET /api/tickets/{tid}/calendar.ics Calendar entry
PUT /api/tickets/{tid}/pass Treat as pass or set validity
POST /api/tickets/{tid}/journeys Add journey
PATCH /api/journeys/{jid} Change journey (train binding, used)
DELETE /api/journeys/{jid} Remove journey
DELETE /api/tickets/{tid}/stack Remove ticket from its stack
POST /api/tickets/{tid}/apply-to-stack Copy details or notes to the stack
POST /api/stacks Create stack
PATCH /api/stacks/{sid} Rename stack
DELETE /api/stacks/{sid} Dissolve stack
POST /api/stacks/{sid}/tickets Add tickets to stack

Codes

Method Path Purpose
GET /api/tickets/{tid}/code-candidates Codes recognised in the document
POST /api/tickets/{tid}/codes Assign code or stack it as a new ticket
DELETE /api/tickets/{tid}/code Detach code from ticket

Mailbox

Method Path Purpose
GET /api/mail/status System-wide fetch settings
GET /api/mail/accounts Mailboxes
POST /api/mail/accounts Create mailbox
PATCH /api/mail/accounts/{aid} Change mailbox
DELETE /api/mail/accounts/{aid} Remove mailbox
POST /api/mail/test Test connection
POST /api/mail/accounts/{aid}/run Fetch now
GET /api/mail/accounts/{aid}/log Log
DELETE /api/mail/log/{lid} Reset log entry (check email again)

Groups and sharing

Method Path Purpose
GET /api/groups Own groups and memberships
POST /api/groups Found group
PATCH /api/groups/{gid} Rename group
DELETE /api/groups/{gid} Dissolve group
POST /api/groups/{gid}/leave Leave group
DELETE /api/groups/{gid}/members/{mid} Remove member
POST /api/groups/{gid}/invites Invite (email or search hit)
DELETE /api/groups/{gid}/invites/{iid} Withdraw invitation
POST /api/groups/search Search people (findable only, exact)
POST /api/groups/join Join via invitation link
POST /api/invites/preview Check invitation link (public)
GET /api/invitations Open invitations to me
POST /api/invitations/{iid}/accept Accept invitation
POST /api/invitations/{iid}/decline Decline invitation
GET /api/contacts People from shared groups
POST /api/tickets/{tid}/share Offer ticket to a person
DELETE /api/tickets/{tid}/share Withdraw offer or share
POST /api/tickets/{tid}/share/resend Resend lapsed change
POST /api/tickets/{tid}/transfer Hand over ticket completely
GET /api/offers Ticket offers to me
POST /api/offers/{pid}/accept Accept offer
POST /api/offers/{pid}/decline Decline offer

Administration (admins only)

Method Path Purpose
GET /api/admin/users Accounts with search and filter
POST /api/admin/users Create and invite account
GET /api/admin/users/{uid} One account
PATCH /api/admin/users/{uid} Change account (lock, admin role)
DELETE /api/admin/users/{uid} Delete account
POST /api/admin/users/{uid}/invite Resend invitation
POST /api/admin/users/{uid}/mfa-reset Reset two-factor sign-in
GET /api/admin/system System status and configuration
POST /api/admin/test-mail Send test email

Other

Method Path Purpose
GET /api/health Health for health checks (public)
POST /share-target Web Share Target: fallback when the service worker is missing
GET /sso/authorize Single sign-on: issue ticket (browser redirect)
GET /sso/keys Single sign-on: public keys
POST /sso/introspect Single sign-on: is a sign-in still valid?
POST /sso/revoke Single sign-on: end sign-in

The single sign-on endpoints have a page of their own. A test (wiki/tests/test_docs.py) ensures that every endpoint of the app is listed here.