Lewati ke konten

Timesheets API

Konten ini belum tersedia dalam bahasa Anda.

Time entries and the projects you log against. Every endpoint below is part of the stable v1 contract. Base URL https://app.aio.opexcg.com; send your key in X-API-Key.

  • GET /api/timesheets: List time entries
  • POST /api/timesheets: Log time
  • PATCH /api/timesheets/:id: Edit a time entry
  • DELETE /api/timesheets/:id: Delete a time entry
  • GET /api/timesheets/projects: List projects you can log time on

List time entries

GET /api/timesheets

Time entries, newest first. Without timesheets:entry:read_others only your own entries are returned. This list pages with limit and offset (not page/pageSize).

  • Product: Timesheets (timesheets)
  • Permission (any of): timesheets:entry:read_own, timesheets:entry:read_others

Query parameters

Field Type Required Description
dateFrom string no Started on or after this day (YYYY-MM-DD).
dateTo string no Started on or before this day (YYYY-MM-DD, inclusive).
dateFromMs string no Like dateFrom, as epoch milliseconds. Wins over dateFrom.
dateToMs string no Like dateTo, as epoch milliseconds. Wins over dateTo.
projectId string no Only entries on this project.
status string no running, pending, approved, rejected or invoiced. Any other value answers 400.
userId string no Only this member’s entries. Needs timesheets:entry:read_others for anyone but you.
mine string no 1 to return only your own entries.
search string no Substring of the description.
limit string no Rows per page, 1 to 500. Default 50.
offset string no Rows to skip. Default 0.
sort string no started_at (default), duration or description.
dir string no asc or desc.

Response 200

One page of entries.

Field Type Description
entries object[]
entries[].id string
entries[].user_id string
entries[].project_id string
entries[].description string | null
entries[].started_at number Epoch milliseconds.
entries[].ended_at number | null
entries[].duration_minutes number | null
entries[].status "running" | "pending" | "approved" | "rejected" | "invoiced"
entries[].billable number 1 = billable.
entries[].source string manual, timer, calendar or agent.
entries[].subject_type "ticket" | "task" | null
entries[].subject_id string | null
entries[].created_at number
entries[].total_cost number | null Cost at the member’s rate, when a rate is set.
entries[].project_name string | null
entries[].task_name string | null
entries[].user_name string | null
entries[].tagIds string[]
total number
limit number
offset number

Objects may carry more fields than listed; only the listed ones are part of the contract.

Errors: own_entries_only, plus the shared ones. Meanings: error codes.

Example

Terminal window
curl -X GET 'https://app.aio.opexcg.com/api/timesheets?dateFrom=2026-11-06&mine=1&limit=2' \
-H "X-API-Key: $OPEX_API_KEY"

Response 200:

{
"entries": [
{
"id": "728a50d8-ec6d-4b7e-b2f2-ea6d7ff79641",
"tenant_id": "opexcg-tenant",
"user_id": "usr-fitri-handayani",
"project_id": "99e5d1dd-334c-4bc3-88c7-7d84558bf7c6",
"description": "Integration workshop",
"started_at": 1794044848931,
"ended_at": 1794050248931,
"duration_minutes": 90,
"status": "approved",
"entry_method": "manual",
"source": "manual",
"billable": 1,
"subject_type": null,
"subject_id": null,
"clockify_id": null,
"agent_name": null,
"model": null,
"input_tokens": null,
"output_tokens": null,
"cache_read_tokens": null,
"cache_write_tokens": null,
"reasoning_tokens": null,
"approved_by": null,
"approved_at": null,
"rejection_reason": null,
"cost_rate": null,
"cost_currency": null,
"cost_source": "uncosted",
"cost_group_id": null,
"checksum": "03ce1d14ade9e654bc81e32a9f8b2325ecbc84f1ce17532ca55e0ad82f08792b",
"created_at": 1794052048976,
"created_by": "usr-fitri-handayani",
"modified_at": 1794052048976,
"modified_by": "usr-fitri-handayani",
"deleted_at": null,
"deleted_by": null,
"project_name": "Customer portal rollout",
"task_name": null,
"user_name": "Fitri Handayani",
"tagIds": [],
"total_cost": null,
"totalCost": null,
"costRate": null,
"costCurrency": null,
"costSource": "uncosted",
"costGroupId": null
}
],
"total": 1,
"limit": 2,
"offset": 0
}

