Skip to main content

Summarise Timesheets

GET/timesheets/summary

Access​

RequirementValue
Scoperead:timesheets
Company-scoped keysSupported
Agency-scoped keysSupported within agency access

Summary​

Returns grouped timesheet counts, hours, charge and pay values, expenses and worker counts. Requires read:timesheets. Company and agency keys are supported, within their existing data access. Filtering or grouping by another agency does not expand an agency key's access.

Date ranges intersect the current-week cutoff; a later to does not include future timesheets beyond that cutoff. startDate, endDate and we are compatibility aliases for start, end and weekEnding. Gross hours and netHours are separate measures. Trade and purchase-order groups use the related assignment; purchaseOrder contains the purchase-order reference. Distinct workers are counted within each group.

Query Parameters​

NameTypeRequiredDescription
companystringNoFilter by company id(s). Pass a single id or comma-separated ids. If omitted, data for all companies linked to the API key is returned.
agencystringNoFilter by agency id
projectstringNoFilter by project id
sitestringNoFilter by site id
assignmentstringNoFilter by assignment id
workerstringNoFilter by worker id
statusenum(pending, pending_approval, approved, cancelled, absent)NoFilter by timesheet status
querystringNoCase-insensitive text search across the resource’s supported reference and name fields
groupBystringNoComma-separated grouping dimensions: agency, company, project, site, worker, trade, purchaseOrder, status, month, week. Combine dimensions, for example company,month. Duplicate dimensions are ignored. Default: status.
dateFieldenum(createdAt, updatedAt, start, startDate, end, endDate, approvedDate, weekEnding, we)NoDate used for range filtering and month/week groups. Choose a date populated on the source records. Default: weekEnding.
fromstringNoDate range start (YYYY-MM-DD), applied to dateField
tostringNoDate range end (YYYY-MM-DD), applied to dateField
sortByenum(count, hours, netHours, chargeValue, payValue, expenseValue, distinctWorkers, chargeWdBasic, chargeWdOvertime, chargeNightwork, chargeWeekend, chargeBankHoliday, payWdBasic, payWdOvertime, payNightwork, payWeekend, payBankHoliday)NoMetric used to sort groups Default: chargeValue.
sortOrderenum(asc, desc)NoGroup sort direction Default: desc.
limitintegerNoMaximum groups returned; capped at 500. No page parameter or continuation token is provided. Default: 500.

Aggregation rules​

  • Results contain at most 500 groups. There is no pagination or continuation token; narrow the filters or split date ranges when more groups are needed.
  • meta.total is the number of groups returned after limiting, not the total matching records or all possible groups.
  • Month groups use YYYY-MM; ISO week groups use YYYY-Www. Both use UTC and the selected dateField; a missing selected date produces a null date bucket when no date range excludes it.
  • Measures are reported from stored values without currency conversion. These groups do not separate currencies automatically. Restrict financial comparisons to records known to use the same currency.

Request Example​

curl --get 'https://api.requidex.com/api/open/v1/timesheets/summary' \
--header "Authorization: Bearer ${REQUIDEX_API_KEY}" \
--header 'Accept: application/json' \
--data-urlencode 'groupBy=status' \
--data-urlencode 'limit=50' \
--max-time 30

Response Fields​

FieldTypeDescription
successbooleanWhether the request succeeded
dataarray of objectsReturned groups
Show child attributes
  • group object — Selected grouping dimensions
    Show child attributes
    • agency object or null — Selected agency dimension; present only when included in groupBy
      Show child attributes
      • id string or null — Resource identifier
      • name string or null — Resource name
    • company object or null — Selected company dimension; present only when included in groupBy
      Show child attributes
      • id string or null — Resource identifier
      • name string or null — Resource name
    • project object or null — Selected project dimension; present only when included in groupBy
      Show child attributes
      • id string or null — Resource identifier
      • name string or null — Resource name
    • site object or null — Selected site dimension; present only when included in groupBy
      Show child attributes
      • id string or null — Resource identifier
      • name string or null — Resource name
    • worker object or null — Selected worker dimension; present only when included in groupBy
      Show child attributes
      • id string or null — Resource identifier
      • name string or null — Resource name
    • trade object or null — Selected trade dimension; present only when included in groupBy
      Show child attributes
      • id string or null — Resource identifier
      • name string or null — Resource name
    • purchaseOrder string or null — Selected purchaseOrder dimension; present only when included in groupBy
    • status string or null — Selected status dimension; present only when included in groupBy
    • month string or null — Selected month dimension; present only when included in groupBy
    • week string or null — Selected week dimension; present only when included in groupBy
  • count integer — Number of matching records represented in the group
  • values object — Aggregated measures for the group
    Show child attributes
    • hours number — Gross hours
    • netHours number — Net hours
    • chargeValue number — Charge value
    • payValue number — Pay value
    • expenseValue number — Expense value
    • distinctWorkers number — Number of distinct workers in this group
    • chargeWdBasic number — Charge wd basic value
    • chargeWdOvertime number — Charge wd overtime value
    • chargeNightwork number — Charge nightwork value
    • chargeWeekend number — Charge weekend value
    • chargeBankHoliday number — Charge bank holiday value
    • payWdBasic number — Pay wd basic value
    • payWdOvertime number — Pay wd overtime value
    • payNightwork number — Pay nightwork value
    • payWeekend number — Pay weekend value
    • payBankHoliday number — Pay bank holiday value
metaobjectApplied summary settings
Show child attributes
  • total integer — Groups returned after applying limit; not the total source records or all possible groups
  • groupBy array — Selected grouping dimensions
  • dateField string — Date field used for filtering and date buckets
  • sortBy string — Applied metric sort
  • sortOrder string — Applied sort direction
  • limit integer — Applied group limit

Response Example (200)​

{
"success": true,
"data": [
{
"group": {
"status": "pending"
},
"count": 2,
"values": {
"hours": 80,
"netHours": 75,
"chargeValue": 1800,
"payValue": 1350,
"expenseValue": 50,
"distinctWorkers": 2,
"chargeWdBasic": 1800,
"chargeWdOvertime": 0,
"chargeNightwork": 0,
"chargeWeekend": 0,
"chargeBankHoliday": 0,
"payWdBasic": 1350,
"payWdOvertime": 0,
"payNightwork": 0,
"payWeekend": 0,
"payBankHoliday": 0
}
}
],
"meta": {
"total": 1,
"groupBy": ["status"],
"dateField": "weekEnding",
"sortBy": "chargeValue",
"sortOrder": "desc",
"limit": 50
}
}

The example is illustrative. An empty result has data: [] and meta.total: 0.

MCP Tool​

The corresponding MCP tool is summarize_timesheets. It uses this server-side summary operation and retains the caller’s scopes and tenant restrictions.

Errors​

HTTP statusCodeMeaning
400BAD_REQUESTInvalid grouping dimension, date field, filter or date range
401UNAUTHORIZEDMissing, invalid, expired or revoked key
403FORBIDDENMissing scope or disallowed access
429RATE_LIMITED or DAILY_RATE_LIMITEDKey quota exceeded
500INTERNAL_ERRORUnable to return the summary

See Responses and Errors for shared handling, and List Timesheets for record-level access and detail queries.