Skip to content
github-actions[bot] edited this page Aug 3, 2026 · 2 revisions

REST API

Teedy exposes a full REST API under /api/*. Everything the web UI does is a call to this API, so anything you can do in the browser you can automate.

Interactive API docs

Teedy ships a browsable, interactive API reference (Swagger UI) at /apidoc. It is served as static assets with no external/CDN dependencies and is reachable without a session, so you can explore every endpoint, expand an operation, and use Try it out to call the live API against your instance.

The /apidoc Swagger UI listing the Teedy API operations grouped by tag.

The endpoint references embedded throughout this documentation (each feature page lists its endpoints) and the examples below complement the interactive reference.

Authentication

Two mechanisms authenticate an API request:

Session cookie

A normal browser login sets a session cookie. Scripts can log in via POST /api/user/login (form params username, password) and reuse the returned cookie for subsequent calls.

API key (recommended for scripts)

Create API keys in Settings → API Keys. Send the key in the Authorization header:

Authorization: Bearer tdapi_<your-key>

An API key acts as the creating user and has exactly that user's permissions. The raw key is shown only once at creation — store it securely.

Request format

Mutations use application/x-www-form-urlencoded bodies (form parameters), not JSON. File uploads use multipart/form-data on PUT /api/file.

Key resources

Resource Purpose
/api/document Documents (CRUD, search, trash)
/api/file Files attached to documents (upload, versions)
/api/tag Tags
/api/user Users, login, password
/api/apikey API keys
/api/acl Access-control entries (sharing/permissions)
/api/group Groups
/api/comment Comments
/api/metadata Custom metadata fields
/api/vocabulary Controlled vocabularies
/api/route, /api/routemodel Workflows (routes and route models)
/api/tagmatchrule Auto-tagging rules
/api/webhook Webhooks
/api/auditlog Audit log
/api/theme Branding: name, colors, images, custom CSS and JavaScript (admin)
/api/oidc OIDC login/callback
/api/app Application info (version, status)

Examples

Log in and reuse the cookie:

curl -c cookies.txt -X POST https://teedy.example.com/api/user/login \
  -d "username=admin" \
  -d "password=changeme"

Create a document with an API key:

curl -X PUT https://teedy.example.com/api/document \
  -H "Authorization: Bearer tdapi_<your-key>" \
  -d "title=Invoice 2026-001" \
  -d "language=eng"

Upload a file to that document:

curl -X PUT https://teedy.example.com/api/file \
  -H "Authorization: Bearer tdapi_<your-key>" \
  -F "id=<document-id>" \
  -F "file=@invoice.pdf"

Check the running version:

curl https://teedy.example.com/api/app

See also

Clone this wiki locally