API REFERENCE

Timesheets API

A timesheet collects a user's time entries for one time period and carries them through submission and approval. Use this API to open timesheets, attach entries, and drive their review lifecycle.

List timesheets

Retrieve timesheets for your tenant with GET /api/v1/time-sheets. Results default to period_start desc order (most recent period first).

Control sort order with the sort and order query parameters. Accepted sort keys are period_start, period_end, approval_status, submitted_at, and approved_at; sort=created_at is accepted as a legacy alias for period_start. Passing an unrecognised sort key returns 400 VALIDATION_ERROR with the list of allowed values in the error body.

curl
curl "https://algapsa.com/api/v1/time-sheets?sort=period_start&order=asc" \
  -H "X-API-Key: $ALGA_API_KEY"

Open a timesheet

A timesheet ties a user_id to a period_id from the Time Periods API. Create it with POST /api/v1/time-sheets, then read what it contains with GET /api/v1/time-sheets/{id}/entries and GET /api/v1/time-sheets/{id}/summary.

curl
curl https://algapsa.com/api/v1/time-sheets \
  -H "X-API-Key: $ALGA_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "user_id": "usr_5b21",
    "period_id": "tp_2026_06"
  }'

Each user can have at most one timesheet per period. If one already exists for the given user_id and period_id, POST /api/v1/time-sheets returns 409 CONFLICT with {"error":{"code":"CONFLICT","message":"A time sheet already exists for this user and period"}}. Retrieve the existing sheet with GET /api/v1/time-sheets?user_id=…&period_id=….

Attach entries

Move time onto a sheet with POST /api/v1/time-sheets/{id}/add-entry and pull it back off with DELETE /api/v1/time-sheets/{id}/remove-entry. The entries themselves are created through the Time Entries API.

Submit and review

A user submits their own timesheet with POST /api/v1/time-sheets/{id}/submit, optionally with submission_notes. Submission works only from DRAFT or CHANGES_REQUESTED and only when the sheet has at least one time entry. A reviewer with the timesheet approve permission then calls POST /api/v1/time-sheets/{id}/approve (optional approval_notes) or POST /api/v1/time-sheets/{id}/request-changes (required change_reason, optional detailed_feedback); both need a SUBMITTED sheet. An approval can be undone with POST /api/v1/time-sheets/{id}/reverse-approval and a reversal_reason. Reversing needs the timesheet manage permission, an APPROVED sheet, and a sheet that has not been invoiced (otherwise 409). A call made from the wrong status returns 409, and a caller without the needed permission gets 403.

Review history and comments

Every note written during review is kept rather than overwritten. Submission notes, approval notes, change requests, and reversal reasons each become an entry in the notes array returned by GET /api/v1/time-sheets/{id}, with a kind of submission, approval, request_changes, or reverse_approval, plus who wrote it and when. Notes that were stored on a timesheet before this history existed appear as legacy. A timesheet no longer has a single notes field to set on create or update.

GET /api/v1/time-sheets/{id} also returns a comments array; each comment says whether it came from an approver (is_approver). There is no REST endpoint for adding comments.

Search and export

GET /api/v1/time-sheets/search matches its required query against the owner's name and the review history text. GET /api/v1/time-sheets/export returns every matching timesheet, not just the first page. On both, the array filters (approval_statuses, user_ids, period_ids) accept repeated keys or comma-separated values.

Endpoints

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

GET/api/v1/time-sheetsAlgaPSAList time sheetsPOST/api/v1/time-sheetsAlgaPSACreate time sheetGET/api/v1/time-sheets/{id}AlgaPSAGet time sheetPUT/api/v1/time-sheets/{id}AlgaPSAUpdate time sheetDELETE/api/v1/time-sheets/{id}AlgaPSADelete time sheetPOST/api/v1/time-sheets/{id}/add-entryAlgaPSAAdd time sheet entryPOST/api/v1/time-sheets/{id}/approveAlgaPSAApprove time sheetGET/api/v1/time-sheets/{id}/entriesAlgaPSAList time sheet entriesPOST/api/v1/time-sheets/{id}/rejectAlgaPSAReject time sheetDELETE/api/v1/time-sheets/{id}/remove-entryAlgaPSARemove time sheet entryPOST/api/v1/time-sheets/{id}/request-changesAlgaPSARequest time sheet changesPOST/api/v1/time-sheets/{id}/reverse-approvalAlgaPSAReverse time sheet approvalPOST/api/v1/time-sheets/{id}/submitAlgaPSASubmit time sheetGET/api/v1/time-sheets/{id}/summaryAlgaPSAGet time sheet summaryPOST/api/v1/time-sheets/bulkAlgaPSABulk time sheet operationGET/api/v1/time-sheets/exportAlgaPSAExport time sheetsGET/api/v1/time-sheets/searchAlgaPSASearch time sheets