Skip to main content

API reference

Every route below is mounted from one array, API_ROUTES in packages/server/src/api/v1/routes-table.ts, and this page and the OpenAPI document are both generated from it. A route cannot exist here and not in the server, or in the server and not here.

All paths are relative to https://api.trackyourtime.dev/api/v1. Every route but /openapi.json needs Authorization: Bearer tt_…. Parameters says where a route's input goes: query for a GET filter, body for JSON, path for the id in the URL. Full field-level shapes live in the OpenAPI document.

Entries

MethodPathScopeParametersWhat it does
GET/entriesentries:readqueryList time entries overlapping a date range.
GET/entries/currententries:readThe caller's running timer in this workspace, or null when none is running here.
GET/entries/:identries:readpathOne time entry.
POST/entriesentries:writebodyCreate a completed entry with an explicit start and end.
PATCH/entries/:identries:writebodyEdit an entry. Author-only, and refused once it is invoiced.
DELETE/entries/:identries:writepathDelete an entry. Author-only, and refused once it is invoiced.
POST/entries/startentries:writebodyStart a timer, stopping this workspace's running one first. Answers 409 when the timer is running in another workspace, which this token may not stop.
POST/entries/stopentries:writebodyStop the timer running in this workspace.

Clients

MethodPathScopeParametersWhat it does
GET/clientscatalog:readqueryList clients.
GET/clients/:idcatalog:readpathOne client.
POST/clientscatalog:writebodyCreate a client.
PATCH/clients/:idcatalog:writebodyEdit a client.
POST/clients/:id/archivecatalog:writebodyArchive or unarchive a client.
DELETE/clients/:idcatalog:writepathDelete a client. Its projects keep their time and lose the link.

Projects

MethodPathScopeParametersWhat it does
GET/projectscatalog:readqueryList projects with rolled-up totals and budget progress.
GET/projects/:idcatalog:readpathOne project with its totals and budget progress.
POST/projectscatalog:writebodyCreate a project.
PATCH/projects/:idcatalog:writebodyEdit a project.
POST/projects/:id/archivecatalog:writebodyArchive or unarchive a project.
DELETE/projects/:idcatalog:writepathDelete a project and its tasks. Entries keep their time.

Tasks

MethodPathScopeParametersWhat it does
GET/taskscatalog:readqueryList tasks, optionally narrowed to one project.
GET/tasks/:idcatalog:readpathOne task.
POST/taskscatalog:writebodyCreate a task inside a project.
PATCH/tasks/:idcatalog:writebodyEdit a task.
POST/tasks/:id/archivecatalog:writebodyArchive or unarchive a task.
DELETE/tasks/:idcatalog:writepathDelete a task. Entries keep their time and lose the link.

Tags

MethodPathScopeParametersWhat it does
GET/tagscatalog:readqueryList tags with usage counts.
GET/tags/:idcatalog:readpathOne tag.
POST/tagscatalog:writebodyCreate a tag.
PATCH/tags/:idcatalog:writebodyEdit a tag.
DELETE/tags/:idcatalog:writepathDelete a tag, or archive it when tracked time still carries it.

Reports

MethodPathScopeParametersWhat it does
GET/reports/summaryreports:readqueryTotals, a grouped breakdown, and a zero-filled daily series.
GET/reports/detailedreports:readqueryA paginated entry log; totals span the whole filtered range.
GET/reports/weeklyreports:readqueryA seven-day timesheet grid, one row per project and task.

Meta

MethodPathScopeParametersWhat it does
GET/meany valid tokenThe calling token, its workspace, its scopes and what it may see.
GET/openapi.jsonnone — publicThis API's OpenAPI 3.1 document.

The document itself

  • openapi.json — the committed copy this site serves.
  • GET /api/v1/openapi.json — the live one, unauthenticated, generated per request from the running server's own route table. Point a client generator at it.