Skip to content
Leadtime
English
Esc
navigateopen⌘Jpreview

Get project insights data in structured JSON format

What are Project Insights? Project Insights provides detailed analysis of working hours spent on company projects over time. This endpoint returns data that can be visualized as charts or exported to Excel, showing how time is allocated across projects, team members, task types, and individual tasks.

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

  • Summary sheet: Wide format (pivot table style) with periods as rows and breakdown categories as columns. Perfect for quick overview and visual chart generation.
  • Detailed sheet: Long format (normalized/tidy data) with one row per period/breakdown combination. Ideal for further analysis, pivot tables, and BI tools.

Supported analysis options:

  • Project selection: Analyze single project or compare multiple projects side-by-side
  • Date range: Auto-calculated from time log data if not provided, or specify custom range
  • Model selection:
    • timeSeries: Shows data over time periods (trends and comparisons)
    • total: Shows aggregated totals across entire period (distribution analysis)
  • Period granularity: Group data by months or weeks
  • Breakdown options:
    • none: No breakdown (total hours only)
    • byUser: Breakdown by team member
    • byTaskType: Breakdown by task category
    • byTask: Breakdown by individual task
    • byProject: Breakdown by project (only for multiple projects)
  • View style (single project time series only):
    • trend: Cumulative values showing progress over time (ladder-style bars)
    • periodComparison: Period-by-period values (non-cumulative bars)
  • Display style (multiple projects time series only):
    • groups: Separate lines/bars for each project (comparison view)
    • stacks: Stacked bars showing combined effort (aggregate view)

Data structure:

  • Headers and titles are fully localized based on user’s language preference
  • All entity names (users, projects, tasks) are human-readable (never UUIDs)
  • Numeric values include proper formatting (2 decimal places)
  • Metadata includes query execution time and data processing statistics

Use cases:

  • Generate visual charts showing project time allocation trends
  • Export to Excel for detailed analysis and reporting
  • Track team member contributions over time
  • Analyze task type distribution across projects
  • Monitor project progress against budgets and estimates
GET/insights/project-chart
Authorization
AuthorizationOAuth2 access token · headerrequired
Scopes:api:read
or
AuthorizationBearer token (JWT) · headerrequired
Query parameters
projectIdsany[][]required
Array of project UUIDs to analyze. Can select single project for detailed analysis or multiple projects for comparison. At least one project is required.
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 in the selected projects. 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 in the selected projects. Must be after startDate if both are provided. Used to determine the end of the time series or total aggregation period.
modelstringrequired
Chart model type determining how data is aggregated and displayed. `timeSeries` shows data over time periods (trends and comparisons), while `total` shows aggregated totals across the entire period (distribution analysis). Time series is ideal for tracking progress over time, while total is better for understanding overall distribution.
Allowed:timeSeriestotal
periodstringrequired
Time period granularity for grouping data. `months` groups data by calendar month, `weeks` groups data by week. This determines the x-axis intervals in time series charts and affects how data is aggregated. Months provide broader trends, weeks provide more detailed granularity.
Allowed:monthsweeks
breakdownstring
Optional breakdown dimension for segmenting the data. `none` shows total hours without segmentation. `byUser` breaks down by team member, `byTaskType` by task category, `byTask` by individual task, and `byProject` by project (only available when multiple projects are selected). Breakdowns enable detailed analysis of how time is distributed across different dimensions.
Allowed:nonebyUserbyTaskTypebyTaskbyProjectbyValueGroups
viewStylestring
View style for single project time series charts. `trend` shows cumulative values (ladder-style bars showing progress from start to each period), while `periodComparison` shows period-by-period values (non-cumulative bars comparing each period independently). Only applicable when a single project is selected and model is timeSeries.
Allowed:trendperiodComparison
displayStylestring
Display style for multiple projects time series charts. `groups` shows separate lines/bars for each project (comparison view), while `stacks` shows stacked bars combining all projects (aggregate view). Only applicable when multiple projects are selected and model is timeSeries.
Allowed:groupsstacks
Responses
200Project insights data in structured JSON format with summary and detailed sheets
detailedobjectrequired
Detailed sheet data (long/tidy format, normalized). One row per period/breakdown combination.
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 (wide/matrix format, like pivot table). Periods as rows, breakdown categories as columns.
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, etc.)
401Unauthorized - Invalid or missing authentication token
403User does not have permission to view project insights (requires Insights.viewProjectInsights)
404One or more project IDs not found or user does not have access to them
Request
curl -X GET "https://leadtime.app/api/public/insights/project-chart?projectIds=7acff2df-a904-4323-adcc-c2f24a769bde&model=timeSeries&period=months" \
  -H "Authorization: Bearer YOUR_ACCESS_TOKEN"
Response
{
  "detailed": {
    "headers": [
      "Period",
      "Period Label",
      "Value",
      "Cumulative Total"
    ],
    "rows": [
      {
        "Cumulative Total": 120.5,
        "Period": "2024-01",
        "Period Label": "Jan 2024",
        "Value": 120.5
      },
      {
        "Cumulative Total": 255.7,
        "Period": "2024-02",
        "Period Label": "Feb 2024",
        "Value": 135.2
      }
    ],
    "title": {
      "main": "Project Insights: Project Name",
      "subtitle": "Jan 2024 - Dec 2024, Time Series, By User, Months, Trend"
    }
  },
  "metadata": {
    "hasMoreData": false,
    "periodsGenerated": 12,
    "queryExecutionTime": 234,
    "totalTimeLogsProcessed": 1000
  },
  "summary": {
    "headers": [
      "Period",
      "Period Label",
      "Value",
      "Cumulative Total"
    ],
    "rows": [
      {
        "Cumulative Total": 120.5,
        "Period": "2024-01",
        "Period Label": "Jan 2024",
        "Value": 120.5
      },
      {
        "Cumulative Total": 255.7,
        "Period": "2024-02",
        "Period Label": "Feb 2024",
        "Value": 135.2
      }
    ],
    "title": {
      "main": "Project Insights: Project Name",
      "subtitle": "Jan 2024 - Dec 2024, Time Series, By User, Months, Trend"
    }
  }
}