> For clean Markdown of any page, append .md to the page URL. > For a complete documentation index, see https://docs.getunleash.io/api/get-project-insights/llms.txt. > For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.getunleash.io/_mcp/server. # Get an overview of a project insights. GET https://app.unleash-instance.example.com/api/admin/projects/{projectId}/insights This endpoint returns insights into the specified projects stats, health, lead time for changes, feature types used, members and change requests. Reference: https://docs.getunleash.io/api/get-project-insights ## Authentication - `Authorization` header (required) — API key needed to access this API - `Authorization` header (bearer token, required) — API key needed to access this API, in Bearer token format ## Request ### Path parameters - `projectId` (string, required) ## Response ### 200 projectInsightsSchema - `stats` (projectStatsSchema, required) — Project statistics - `technicalDebt` (ProjectInsightsSchemaTechnicalDebt, required) — Summary of the projects technical debt - `leadTime` (projectDoraMetricsSchema, required) — Lead time (DORA) metrics - `featureTypeCounts` (list of featureTypeCountSchema, required) — The number of features of each type - `members` (ProjectInsightsSchemaMembers, required) — Active/inactive users summary - `health` (ProjectInsightsSchemaHealth, required, deprecated) — Use `technicalDebt` instead. Summary of the project health ## Errors ### 401 Unauthorized Error Authorization information is missing or invalid. Provide a valid API token as the `authorization` header, e.g. `authorization:*.*.my-admin-token`. - `id` (string, optional) — The ID of the error instance - `name` (string, optional) — The name of the error kind - `message` (string, optional) — A description of what went wrong. ### 403 Forbidden Error The provided user credentials are valid, but the user does not have the necessary permissions to perform this operation - `id` (string, optional) — The ID of the error instance - `name` (string, optional) — The name of the error kind - `message` (string, optional) — A description of what went wrong. ### 404 Not Found Error The requested resource was not found. - `id` (string, optional) — The ID of the error instance - `name` (string, optional) — The name of the error kind - `message` (string, optional) — A description of what went wrong. ## Types ### projectStatsSchema Statistics for a project, including the average time to production, number of features created, the project activity and more. Stats are divided into current and previous **windows**. - The **current window** is the past 30 days. - The **previous window** is the 30 days **before** the current window (from 60 to 30 days ago) - `avgTimeToProdCurrentWindow` (double, required) — The average time from when a feature was created to when it was enabled in the "production" environment during the current window - `createdCurrentWindow` (double, required) — The number of feature flags created during the current window - `createdPastWindow` (double, required) — The number of feature flags created during the previous window - `archivedCurrentWindow` (double, required) — The number of feature flags that were archived during the current window - `archivedPastWindow` (double, required) — The number of feature flags that were archived during the previous window - `projectActivityCurrentWindow` (double, required) — The number of project events that occurred during the current window - `projectActivityPastWindow` (double, required) — The number of project events that occurred during the previous window - `projectMembersAddedCurrentWindow` (double, required) — The number of members that were added to the project during the current window ### ProjectInsightsSchemaTechnicalDebt Summary of the projects technical debt - `rating` (integer, required) — An indicator of the [project's technical debt](https://docs.getunleash.io/concepts/technical-debt#project-status) on a scale from 0 to 100 - `activeCount` (double, required) — The number of active feature flags. - `potentiallyStaleCount` (double, required) — The number of potentially stale feature flags. - `staleCount` (double, required) — The number of stale feature flags. ### projectDoraMetricsSchema A projects dora metrics - `features` (list of doraFeaturesSchema, required) — An array of objects containing feature flag name and timeToProduction values. The measurement unit of timeToProduction is days. - `projectAverage` (double, optional) — The average time it takes a feature flag to be enabled in production. The measurement unit is days. ### featureTypeCountSchema A count of feature flags of a specific type - `type` (string, required) — Type of the flag e.g. experiment, kill-switch, release, operational, permission - `count` (double, required) — Number of feature flags of this type ### ProjectInsightsSchemaMembers Active/inactive users summary - `currentMembers` (double, required) — The number of total project members - `change` (double, required) — The change in the number of project members compared to the previous month ### ProjectInsightsSchemaHealth Use `technicalDebt` instead. Summary of the project health - `rating` (integer, required) — An indicator of the [project's technical debt](https://docs.getunleash.io/concepts/technical-debt#project-status) on a scale from 0 to 100 - `activeCount` (double, required) — The number of active feature flags. - `potentiallyStaleCount` (double, required) — The number of potentially stale feature flags. - `staleCount` (double, required) — The number of stale feature flags. ### doraFeaturesSchema The representation of a dora time to production feature metric - `name` (string, required) — The name of a feature flag - `timeToProduction` (double, required) — The average number of days it takes a feature flag to get into production ## Examples **Response** ```json { "stats": { "avgTimeToProdCurrentWindow": 10, "createdCurrentWindow": 15, "createdPastWindow": 15, "archivedCurrentWindow": 5, "archivedPastWindow": 5, "projectActivityCurrentWindow": 100, "projectActivityPastWindow": 100, "projectMembersAddedCurrentWindow": 1 }, "technicalDebt": { "rating": 25, "activeCount": 12, "potentiallyStaleCount": 5, "staleCount": 10 }, "leadTime": { "features": [ { "name": "string", "timeToProduction": 1.1 } ], "projectAverage": 1.1 }, "featureTypeCounts": [ { "type": "kill-switch", "count": 1 } ], "members": { "currentMembers": 10, "change": 10 }, "health": { "rating": 95, "activeCount": 12, "potentiallyStaleCount": 5, "staleCount": 10 } } ``` **SDK Code** ```python import requests url = "https://app.unleash-instance.example.com/api/admin/projects/projectId/insights" headers = {"Authorization": ""} response = requests.get(url, headers=headers) print(response.json()) ``` ```javascript const url = 'https://app.unleash-instance.example.com/api/admin/projects/projectId/insights'; const options = {method: 'GET', headers: {Authorization: ''}}; try { const response = await fetch(url, options); const data = await response.json(); console.log(data); } catch (error) { console.error(error); } ``` ```go package main import ( "fmt" "net/http" "io" ) func main() { url := "https://app.unleash-instance.example.com/api/admin/projects/projectId/insights" req, _ := http.NewRequest("GET", url, nil) req.Header.Add("Authorization", "") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := io.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body)) } ``` ```ruby require 'uri' require 'net/http' url = URI("https://app.unleash-instance.example.com/api/admin/projects/projectId/insights") http = Net::HTTP.new(url.host, url.port) http.use_ssl = true request = Net::HTTP::Get.new(url) request["Authorization"] = '' response = http.request(request) puts response.read_body ``` ```java import com.mashape.unirest.http.HttpResponse; import com.mashape.unirest.http.Unirest; HttpResponse response = Unirest.get("https://app.unleash-instance.example.com/api/admin/projects/projectId/insights") .header("Authorization", "") .asString(); ``` ```php request('GET', 'https://app.unleash-instance.example.com/api/admin/projects/projectId/insights', [ 'headers' => [ 'Authorization' => '', ], ]); echo $response->getBody(); ``` ```csharp using RestSharp; var client = new RestClient("https://app.unleash-instance.example.com/api/admin/projects/projectId/insights"); var request = new RestRequest(Method.GET); request.AddHeader("Authorization", ""); IRestResponse response = client.Execute(request); ``` ```swift import Foundation let headers = ["Authorization": ""] let request = NSMutableURLRequest(url: NSURL(string: "https://app.unleash-instance.example.com/api/admin/projects/projectId/insights")! as URL, cachePolicy: .useProtocolCachePolicy, timeoutInterval: 10.0) request.httpMethod = "GET" request.allHTTPHeaderFields = headers let session = URLSession.shared let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in if (error != nil) { print(error as Any) } else { let httpResponse = response as? HTTPURLResponse print(httpResponse) } }) dataTask.resume() ```