Log time

POST /api/timesheets

Logs a time entry for the caller. Give startedAt and endedAt (epoch milliseconds), or durationMinutes. The entry is always yours: the user, status and checksum are set by the server.

  • Product: Timesheets (timesheets)
  • Permission (any of): timesheets:entry:create

Request body (JSON)

Field Type Required Description
projectId string yes min length 1
description string no max length 4000
startedAt number no
endedAt number no
durationMinutes number no min 0
entryMethod "timer" | "manual" | "import" no
source "timer" | "manual" | "calendar" | "agent" no
agentName string no max length 200
model string no max length 200
inputTokens number no
outputTokens number no
cacheReadTokens number no
cacheWriteTokens number no
reasoningTokens number no
billable boolean no
subjectType "ticket" | "task" | null no
subjectId string | null no
tagIds string[] no

Response 201

The new entry.

Field Type Description
id string
user_id string
project_id string
description string | null
started_at number Epoch milliseconds.
ended_at number | null
duration_minutes number | null
status "running" | "pending" | "approved" | "rejected" | "invoiced"
billable number 1 = billable.
source string manual, timer, calendar or agent.
subject_type "ticket" | "task" | null
subject_id string | null
created_at number
total_cost number | null Cost at the member’s rate, when a rate is set.

Objects may carry more fields than listed; only the listed ones are part of the contract.

Errors: project_archived, agent_name_required, plus the shared ones. Meanings: error codes.

Example

Terminal window
curl -X POST 'https://app.aio.opexcg.com/api/timesheets' \
-H "X-API-Key: $OPEX_API_KEY" \
-H "content-type: application/json" \
-d '{"projectId":"99e5d1dd-334c-4bc3-88c7-7d84558bf7c6","description":"Integration workshop","startedAt":1794044848931,"endedAt":1794050248931,"billable":true}'

Response 201:

{
"id": "728a50d8-ec6d-4b7e-b2f2-ea6d7ff79641",
"tenant_id": "opexcg-tenant",
"user_id": "usr-fitri-handayani",
"project_id": "99e5d1dd-334c-4bc3-88c7-7d84558bf7c6",
"description": "Integration workshop",
"started_at": 1794044848931,
"ended_at": 1794050248931,
"duration_minutes": 90,
"status": "approved",
"entry_method": "manual",
"source": "manual",
"billable": 1,
"subject_type": null,
"subject_id": null,
"clockify_id": null,
"agent_name": null,
"model": null,
"input_tokens": null,
"output_tokens": null,
"cache_read_tokens": null,
"cache_write_tokens": null,
"reasoning_tokens": null,
"approved_by": null,
"approved_at": null,
"rejection_reason": null,
"cost_rate": null,
"cost_currency": null,
"cost_source": "uncosted",
"cost_group_id": null,
"checksum": "03ce1d14ade9e654bc81e32a9f8b2325ecbc84f1ce17532ca55e0ad82f08792b",
"created_at": 1794052048976,
"created_by": "usr-fitri-handayani",
"modified_at": 1794052048976,
"modified_by": "usr-fitri-handayani",
"deleted_at": null,
"deleted_by": null,
"total_cost": null,
"totalCost": null
}

Edit a time entry

PATCH /api/timesheets/:id

