Skip to content
Leadtime
English
Esc
navigateopen⌘Jpreview

Get staff insights data in structured JSON format

What are Staff Insights? Staff Insights provides detailed analysis of employee time tracking data, showing how team members allocate their working hours across projects, task types, and value categories. This helps managers understand workload distribution, identify productivity patterns, and track employee performance against goals.

What data is returned: The response includes two “sheets” of data in JSON format (matching the Excel export structure):

  • Summary sheet:
    • For COMPARISON model: Wide format (pivot table style) with periods/staff as rows and breakdown categories as columns
    • For TOTAL model: Categories with hours and percentage distribution
  • Detailed sheet:
    • For COMPARISON model: Long format (normalized) with one row per period/staff/breakdown combination
    • For TOTAL model: Same structure as summary (aggregated totals)

Supported analysis options:

  • Staff selection: Analyze single employee or compare multiple team members
  • Date range: Auto-calculated from time log data if not provided, or specify custom range
  • Model selection:
    • COMPARISON: Time-series analysis showing trends over time periods
    • TOTAL: Aggregated totals across entire period (distribution analysis)
  • Period granularity: Required for COMPARISON model - group by months or weeks
  • Breakdown options:
    • byProject: Hours allocated per project
    • byTaskType: Hours by task category
    • byChargeableTime: Billable vs non-billable hours with target hours comparison
    • byValueGroups: Hours categorized by value groups (A, B, C, D)

Special features:

  • Chargeable time breakdown: Includes target hours column based on employee goals and working time patterns, allowing comparison of actual vs target billable hours
  • Goal integration: When using chargeable time breakdown, compares actual hours against employee goals
  • Localized output: Headers and titles are fully localized based on user’s language preference
  • Human-readable data: All entity names (employees, projects, task types) are human-readable (never UUIDs)

Use cases:

  • Track individual employee productivity and time allocation
  • Compare team member workloads across projects
  • Analyze billable vs non-billable time distribution
  • Monitor employee performance against goals and targets
  • Export to Excel for detailed reporting and analysis
GET/insights/staff-chart
Authorization
AuthorizationOAuth2 access token · headerrequired
Scopes:api:read
or
AuthorizationBearer token (JWT) · headerrequired
Query parameters
staffIdsany[][]required
Array of staff member (employee) UUIDs to analyze. Can select single employee for detailed analysis or multiple employees for comparison. At least one employee is required. Goal data comes from employee goal settings and time tracking records.
modelstringrequired
Chart model type for staff time analysis. `COMPARISON` shows data over time periods (time-series analysis showing trends), while `TOTAL` shows aggregated totals across the entire period (distribution analysis). COMPARISON requires period granularity, TOTAL does not use periods.
Allowed:comparisontotal
startDatestring
Start date for the analysis period in ISO 8601 format (YYYY-MM-DD). If not provided, automatically calculated from the earliest time log entry for the selected staff members. Used to determine the beginning of the time series or total aggregation period.
endDatestring
End date for the analysis period in ISO 8601 format (YYYY-MM-DD). If not provided, automatically calculated from the latest time log entry for the selected staff members. Must be after startDate if both are provided. Used to determine the end of the time series or total aggregation period.
periodstringrequired
Time period granularity for grouping staff time data. `months` groups data by calendar month, `weeks` groups data by week. Required for COMPARISON model to determine x-axis intervals in time-series charts. Not used for TOTAL model which shows aggregate distribution without time dimension.
Allowed:monthsweeks
breakdownstringrequired
Breakdown dimension for segmenting staff time data. `byProject` breaks down hours allocated per project, `byTaskType` by task category, `byChargeableTime` by billable vs non-billable hours (includes target hours comparison), and `byValueGroups` by value categories (A, B, C, D). Breakdowns enable detailed analysis of how employee time is distributed.
Allowed:byProjectbyTaskTypebyChargeableTimebyValueGroups
Responses
200Staff insights data in structured JSON format with summary and detailed sheets
detailedobjectrequired
Detailed sheet data. For COMPARISON model: long format (normalized) with one row per period/staff/breakdown combination. For TOTAL model: same as summary.
Show properties
headersstring[]required
Column headers for the sheet
rowsobject[]required
Data rows as array of objects, where keys match headers. Each row represents one data point.
titleobjectrequired
Sheet title information with main title and subtitle
metadataobjectrequired
Metadata about the query execution and results
summaryobjectrequired
Summary sheet data. For COMPARISON model: wide format with periods/staff as rows and breakdown categories as columns. For TOTAL model: categories with hours and percentage.
Show properties
headersstring[]required
Column headers for the sheet
rowsobject[]required
Data rows as array of objects, where keys match headers. Each row represents one data point.
titleobjectrequired
Sheet title information with main title and subtitle
400Invalid request parameters (invalid dates, enum values, missing period for COMPARISON model, etc.)
401Unauthorized - Invalid or missing authentication token
403User does not have permission to view staff insights (requires Insights.viewStaffInsights)
404One or more staff member IDs not found or user does not have access to them
Request
curl -X GET "https://leadtime.app/api/public/insights/staff-chart?staffIds=7acff2df-a904-4323-adcc-c2f24a769bde&model=comparison&period=months&breakdown=byProject" \
  -H "Authorization: Bearer YOUR_ACCESS_TOKEN"
Response
{
  "detailed": {
    "headers": [
      "Period",
      "Period Label",
      "Employee",
      "Hours"
    ],
    "rows": [
      {
        "Employee": "John Doe",
        "Hours": 160,
        "Period": "2024-01",
        "Period Label": "Jan 2024"
      },
      {
        "Employee": "John Doe",
        "Hours": 175,
        "Period": "2024-02",
        "Period Label": "Feb 2024"
      }
    ],
    "title": {
      "main": "Staff Insights: John Doe",
      "subtitle": "Comparison, Breakdown by Project, Jan 2024 - Dec 2024, By Months"
    }
  },
  "metadata": {
    "hasMoreData": false,
    "periodsGenerated": 12,
    "queryExecutionTime": 234,
    "totalTimeLogsProcessed": 480
  },
  "summary": {
    "headers": [
      "Period",
      "Period Label",
      "Employee",
      "Hours"
    ],
    "rows": [
      {
        "Employee": "John Doe",
        "Hours": 160,
        "Period": "2024-01",
        "Period Label": "Jan 2024"
      },
      {
        "Employee": "John Doe",
        "Hours": 175,
        "Period": "2024-02",
        "Period Label": "Feb 2024"
      }
    ],
    "title": {
      "main": "Staff Insights: John Doe",
      "subtitle": "Comparison, Breakdown by Project, Jan 2024 - Dec 2024, By Months"
    }
  }
}