Export Productivity Metrics
Learn how to programmatically export developer, team, and org-level Productivity metrics using export APIs.
AI DLC Insights provides APIs to export Productivity metrics in CSV format for team, developer, and organization-level reporting. There are two available APIs:
V2 Export API (recommended): Asynchronous, scalable, and designed for large datasets and org-wide exports.
Legacy Reports API: Synchronous export API for team and contributor reporting use cases.
Both APIs return CSV output but differ in execution model and request structure. The V2 Export API is recommended for new integrations and large-scale exports.
The V2 Export API provides asynchronous exports of Productivity metrics at the developer, team, or organization scope. The export workflow looks like:
This API is designed for large organization exports, automated reporting pipelines, scheduled data exports, historical analytics processing, and bulk developer or team reporting.
Authentication
All V2 export requests require authentication headers.
authorization
ApiKey <YOUR_SEI_API_KEY>
Content-Type
application/json
You must also include the following query parameters on all requests:
projectIdentifier
Harness project identifier
orgIdentifier
Harness organization identifier
Create Export Job
Create an asynchronous export job.
# Replace BASE_URL with your Harness cluster URL (e.g. https://app.harness.io) <a href="#replace-baseurl-with-your-harness-cluster-url-eg-httpsappharnessio" id="replace-baseurl-with-your-harness-cluster-url-eg-httpsappharnessio"></a>
POST {BASE_URL}/v2/insights/productivity/exportsRequest Body
Configuration
scope
Defines the export scope (organization tree or specific team).
dateRange
Start and end dates for the export period.
metricGroups
Groups of Productivity metrics to export.
metrics
Individual metrics to export.
options.metricLevel
Export level: developer or team.
options.aggregation
Aggregation method used for metric calculations.
options.granularity
Reporting interval (weekly, monthly, or quarterly).
options.format
Export format (csv).
Available metric groups
The following Productivity metric groups are available:
activity
CODING_DAYS
CODING_DAYS
velocity
PR_CYCLE_TIME_DAYS_AVG, AVG_TIME_TO_COMPLETE
PR_CYCLE_TIME_DAYS_AVG, PR_VELOCITY, AVG_TIME_TO_COMPLETE
volume
PR_MERGED, PR_MERGED_SMALL, PR_MERGED_MEDIUM, PR_MERGED_LARGE, LOC_ADDED, LOC_REMOVED, WORK_COMPLETED, WORK_FEATURES_COMPLETED, WORK_BUGS_COMPLETED, WORK_OTHER_COMPLETED
PR_MERGED, PR_MERGED_SMALL, PR_MERGED_MEDIUM, PR_MERGED_LARGE, WORK_COMPLETED, WORK_FEATURES_COMPLETED, WORK_BUGS_COMPLETED, WORK_OTHER_COMPLETED
quality
REWORK_PERCENT, REWORK_PERCENT_RECENT, REWORK_PERCENT_LEGACY, LOC_REFACTORED, LOC_REFACTORED_RECENT, LOC_REFACTORED_LEGACY, PR_MISSING_TICKETS
REWORK_PERCENT, REWORK_PERCENT_RECENT, REWORK_PERCENT_LEGACY, LOC_REFACTORED, LOC_REFACTORED_RECENT, LOC_REFACTORED_LEGACY, PR_MISSING_TICKETS, LOC_TOTAL
collaboration
REVIEW_COMMENTS_PER_PR_AVG, REVIEW_TIME_TO_FIRST_COMMENT_HRS_AVG
REVIEW_COMMENTS_PER_PR_AVG, REVIEW_TIME_TO_FIRST_COMMENT_HRS_AVG
To export an entire organization tree:
To export a specific team:
Example Request
Responses
Check Export Status
Poll the export status endpoint until the export reaches the completed state.
Example Response
The following export statuses are available:
queued
Export is waiting to be processed
processing
Export is currently being generated
completed
Export is ready for download
failed
Export failed due to an error
cancelled
Export was cancelled by user
Download Export
Downloads the generated CSV file.
Large exports may be automatically compressed as .gz files.
Example Request
List Exports
Retrieve historical export jobs.
The Legacy Reports API provides synchronous exports for team and contributor-level Productivity metrics.
Both team-level and individual-level exports use the same endpoint. The behavior depends on the parameters you include in the request body.
Endpoint: POST /v2/insights/teams/reports
Authentication: Requires an x-api-key header with an API key generated from your Harness account. For more information about generating an API key, see Manage API keys.
Exports aggregate Productivity metrics per team.
Request Body: ExportRequestDTO (see the Request body structure section below)
Response: A CSV file containing one row per team and one column per metric.
Request body structure
For ExportRequestDTO:
Field descriptions
collectionId
String
Yes
Identifier for the team of developers. If your in-app URL contains ?insightType=productivity&collectionId=6036, then the collectionId is 6036.
dateStart
Date (yyyy-MM-dd)
Yes
Start date for the report period.
dateEnd
Date (yyyy-MM-dd)
Yes
End date for the report period.
granularity
String
Yes
Time unit for rate-based metrics (daily, weekly, monthly).
teamRefId
Number
No
Team identifier. CSV will include this team and all child teams under it.
productivity
ProductivityRequestDto
No
Productivity metrics configuration.
Granularity
The granularity field specifies the time unit for rate-based metrics, which measure counts over time. It affects how certain metrics are calculated and reported.
Metrics affected by granularity include the following:
CODING_DAYS_PER_DEV: For example, 3 coding days per week.WORKTYPE_COMPLETED_PER_DEV: For example, 1.22 work items completed per week.DEPLOYMENT_FREQUENCY: For example, 20 deployments per week.
Common granularity values include the following:
daily: Metrics calculated per day.weekly: Metrics calculated per week.monthly: Metrics calculated per month.
Nested objects
To configure Productivity metrics with ProductivityRequestDto:
metrics(required): List of productivity metric names to include in the export.
The following Productivity metrics are available:
TIME_TO_FIRST_COMMENT
Time to First Comment
Days (CSV contains numeric values without unit labels)
Measures the average time taken for the first comment to be made on a pull request. Helps track review responsiveness and team collaboration speed. Lower values indicate faster initial engagement on PRs.
PR_VELOCITY_PER_DEV
PR Velocity per Developer
Lines of code per developer per time period (affected by granularity)
Measures the average PR size (lines of code changed) per developer. Indicates developer productivity in terms of code contribution volume. Helps identify development throughput patterns.
WORKTYPE_COMPLETED_PER_DEV
Work Completed per Developer
Work items per developer per time period (affected by granularity)
Tracks bugs resolved with priority per developer. Measures developer contribution to bug resolution and issue completion. Provides insights into issue resolution capacity. Example: 1.22 means ~1.22 work items completed per week (if granularity is weekly).
CODING_DAYS_PER_DEV
Coding Days per Developer
Days per time period (affected by granularity)
Counts the number of days a developer actively contributed code. Helps track developer engagement and activity levels. Useful for understanding work patterns and availability. Example: 3 means 3 coding days per week (if granularity is weekly).
NUMBER_OF_COMMENTS_PER_PR
Number of Comments per PR
Count (dimensionless number)
Average number of review comments per pull request. Indicates code review thoroughness and collaboration intensity. Higher values may suggest more complex changes or detailed review processes.
AVG_TIME_TO_COMPLETE
Average Time to Complete
Days (CSV contains numeric values without unit labels)
Average time to complete a work item from start to finish. Measures development cycle efficiency. Helps identify bottlenecks in the development process.
Response format
Success Response (200 OK)
Content-Type:
text/csvContent-Disposition:
attachment; filename="<report_name>.csv"Body: CSV file with report data.
The CSV file structure contains:
One row per team (including child teams)
One column per metric
First row: Column headers with metric names
Subsequent rows: Data rows with metric values for each team
Exports productivity metrics for individual developers within a team.
Request Body: ContributorExportRequestDTO (see the Request body structure section below)
Response: A CSV file containing one row per developer and one column per metric.
Request body structure
For ContributorExportRequestDTO:
Field descriptions
collectionId
String
Yes
Identifier for the team of developers. If your in-app URL contains ?insightType=productivity&collectionId=6036, then the collectionId is 6036.
dateStart
Date (yyyy-MM-dd)
Yes
Start date for the report period.
dateEnd
Date (yyyy-MM-dd)
Yes
End date for the report period.
granularity
String
Yes
Time unit for rate-based metrics.
includeRatings
Boolean
No
Whether to include developer rating summaries.
productivityContributors
ContributorMetricsConfig
Yes
Metrics to include in the developer export.
Granularity
The granularity field specifies the time unit used to normalize rate-based team metrics, which measure counts or activity over time. Granularity determines how these metrics are aggregated and represented in the CSV output.
Team-level metrics affected by granularity include the following:
CODING_DAYS: For example, 3 coding days per week.WORKTYPE_COMPLETED: For example, 1.22 work items completed per week.DEPLOYMENT_FREQUENCY: For example, 20 deployments per week.
Common granularity values include the following:
daily: Metrics calculated per day.weekly: Metrics calculated per week.monthly: Metrics calculated per month.
Nested objects
To configure Productivity metrics with ContributorExportRequestDTO:
metrics(required): List of metric names to include in the export.
The following Productivity metrics are available:
PR_VELOCITY
PR Velocity
Lines of code per developer per time period (affected by granularity)
Measures average PR size (lines of code changed) per developer. Indicates code contribution throughput over time. Useful for understanding development volume across contributors.
WORK_TYPE_COMPLETED
Work Items Completed
Count per developer per time period (affected by granularity)
Number of prioritized work items completed by a contributor. Helps assess individual delivery output. Example: 2.1 means ~2.1 items/week if granularity is weekly.
CODING_DAYS
Coding Days
Days per time period (affected by granularity)
Number of days the contributor actively wrote code. Correlates with availability and engagement.
TIME_TO_FIRST_COMMENT
Time to First Comment
Days (CSV contains numeric values without units)
Time between PR creation and the first review comment. Lower values reflect faster review responsiveness.
NUMBER_OF_COMMENTS_PER_PR
Review Intensity
Count
Average number of review comments per PR. Indicates review depth or PR complexity.
AVG_TIME_TO_COMPLETE
Average Time to Complete
Days
Time from work start to completion. Higher values may indicate delays or larger tasks.
NO_OF_PRS_WITH_MISSING_TICKETS
PR Hygiene
Count
Number of pull requests missing linked work items. Useful for tracking process adherence and hygiene issues.
Contributor ratings
If you set "includeRatings": true, the CSV file includes rating columns for applicable metrics. Ratings appear only for metrics where performance tiers exist and reflect developer-specific data, not the team's aggregated value.
For example:
Parent Team
15.53
Medium
0
—
45.97
Low
Response format
Success Response (200 OK)
Content-Type:
text/csvContent-Disposition:
attachment; filename="<report_name>.csv"Body: A CSV file with team-level report data.
The CSV file structure contains:
One row per collection, including: the org tree, each manager, the manager's direct reports, and individual contributors
One column for the collection name
One column per metric included in the export (for example,
PR Velocity per Developer)
When the metrics array is empty, all available metrics for that category will be exported.
Harness recommends the following best practices when working with Productivity export APIs:
Only CSV format is currently supported.
All date fields must use the
yyyy-MM-ddformat.Export responses automatically include child teams beneath the specified team scope.
Metric names are case-insensitive.
If the
metricsarray is empty or omitted, all available metrics for that category are exported.Large exports may be automatically compressed as
.gzfiles.For large organizations, prefer team-scoped exports over root org tree exports to reduce export size and avoid timeouts.
Troubleshooting
Last updated
Was this helpful?