Skip to main content

Export Productivity Metrics

Last updated on

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.

HeaderValue
authorizationApiKey <YOUR_SEI_API_KEY>
Content-Typeapplication/json

You must also include the following query parameters on all requests:

ParameterDescription
projectIdentifierHarness project identifier
orgIdentifierHarness organization identifier

Create Export Job

Create an asynchronous export job.

# Replace BASE_URL with your Harness cluster URL (e.g. https://app.harness.io)
POST {BASE_URL}/v2/insights/productivity/exports

Request Body

{
"scope": {
"orgTreeName": "Engineering",
"teamId": "456"
},
"dateRange": {
"start": "2024-01-01",
"end": "2024-12-31"
},
"metricGroups": [
"activity",
"velocity",
"volume",
"quality",
"collaboration"
],
"metrics": [
"PR_MERGED",
"WORK_COMPLETED"
],
"options": {
"metricLevel": "developer",
"aggregation": "mean",
"granularity": "monthly",
"format": "csv"
}
}

Configuration

FieldDescription
scopeDefines the export scope (organization tree or specific team).
dateRangeStart and end dates for the export period.
metricGroupsGroups of Productivity metrics to export.
metricsIndividual metrics to export.
options.metricLevelExport level: developer or team.
options.aggregationAggregation method used for metric calculations.
options.granularityReporting interval (weekly, monthly, or quarterly).
options.formatExport format (csv).

Available metric groups

The following Productivity metric groups are available:

Metric GroupDeveloper-level MetricsTeam-level Metrics
activityCODING_DAYSCODING_DAYS
velocityPR_CYCLE_TIME_DAYS_AVG, AVG_TIME_TO_COMPLETEPR_CYCLE_TIME_DAYS_AVG, PR_VELOCITY, AVG_TIME_TO_COMPLETE
volumePR_MERGED, PR_MERGED_SMALL, PR_MERGED_MEDIUM, PR_MERGED_LARGE, LOC_ADDED, LOC_REMOVED, WORK_COMPLETED, WORK_FEATURES_COMPLETED, WORK_BUGS_COMPLETED, WORK_OTHER_COMPLETEDPR_MERGED, PR_MERGED_SMALL, PR_MERGED_MEDIUM, PR_MERGED_LARGE, WORK_COMPLETED, WORK_FEATURES_COMPLETED, WORK_BUGS_COMPLETED, WORK_OTHER_COMPLETED
qualityREWORK_PERCENT, REWORK_PERCENT_RECENT, REWORK_PERCENT_LEGACY, LOC_REFACTORED, LOC_REFACTORED_RECENT, LOC_REFACTORED_LEGACY, PR_MISSING_TICKETSREWORK_PERCENT, REWORK_PERCENT_RECENT, REWORK_PERCENT_LEGACY, LOC_REFACTORED, LOC_REFACTORED_RECENT, LOC_REFACTORED_LEGACY, PR_MISSING_TICKETS, LOC_TOTAL
collaborationREVIEW_COMMENTS_PER_PR_AVG, REVIEW_TIME_TO_FIRST_COMMENT_HRS_AVGREVIEW_COMMENTS_PER_PR_AVG, REVIEW_TIME_TO_FIRST_COMMENT_HRS_AVG

To export an entire organization tree:

{
"scope": {
"orgTreeName": "Engineering" // This exports all teams and developers within the specified org tree.
}
}

To export a specific team:

{
"scope": {
"orgTreeName": "Engineering",
"teamId": "456" // This exports metrics only for the specified team.
}
}

Example Request

Create Productivity Export
curl -X POST "${BASE_URL}/v2/insights/productivity/exports?projectIdentifier=${PROJECT_ID}&orgIdentifier=${ORG_ID}" \
-H "Content-Type: application/json" \
-H "authorization: ApiKey <YOUR_SEI_API_KEY>" \
-d '{
"scope": {
"orgTreeName": "Engineering",
"teamId": "456"
},
"dateRange": {
"start": "2024-01-01",
"end": "2024-12-31"
},
"metricGroups": [
"activity",
"velocity"
],
"options": {
"metricLevel": "developer",
"aggregation": "mean",
"granularity": "monthly",
"format": "csv"
}
}'

Responses

202 Accepted

Returned when a new export job is successfully created.

{
"exportId": "exp_7a8b9c0d",
"createdAt": "2025-12-29T10:00:00Z",
"message": "Export created successfully"
}
200 OK (Existing Export Reused)

Returned when an identical export already exists.

{
"exportId": "exp_7a8b9c0d",
"createdAt": "2025-12-29T09:58:00Z",
"message": "Using existing export with identical parameters"
}

Check Export Status

Poll the export status endpoint until the export reaches the completed state.

# Replace BASE_URL with your Harness cluster URL (e.g. https://app.harness.io)
GET {BASE_URL}/v2/insights/productivity/exports/{exportId}

Example Response

{
"exportId": "exp_7a8b9c0d",
"status": "completed",
"createdAt": "2025-12-29T10:00:00Z",
"completedAt": "2025-12-29T10:02:15Z",
"download": {
"url": "/v2/insights/productivity/exports/exp_7a8b9c0d/download",
"filename": "developer-insights-2024.csv",
"contentType": "text/csv"
}
}

The following export statuses are available:

StatusDescription
queuedExport is waiting to be processed
processingExport is currently being generated
completedExport is ready for download
failedExport failed due to an error
cancelledExport was cancelled by user

Download Export

Downloads the generated CSV file.

# Replace BASE_URL with your Harness cluster URL (e.g. https://app.harness.io)
GET {BASE_URL}/v2/insights/productivity/exports/{exportId}/download

Large exports may be automatically compressed as .gz files.

Example Request

curl -X GET "<BASE_URL>/v2/insights/productivity/exports/<EXPORT_ID>/download?projectIdentifier=<HARNESS_PROJECT_ID>&orgIdentifier=<HARNESS_ORG_ID>" \
--header 'authorization: Apikey <SEI_API_KEY>' > ~/<PATH>/<FILE_NAME>.csv.gz

List Exports

Retrieve historical export jobs.

# Replace BASE_URL with your Harness cluster URL (e.g. https://app.harness.io)
GET {BASE_URL}/v2/insights/productivity/exports

Troubleshooting

Why does exporting Productivity metrics for the entire org sometimes time out?

Exporting Productivity metrics for the entire org from the root node can time out due to the size of large org trees (same limitation as the UI).

To avoid timeouts when exporting, export at the team or group-level instead of requesting the entire org tree at once. Optionally, split large exports into multiple, smaller team-specific API calls.