Repository navigation
API
Everything goes through a JSON API under /api. The web app, the CLI and the MCP server are its clients; so can be your scripts. The full contract is docs/swagger.yaml (OpenAPI, generated from the routes), and the rules behind it are in the reference.
make api # in Docker, with WEB_ORIGIN set in .env
go run ./cmd/tide-server serve --origin http://localhost:3000 # or directly on the machine| Flag | Role |
|---|---|
--addr |
Listening address, 127.0.0.1:8080 by default |
--origin |
The allowed origin of the web app |
--web |
A folder of the generated app, served at the same address as the API |
--add-user-mode |
Who creates an account: invitation (default) or public
|
--published |
In a container, the address published on the machine side (TIDE_LISTEN) |
--mcp-addr |
Also serves the MCP tools over HTTP at /mcp on that address, with its OAuth |
--mcp-published |
The MCP's address on the machine side (TIDE_MCP_LISTEN) |
Everything but POST /login, GET /add-user, POST /signup and the CLI's POST /device/code and POST /device/token requires a session, otherwise 401.
-
Session cookie. Login sets a
tide_sessioncookie (HttpOnly,Secure,SameSite=Strict), which lasts 30 days extended at each request. This is the web app's. -
Bearer token. A script sends
Authorization: Bearer <token>. A CLI token (tide_cli_…) comes fromtide login; an API token (notes_…) fromtide add tokenor Settings > Applications.
An API token does everything the account does on notes, folders, tags and files, but does not manage the account: its tokens, its password, its settings, the purge, the logout and the admin routes answer 403. A --read-only token reads and changes nothing. The database only keeps the token's fingerprint (SHA-256). A CLI token acts as the account, but its password and the admin's routes (/me/password, /users, /invites) answer 403. Both kinds show their kind (api or cli) in the token list. An expired token is refused (401), then purged by the hourly cleanup.
The prefix is /api.
| Resource | Routes |
|---|---|
| Accounts (admin) |
GET, DELETE /users/{id}, GET, POST /invites, DELETE /invites/{id}
|
| Account creation |
GET /add-user[?invite=<token>], POST /signup
|
| CLI login |
POST /device/code, POST /device/token (public, the CLI's), POST /device/approve (the web app's, with a session) |
| Account |
POST /login, POST /logout, GET, PATCH /me, PATCH /me/password, DELETE /me/data
|
| Notes |
POST /notes, GET, PATCH, DELETE /notes/{id}, GET /notes/{id}/neighbors, GET /pinned
|
| Versions |
GET, POST /notes/{id}/versions, GET /notes/{id}/versions/{version}
|
| Folders |
GET, POST /folders, GET, PATCH, DELETE /folders/{id}
|
| Browse |
GET /items?parent=<uuid>, POST /move
|
| Tags |
GET, POST /tags, GET, PATCH, DELETE /tags/{value}
|
| Graph |
GET /graph, GET /graph/notes
|
| Search |
GET /search?q=<text>, GET /recent
|
| Links | GET /links/broken |
| Trash |
GET, DELETE /trash, DELETE /trash/{id}, POST /restore
|
| Export and import |
GET /export (zip), POST /import?parent=<uuid>
|
| Images and attachments |
GET /files, POST /files?name=<name>, GET /files/{id}
|
| Live changes |
GET /events (server-sent events) |
The exact bodies and answers are in the OpenAPI file.
Errors have the form {"error": "..."}, with status 400, 401, 403, 404, 409, 413, 415, 429 or 500. Only an unknown route (404) and an unhandled method (405) answer in plain text.
-
PATCH /notes/{id}only changes the fields sent.{"pinned": true}alone pins the note without touching its text or its modification date. It answers the complete note. - Without
tags, the tags are the#wordsof the content. Withtags, this list rewrites the content:"tags": []erases all its#words. -
{"readonly": true}locks the note:contentandtagsare then refused (409), unless with"readonly": falsein the same request. - With
updated_at(read byGET, orcreated_atfor a note never modified),contentandtagsare refused (409) if the note changed since: a device left open never overwrites what another wrote. -
POST /notes/{id}/versionswith{"content": "..."}keeps a text refused by a 409 as a version markedconflict, so as not to lose it. - The API refuses a
titlefield for a note: the title comes from the text (Titles and tags).
GET /api/events is a stream of server-sent events: the account's changes, whichever client made them. The web app uses it to refresh. Your reverse proxy must not buffer it.
The web app calls /api on its own origin in production, and on NUXT_PUBLIC_API_BASE in development. A page outside WEB_ORIGIN cannot call the API.
Tide
Using Tide
Terminal and agents
Hosting and development