API REFERENCE

Time Entries API

A time entry records effort against a piece of work — a ticket, a project task, or another work item. Use this API to log entries directly, run live tracking sessions, and move entries through approval.

Log an entry

Point an entry at the work it belongs to with work_item_type and work_item_id, then describe the time with started_at, ended_at, duration_minutes, and billable_minutes. To attribute the work to someone other than the calling user, set user_id.

curl
curl https://algapsa.com/api/v1/time-entries \
  -H "X-API-Key: $ALGA_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "work_item_type": "ticket",
    "work_item_id": "tk_9c41",
    "started_at": "2026-06-02T14:00:00Z",
    "ended_at": "2026-06-02T15:30:00Z",
    "billable_minutes": 90,
    "notes": "On-site VPN repair"
  }'

Contract line resolution

When you create or update a billable time entry via the REST API, AlgaPSA resolves the contract line using the same logic as the UI. If exactly one contract line is eligible for the work item's client and service, it is chosen automatically. If no contract line is eligible, the entry is saved as unresolved and appears in the Unresolved Charges queue for manual review.

When a client has more than one eligible contract line for the same service, the API returns 400 with details.reason: "contract_line_ambiguous" and a details.eligible_contract_lines array listing each candidate (with contract_line_id, contract_line_name, contract_line_type, contract_name, and has_bucket). Retry the request with contract_line_id set to one of those candidates to resolve the ambiguity. You can also skip the resolver entirely by supplying contract_line_id on any create or update; if the supplied line is not eligible, the API returns 400 with details.reason: "contract_line_not_eligible". An optional tax_rate_id is also accepted and stored as-is (no tax computation is performed by the API).

Deleting a time entry via DELETE /api/v1/time-entries/{id} or the bulk route now reverses the billing usage the entry drew: bucket minutes are returned to the contract bucket and any hour-block burn is unwound. Previously, API deletes left stale usage in place; existing leftover usage from earlier deletes is not corrected retroactively.

Track time live

Instead of posting a finished entry, start a clock with POST /api/v1/time-entries/start-tracking and close it with POST /time-entries/stop-tracking/{sessionId}, which writes the resulting entry. Check what is running with GET /api/v1/time-entries/active-session.

Stopwatch

The stopwatch is the pausable timer from the ticket and task screens, exposed as its own resource. Start one with POST /api/v1/stopwatch on a ticket or project_task; a user holds at most one open session, so a second start answers 409 with the existing session in details.open_session. Boards can turn the stopwatch off, which is also a 409. POST /api/v1/stopwatch/{id}/pause and /resume close and open timing segments, and PATCH /api/v1/stopwatch/{id} edits the draft notes or service while it runs. GET /api/v1/stopwatch/active returns the caller’s open session with server-computed elapsed time, or null.

Finish with POST /api/v1/stopwatch/{id}/log, which writes exactly one time entry: start is the first segment’s start, end is start plus the active duration, and billable minutes equal the active minutes (minimum one). Any field in the body overrides the derived value. A session you no longer want is removed with DELETE /api/v1/stopwatch/{id}.

Approval

Entries move through review with POST /api/v1/time-entries/approve and POST /api/v1/time-entries/request-changes. For day-to-day reads, GET /api/v1/time-entries lists and filters, GET /api/v1/time-entries/search runs a text query, and GET /api/v1/time-entries/stats returns totals. The /api/v1/time-entries/bulk route handles create, update, and delete for many entries at once.

Endpoints

Every endpoint links through to its full parameters, request and response schemas, and code samples.

POST/api/v1/stopwatchAlgaPSAStart stopwatchPATCH/api/v1/stopwatch/{id}AlgaPSAUpdate stopwatch draftDELETE/api/v1/stopwatch/{id}AlgaPSADiscard stopwatchPOST/api/v1/stopwatch/{id}/logAlgaPSALog stopwatch as time entryPOST/api/v1/stopwatch/{id}/pauseAlgaPSAPause stopwatchPOST/api/v1/stopwatch/{id}/resumeAlgaPSAResume stopwatchGET/api/v1/stopwatch/activeAlgaPSAGet active stopwatch sessionGET/api/v1/time-entriesAlgaPSAList time entriesPOST/api/v1/time-entriesAlgaPSACreate time entryGET/api/v1/time-entries/{id}AlgaPSAGet time entryPUT/api/v1/time-entries/{id}AlgaPSAUpdate time entryDELETE/api/v1/time-entries/{id}AlgaPSADelete time entryGET/api/v1/time-entries/active-sessionAlgaPSAGet active tracking sessionPOST/api/v1/time-entries/approveAlgaPSAApprove time entriesPOST/api/v1/time-entries/bulkAlgaPSABulk create time entriesPUT/api/v1/time-entries/bulkAlgaPSABulk update time entriesDELETE/api/v1/time-entries/bulkAlgaPSABulk delete time entriesPOST/api/v1/time-entries/cancel-tracking/{sessionId}AlgaPSAPOST v1GET/api/v1/time-entries/exportAlgaPSAExport time entriesPOST/api/v1/time-entries/request-changesAlgaPSARequest time entry changesGET/api/v1/time-entries/searchAlgaPSASearch time entriesPOST/api/v1/time-entries/start-trackingAlgaPSAStart time trackingGET/api/v1/time-entries/statsAlgaPSAGet time entry statsPOST/api/v1/time-entries/stop-tracking/{sessionId}AlgaPSAStop time trackingGET/api/v1/time-entries/templatesAlgaPSAList time entry templates