Docs / Interfaces11 min readEdit on GitHub

API reference#

This page lists every HTTP route, the WebSocket and the MCP endpoint the backend serves, with what each one does, how it identifies the repository, and the error codes it can return. The routes are defined in the sixteen routers in server/app/api/v1/, registered in server/app/main.py. The interactive OpenAPI page FastAPI generates at /docs lists the request and response models; this page explains the behaviour around them.

Terms used on this page#

  • {repo_id}: a repository's UUID. Most repository routes use it.
  • {repo_num}: a repository's integer repo_number. Exactly one route uses it: GET /api/v1/repository/{repo_num}, which the web routes call to turn /repo/3 into a repository.
  • Session: the JWT that identifies the caller. Browsers send it as the httponly access_token cookie; the mobile app sends it as Authorization: Bearer. See authentication.
  • Ready: a repository whose status is ready. Several routes refuse anything else.
  • SSE: server-sent events, a one-way stream of event: and data: lines over a normal HTTP response.

Conventions#

ConventionRule
base pathevery route is under /api/v1, except /healthz, /openapi.json, /docs and /mcp
authenticationevery route needs a session except the public paths below; a missing or invalid session gets 401 from AuthMiddleware before any handler runs
ownershipanother user's repository returns 404, never 403, so a caller cannot learn that it exists
validationa body or query that fails its Pydantic model gets 422 with FastAPI's standard error body
errors{"detail": "..."} with a readable message; the web client shows detail where it makes sense
cachingnone: responses carry no cache headers, and clients fetch with cache: "no-store"
paginationpage (from 1, capped by PageNumber in app/api/validation.py) and page_size, with a total in the response
versioningonly /v1; a breaking change to a response breaks the web client, mobile app and MCP clients together

Public paths (from public_paths in app/middleware/auth.py, matched with startswith): /healthz, /api/v1/auth/login, /api/v1/auth/register, /api/v1/auth/logout, /api/v1/auth/github, /api/v1/auth/github/callback, /api/v1/contact, /api/v1/ws, /openapi.json. /mcp bypasses the cookie check because it does its own bearer-token authentication. Prefix matching means any path that begins with a public prefix is also public; this is a known issue.

Repositories#

Router repository.py, prefix /api/v1/repository.

Method and pathDoesSuccessErrors
POST /api/v1/repositorycreates a repository from github_url (exactly https://github.com/<owner>/<repo>), optional branch and commit_sha, and queues the ingest202 with repo_id and repo_num402 when a keyless user has spent the three free ingestions; 422 for a URL on any other host
GET /api/v1/repositorylists the caller's repositories, newest first, with truncated summaries200
GET /api/v1/repository/{repo_num}one repository by its number200404
PUT /api/v1/repository/{repo_id}/reingestdeletes the row and every child row, recreates it with the same id and number, and queues a full ingest202400 unless the status is ready or failed; 402 when the caller has no key of their own (re-ingest, sync and turning on auto-update are never free)
PATCH /api/v1/repository/{repo_id}/auto-updateturns auto-update on or off and sets interval_hours200422 unless the interval is 1, 3, 6, 12 or 24; 402 when turning it on without a key of the owner's own
POST /api/v1/repository/{repo_id}/syncqueues a sync now202402 without a key of the owner's own; 409 when auto-update is disabled by the deployment, when there is no ingested commit to compare with, or when a sync is already running; 503 if the task could not be queued
DELETE /api/v1/repository/{repo_id}deletes the repository and everything under it204
GET /api/v1/repository/{repo_id}/export/illumethe .illume text export, as a download200 text/plain400 unless ready

Four more routes, in the same router, control the repository's read-only share link. Each is owner-only (404 for another user's repository) and none returns the link except the response that creates it.

Method and pathDoesSuccessErrors
GET /api/v1/repository/{repo_id}/sharewhether sharing is on: enabled and shared_at200404
PUT /api/v1/repository/{repo_id}/shareturns sharing on; when it was off, mints the link and returns url_path (/share/<token>) once200; url_path is null when sharing was already on404
POST /api/v1/repository/{repo_id}/share/regeneratemints a new link, which invalidates the old one at once; also turns sharing on; returns the new url_path once200404
DELETE /api/v1/repository/{repo_id}/shareturns sharing off; the link then answers 404204404

The link survives re-ingest: the replacement row inherits the share digest and shared_at. See read-only share links.

See ingestion, auto-update and the export format.

Repository data#

All GET, all under /api/v1/repository, all read-only, all 404 for another user's repository.