Changes an entry. Your own entries need timesheets:entry:update_own, anyone else’s timesheets:entry:update_others. Entries that are approved on a project requiring approval, invoiced, or older than the workspace’s edit window answer 409.

  • Product: Timesheets (timesheets)
  • Permission (any of): timesheets:entry:update_own, timesheets:entry:update_others

Path parameters

Field Type Required Description
id string yes Time entry id.

Request body (JSON)

Field Type Required Description
projectId string no min length 1
source "timer" | "manual" | "calendar" no
description string | null no
startedAt number no
endedAt number | null no
durationMinutes number no min 0
billable boolean no
subjectType "ticket" | "task" | null no
subjectId string | null no
tagIds string[] no

Response 200

The updated entry.

Field Type Description
id string
user_id string
project_id string
description string | null
started_at number Epoch milliseconds.
ended_at number | null
duration_minutes number | null
status "running" | "pending" | "approved" | "rejected" | "invoiced"
billable number 1 = billable.
source string manual, timer, calendar or agent.
subject_type "ticket" | "task" | null
subject_id string | null
created_at number
total_cost number | null Cost at the member’s rate, when a rate is set.

Objects may carry more fields than listed; only the listed ones are part of the contract.

Errors: entry_not_found, own_entries_only, timer_running, entry_finalized, entry_outside_window, project_archived, invalid_time_range, plus the shared ones. Meanings: error codes.

Example

Terminal window
curl -X PATCH 'https://app.aio.opexcg.com/api/timesheets/728a50d8-ec6d-4b7e-b2f2-ea6d7ff79641' \
-H "X-API-Key: $OPEX_API_KEY" \
-H "content-type: application/json" \
-d '{"description":"Integration workshop with the client team"}'

Response 200:

{
"id": "728a50d8-ec6d-4b7e-b2f2-ea6d7ff79641",
"tenant_id": "opexcg-tenant",
"user_id": "usr-fitri-handayani",
"project_id": "99e5d1dd-334c-4bc3-88c7-7d84558bf7c6",
"description": "Integration workshop with the client team",
"started_at": 1794044848931,
"ended_at": 1794050248931,
"duration_minutes": 90,
"status": "approved",
"entry_method": "manual",
"source": "manual",
"billable": 1,
"subject_type": null,
"subject_id": null,
"clockify_id": null,
"agent_name": null,
"model": null,
"input_tokens": null,
"output_tokens": null,
"cache_read_tokens": null,
"cache_write_tokens": null,
"reasoning_tokens": null,
"approved_by": null,
"approved_at": null,
"rejection_reason": null,
"cost_rate": null,
"cost_currency": null,
"cost_source": "uncosted",
"cost_group_id": null,
"checksum": "0cb792ff0a824c080c2b63bb4daa6bf82117fc1c0f894f1a6586fb832dfba063",
"created_at": 1794052048976,
"created_by": "usr-fitri-handayani",
"modified_at": 1794052049083,
"modified_by": "usr-fitri-handayani",
"deleted_at": null,
"deleted_by": null,
"total_cost": null,
"totalCost": null
}

Delete a time entry

DELETE /api/timesheets/:id

Deletes an entry (soft delete). Your own entries need timesheets:entry:delete_own, anyone else’s timesheets:entry:delete_others. Entries that are approved on a project requiring approval, invoiced, or older than the workspace’s edit window answer 409.

  • Product: Timesheets (timesheets)
  • Permission (any of): timesheets:entry:delete_own, timesheets:entry:delete_others

Path parameters

Field Type Required Description
id string yes Time entry id.

Response 200

Done.

Field Type Description
ok boolean

Objects may carry more fields than listed; only the listed ones are part of the contract.

Errors: entry_not_found, own_entries_only, timer_running, entry_finalized, entry_outside_window, plus the shared ones. Meanings: error codes.

Example

Terminal window
curl -X DELETE 'https://app.aio.opexcg.com/api/timesheets/82d6610c-e504-4b71-abf1-5cc24c623e95' \
-H "X-API-Key: $OPEX_API_KEY"

