Timesheets API
Time logged against a project — or against a record that is not one.
Base path: /timesheets. Reads gate on two-segment timesheets:read and
row-filter to the caller's own entries unless they hold timesheets:read:all.
Single-entry mutations are own-only for members on the same rule.
| Method | Path | Permission | Tool |
|---|---|---|---|
| POST | /timer/start | timesheets:create:self | start_timer |
| POST | /:id/stop | timesheets:update:self | stop_timer |
| GET | /timer/active | timesheets:read | get_active_timer |
| POST | / | timesheets:create:self | log_time |
| GET | / | timesheets:read | list_timesheets |
| GET | /summary | timesheets:read | timesheet_summary |
| GET | /grid | timesheets:read | — |
| POST | /grid/cell | timesheets:update:self | set_timesheet_cell |
| GET | /rates | timesheets:approve:all | — |
| PUT | /rates/:userId | timesheets:approve:all | — |
| POST | /invoice | timesheets:approve:all | — |
| GET | /:id | timesheets:read | get_timesheet |
| GET | /:id/logs | timesheets:read | timesheet_logs |
| PATCH | /:id | timesheets:update:self | update_time_entry |
| DELETE | /:id | timesheets:delete:self | delete_time_entry |
| POST | /:id/submit | timesheets:update:self | submit_timesheet |
| POST | /:id/approve | timesheets:approve:all | approve_timesheet |
| POST | /:id/reject | timesheets:approve:all | reject_timesheet |
What an entry is for
An entry is project work or anchored to another record, never both and never
neither. POST / takes either project_id, or res_model + res_id where
res_model is one of helpdesk.ticket or crm.lead. Anything else is
refused by name rather than ignored.
An anchored entry can never be billable: no sale order line, no billing rate,
no billing amount, is_billable: false. Billing flows from the project, so
there is no path from an entry without one to an invoice. Cost still accrues —
what the org pays the worker is true either way.
Money on the wire
Rates are millicents per hour (cost_rate_millicents,
billing_rate_millicents) — thousandths of a minor unit, because a cost rate
is salary ÷ working hours and is almost never a whole cent. Amounts are minor
units (cost_amount_cents, billing_amount_cents) and are stored, not
derived: the ledger post, the project rollup and the invoice line read the
same number. null means "no rate", which is not the same fact as zero, and
an amount never travels without its currency.
Retries
log_time and start_timer accept external_key. A second call with the
same key returns the entry the first one made rather than booking the hours
twice. The by-id transitions (submit, approve, reject, stop, update,
delete) do not take one: they mutate a single identified row and cannot
duplicate anything.
start_timer answers 409 when a different timer is already running —
one per user — and a replay of the same key returns that timer instead.
Billing approved time
POST /invoice drafts invoices from approved, billable, un-invoiced hours in
a date window. It is not agent-exposed, including its dry run: an agent
that can enumerate what a customer would be billed is a disclosure surface.
Entries are grouped by (customer, currency). Anything that cannot be billed
is reported, not dropped — skipped carries a reason per group:
billed_by_sales (the entry has a sale order line, so Sales bills it through
delivered quantity), no_contact, ambiguous_contact (the project matches
more than one customer — refused rather than guessed), no_rate,
no_currency, no_tax_rate. dry_run: true computes the same grouping and
writes nothing.