PathRouterReturnsNotes
/{repo_id}/graph?level=filegraph.pythe file- or symbol-level dependency graph (level=file or symbol)409 unless ready; 500 if the build fails; no node cap
/{repo_id}/graph/thumbnailgraph.pya condensed file graph for a repository card's picture
/{repo_id}/guideguide.pythe reading order (position, file_path, annotation, fan_in; the tier is dropped) and the architecture brief404 when no guide exists yet
/{repo_id}/statsstats.pyfile, language, ownership and dependency totals
/{repo_id}/activity?limit=6activity.pythe latest merged pull requests and commits, newest first (limit 1 to 30)
/{repo_id}/file?path=…&commits=3file_detail.pyone file's symbols and its most recent commits (commits 0 to 20)404 for an unknown path
/{repo_id}/ownershipownership.pyper-file owners, contributors and bus factor, paginated, with an optional exact file_path filter (page_size up to 200)
/{repo_id}/ownership/silosownership.pyfiles whose bus factor is one
/{repo_id}/glossaryglossary.pyglossary entries, paginated (page_size up to 100), filterable by file path and by first letter (# for non-letters)
/{repo_id}/glossary/searchglossary.pyglossary entries matching a query (page_size up to 100)

See the dependency graph and git intelligence.

Shared repositories#

Router share.py, prefix /api/v1/share/{token}. No session is needed: the token in the path, minted by the owner, is the credential. All routes are GET, read-only, rate limited per client address (429 with Retry-After, 120 requests a minute), and answer Cache-Control: no-store and X-Robots-Tag: noindex. An unknown, malformed, regenerated or switched-off token is one generic 404 {"detail": "This share link is not available."} on every route. Every route except the summary answers 409 until the repository is ready. Each reuses the loader behind the owner's route of the same data, so the payloads match, minus the fields noted.

PathSame data asLeft out or changed
/the repository summaryname, GitHub URL, branch, commit, status, stack, brief text and timestamps only; any status
/guide/{repo_id}/guideno repository_id, no pdf_ready
/stats/{repo_id}/statsno repository_id
/activity?limit=6/{repo_id}/activity
/glossary/{repo_id}/glossarypage_size up to 100
/glossary/search?q=/{repo_id}/glossary/search
/graph?level=file/{repo_id}/graphidentical payload; level is file or symbol
/ownership/{repo_id}/ownershipevery contributor's email is null
/file?path=...&commits=3/{repo_id}/filestored symbols and commits only; the file's contents are never served

There is no chat, MCP, export, re-ingest, sync or settings route under a token.

Chat and conversations#

Method and pathRouterDoesErrors
POST /api/v1/repository/{repo_id}/chat/streamagent.pyanswers with any preset, or auto, and streams the run as SSE; the web client's chat400 when an agent preset's model cannot call tools; 402 without a usable key or free allowance (agent presets and auto need the caller's own key); 422 for overrides that do not fit the preset; 429 when the caller has no free run slot
GET /api/v1/repository/{repo_id}/agent-runs?limit=20agent.pythe caller's runs on the repository, newest first (limit up to 100)
POST /api/v1/repository/{repo_id}/chatchat.pyanswers with the Classic pipeline and returns one JSON response; the mobile app's chat400 unless ready; 402 without a key or free allowance; 502 when the provider fails
GET /api/v1/repository/{repo_id}/chat/history?conversation_id=…chat.pyturns in chronological order, with their sources
GET /api/v1/repository/{repo_id}/chat/{message_id}/changeschat.pywhat changed in the repository since a stale answer was written404
DELETE /api/v1/repository/{repo_id}/chat/{message_id}chat.pydeletes one turn404
DELETE /api/v1/repository/{repo_id}/chatchat.pydeletes every conversation the caller has on the repository
GET /api/v1/repository/{repo_id}/conversationsconversations.pythe caller's conversations, most recently active first
POST /api/v1/repository/{repo_id}/conversationsconversations.pycreates an empty conversation201
PATCH /api/v1/repository/{repo_id}/conversations/{conversation_id}conversations.pyrenames it404
DELETE /api/v1/repository/{repo_id}/conversations/{conversation_id}conversations.pydeletes it and its turns404
GET /api/v1/repository/{repo_id}/conversations/{conversation_id}/messagesconversations.pyits turns in order404

The stream's event names and payloads are in the chat agent's events, and the request body (question, preset, conversation, overrides) in chat. Questions are capped by QuestionText and replayed history by HistoryContentText in validation.py.

Account#

Router auth.py, prefix /api/v1/auth.

Method and pathDoesErrors
POST /registercreates an account and sets the session cookie201; 400 if the email is taken
POST /loginchecks the password and sets the session cookie401
POST /logoutclears the cookie
GET /methe signed-in user, free-tier counters and limits, whether a key is saved, and mcp_enabled401
DELETE /medeletes the account and everything it owns; the body must repeat the account's email204; 400 when the email does not match
GET /githubredirects to GitHub's OAuth page302
GET /github/callbackfinishes OAuth, signs in or links the GitHub account, stores the token encrypted, and redirects400 when GitHub refuses or returns no verified email
GET /me/ai-credentialsthe saved provider and model, never the key
PUT /me/ai-credentialssaves a provider key after a live probe of the provider422 for an unknown provider; 400 with the provider's name when the probe fails
DELETE /me/ai-credentialsremoves the saved key
GET /me/agent-settingsthe default preset and agent options
PUT /me/agent-settingssaves them422
GET /me/mcp-tokensthe caller's MCP tokens, without their secrets
POST /me/mcp-tokenscreates a token and returns its plaintext once201; 409 at the limit of active tokens
DELETE /me/mcp-tokens/{token_id}revokes a token204

The GitHub callback, called with X-Illume-Client: mobile or an allow-listed deep-link state, returns the JWT in JSON or in the redirect instead of a cookie, with the 90-day mobile lifetime. See authentication and BYOK and encryption.

GitHub proxy#

Router github_proxy.py, prefix /api/v1/github. These call the GitHub REST API with the caller's stored token, so the browser never holds it. They feed the repository picker and its branch timeline.

Method and pathDoes
GET /repos?per_page=30&q=…the caller's GitHub repositories, newest first, filtered by name
GET /repos/{owner}/{repo}/branchesbranches, with the default flagged
GET /repos/{owner}/{repo}/commits?sha=…&per_page=40commits on a branch or from a SHA
GET /repos/{owner}/{repo}/commits-multibranchrecent commits merged across up to five branches, newest first

Errors: 403 when no GitHub account is linked, 401 when the stored GitHub token has expired, 404 for a repository GitHub does not show the caller, 502 for an unexpected GitHub response and 504 on a timeout.

Push notifications and contact#

Method and pathRouterDoes
POST /api/v1/push/tokenpush.pyregisters or refreshes the calling device's Expo push token
GET /api/v1/push/tokenpush.pywhether a token is registered
DELETE /api/v1/push/tokenpush.pyremoves it
POST /api/v1/contactcontact.pyemails a contact-form submission to the operator through Resend. Public. 503 when the contact variables are empty, 502 or 504 when Resend fails

The ingest WebSocket#

WS /api/v1/ws/ingest/{repo_id} in ws.py relays the ingest's progress frames. It accepts the socket first, then authenticates from the cookie or the ?token= query parameter, and closes with code 1008 and a reason when the caller is not the owner. Frames are JSON with event, message, stage and phase. WebSockets documents every frame.

Health and schema#

PathDoes
GET /healthz{"status": "ok", "checks": {"redis": "ok"}} with 200, or "degraded" with 503 naming the failing check. It does not probe Postgres (why)
GET /openapi.jsonFastAPI's OpenAPI schema. Public
GET /docsFastAPI's interactive page. Not a public path, so it needs a session cookie on the API's host

The MCP endpoint#

/mcp is a streamable-HTTP MCP server mounted inside the API. Clients authenticate with Authorization: Bearer ilm_…, a personal token created in Settings. It answers 401 with WWW-Authenticate: Bearer for a bad token, 404 everywhere when the MCP_ENABLED switch is off, and 413 for a body over 1 MiB. It also checks Host and Origin. It serves:

  • Account tools: whoami and list_repositories.
  • Repository tools: every agent tool except finish, each taking a repo argument.
  • ask_illume: a full chat answer with citations.
  • Resources and prompts.

The MCP server documents each one, the rate limits and who pays.

Design trade-offs and limits#

  • Mixed identifiers. One route keys on repo_num and every other repository route on repo_id, so a client needs both.
  • No rate limiting on most routes. Only the MCP endpoint, the agent's run slots and the free-tier counters limit request volume; login and register are unthrottled.
  • Prefix-matched public paths. A new route under a public prefix is public by accident.
  • No pagination on the graph. GET /graph returns every node and edge, so a very large repository produces a very large response.
  • Two chat endpoints. POST /chat (Classic only, one JSON response) and POST /chat/stream (every preset, streamed) differ in what they can do; the mobile app uses the first.
  • Status codes are not uniform. Re-ingesting a busy repository answers 400, while syncing a busy one answers 409.