Response 200:

{
"ok": true
}

List projects you can log time on

GET /api/timesheets/projects

The workspace’s projects you can see, with their timesheet settings and logged totals, as a plain array (no paging). Public projects are visible to every member; private ones only to their team and admins. Use an id from here as projectId when logging time.

  • Product: Timesheets (timesheets)
  • Permission: any member

Response 200

The projects.

Type: object[]

Objects may carry more fields than listed; only the listed ones are part of the contract.

Example

Terminal window
curl -X GET 'https://app.aio.opexcg.com/api/timesheets/projects' \
-H "X-API-Key: $OPEX_API_KEY"

Response 200:

[
{
"id": "99e5d1dd-334c-4bc3-88c7-7d84558bf7c6",
"company_id": "comp-xyzind",
"tenant_id": "opexcg-tenant",
"name": "Customer portal rollout",
"solution_summary": "Roll out the public API to the integration team",
"product": null,
"product_id": "prod-epicor",
"epicor_instance": null,
"epicor_version": null,
"status": "planning",
"folder_id": null,
"has_support_service": 0,
"support_expiry_date": null,
"planned_start_at": null,
"planned_end_at": null,
"actual_start_at": null,
"actual_end_at": null,
"budget_cents": 0,
"budget_hours": 0,
"budget_currency": "USD",
"color": null,
"created_at": 1794052048552,
"created_by": "usr-fitri-handayani",
"modified_at": 1794052048631,
"modified_by": "usr-fitri-handayani",
"deleted_at": null,
"deleted_by": null,
"company_name": "XYZ Industries",
"code": null,
"start_date": null,
"end_date": null,
"logged_hours": 0,
"actual_cost": 0,
"access_type": "public",
"is_billable": true,
"hourly_rate": null,
"requires_approval": false,
"has_entries": false,
"estimation_mode": "per_project",
"progress_pct": null,
"budgetCents": 0,
"budgetHours": 0,
"budgetCurrency": "USD",
"startDate": null,
"endDate": null,
"loggedHours": 0,
"actualCost": 0,
"budgetUtilization": {
"percentage": 0,
"level": "normal"
},
"accessType": "public",
"isBillable": true,
"hourlyRate": null,
"estimationMode": "per_project",
"starred": false,
"progressPct": null
},
{
"id": "prj-adis",
"company_id": "comp-opexcg",
"tenant_id": "opexcg-tenant",
"name": "ADIS",
"solution_summary": null,
"product": null,
"product_id": null,
"epicor_instance": null,
"epicor_version": null,
"status": "planning",
"folder_id": null,
"has_support_service": 0,
"support_expiry_date": null,
"planned_start_at": null,
"planned_end_at": null,
"actual_start_at": null,
"actual_end_at": null,
"budget_cents": 7500000000,
"budget_hours": 0,
"budget_currency": "IDR",
"color": null,
"created_at": 1794052020883,
"created_by": "usr-sari-wulandari",
"modified_at": 1794052020883,
"modified_by": "usr-sari-wulandari",
"deleted_at": null,
"deleted_by": null,
"company_name": "OpexCG",
"code": null,
"start_date": null,
"end_date": null,
"logged_hours": 0,
"actual_cost": 0,
"access_type": "public",
"is_billable": true,
"hourly_rate": null,
"requires_approval": false,
"has_entries": false,
"estimation_mode": "per_project",
"progress_pct": 0,
"budgetCents": 7500000000,
"budgetHours": 0,
"budgetCurrency": "IDR",
"startDate": null,
"endDate": null,
"loggedHours": 0,
"actualCost": 0,
"budgetUtilization": {
"percentage": 0,
"level": "normal"
},
"accessType": "public",
"isBillable": true,
"hourlyRate": null,
"estimationMode": "per_project",
"starred": false,
"progressPct": 0
}
]