Organizeinsights
GET/groups/{group_id}/insights
Get a namespace's flow metrics across its whole subtree
get_group_insights
insights:read
A token needs theinsights:readscope: Read flow metrics and cycle times for repositories and namespacesGranted bymcp_agent,mcp_agent_write,read_api,write_api.Every operation this scope unlocks
Throughput totals, means and a bucketed series for the group, its subgroups and every
repository beneath them, counting only what the caller can see. breakdown=repository adds
per-repository totals for up to 25 repositories, flagged when there are more. There is no
median merge lead time at this level; use a repository's cycle-time read for percentiles. The
window is whole days (UTC; the last 30 by default, at most 366). Anyone who can see the group
may read it.
Parameters
Path
- group_idGroupId (string · uuid)The group's id
Query
- fromstringoptionalYYYY-MM-DD start of the window
- tostringoptionalYYYY-MM-DD end, inclusive
- granularitystringoptionalday | week | month (default: day)
- breakdownstringoptionalnone | repository (default: none)
Responses
200The subtree's metrics, folded to what the caller can viewapplication/json
doraDoraSummary
- The DoraSummary schema
- unavailableobjectFor each metric above that is never reported, its field name and the reason — as opposed to a metric that is null only because this window had no data.
change_failure_rateRatePair or nulloptionalNot reported: it needs deployment records.
unavailablegives the reason.- The RatePair schema
- denominatorinteger · int640–∞
- numeratorinteger · int640–∞
- merge_lead_time_seconds_p50number · double or nulloptionalThe median time from a merge request's creation to its merge, in seconds. Narrower than commit-to-production lead time.
- release_frequency_per_weeknumber · double or nulloptionalPublished, non-draft releases per week over the window.
- time_to_restore_secondsnumber · double or nulloptionalNot reported: it needs to know when service was degraded.
unavailablegives the reason.
- fromstring
- granularityGranularitydayweekmonthHow a series is bucketed.
meansInsightMeans
- The InsightMeans schema
- run_duration_secondsnumber · double or nulloptional
- time_to_first_review_secondsnumber · double or nulloptional
- time_to_merge_secondsnumber · double or nulloptional
scopeActivityScope
- The ActivityScope schema
- full_pathstring
- idstring
- typeScopeTypegrouprepository
seriesarray of InsightBucket
- The InsightBucket schema
- datestring
- issues_closedinteger · int640–∞
- issues_openedinteger · int640–∞
- mrs_closedinteger · int640–∞
- mrs_mergedinteger · int640–∞
- mrs_openedinteger · int640–∞
- pushesinteger · int640–∞
- releases_publishedinteger · int640–∞
- reviews_submittedinteger · int640–∞
- runs_failedinteger · int640–∞
- runs_succeededinteger · int640–∞
- runs_totalinteger · int640–∞
- tostring
totalsInsightTotals
- The InsightTotals schema
- active_contributorsinteger · int640–∞How many different people and service accounts contributed in the window.
- issues_closedinteger · int640–∞
- issues_openedinteger · int640–∞
- mrs_closedinteger · int640–∞
- mrs_mergedinteger · int640–∞
- mrs_openedinteger · int640–∞
- pushesinteger · int640–∞
- releases_publishedinteger · int640–∞
- reviews_submittedinteger · int640–∞
runsRunTotals
- The RunTotals schema
- failedinteger · int640–∞
- succeededinteger · int640–∞
- totalinteger · int640–∞
- breakdown_truncatedbooleanoptionalWhether
by_repositorylists only the first 25 of the group's repositories. Absent when it lists them all. by_repositoryarray of ScopeTotals or nulloptionalTotals per repository, for a group asked for with
breakdown=repository; at most 25.breakdown_truncatedsays whether the group holds more.- The ScopeTotals schema
scopeActivityScope
- The ActivityScope schema
- full_pathstring
- idstring
- typeScopeTypegrouprepository
totalsInsightTotals
- The InsightTotals schema
- active_contributorsinteger · int640–∞How many different people and service accounts contributed in the window.
- issues_closedinteger · int640–∞
- issues_openedinteger · int640–∞
- mrs_closedinteger · int640–∞
- mrs_mergedinteger · int640–∞
- mrs_openedinteger · int640–∞
- pushesinteger · int640–∞
- releases_publishedinteger · int640–∞
- reviews_submittedinteger · int640–∞
- runsRunTotals
200 exampleSynthesized example
{
"dora": {
"unavailable": {},
"change_failure_rate": {
"denominator": 6,
"numerator": 44
},
"merge_lead_time_seconds_p50": 37,
"release_frequency_per_week": 53,
"time_to_restore_seconds": 80
},
"from": "from-d974",
"granularity": "day",
"means": {
"run_duration_seconds": 4,
"time_to_first_review_seconds": 7,
"time_to_merge_seconds": 74
},
"scope": {
"full_path": "acme/payments-api",
"id": "id-8da6",
"type": "group"
},
"series": [
{
"date": "date-6a0a",
"issues_closed": 18,
"issues_opened": 18,
"mrs_closed": 35,
"mrs_merged": 51,
"mrs_opened": 19,
"pushes": 46,
"releases_published": 54,
"reviews_submitted": 85,
"runs_failed": 48,
"runs_succeeded": 18,
"runs_total": 3
}
],
"to": "to-67b0",
"totals": {
"active_contributors": 55,
"issues_closed": 81,
"issues_opened": 19,
"mrs_closed": 76,
"mrs_merged": 28,
"mrs_opened": 68,
"pushes": 13,
"releases_published": 85,
"reviews_submitted": 34,
"runs": {
"failed": 56,
"succeeded": 68,
"total": 4
}
},
"breakdown_truncated": false,
"by_repository": [
{
"scope": {
"full_path": "acme/payments-api",
"id": "id-2ca5",
"type": "group"
},
"totals": {
"active_contributors": 51,
"issues_closed": 6,
"issues_opened": 7,
"mrs_closed": 32,
"mrs_merged": 17,
"mrs_opened": 65,
"pushes": 86,
"releases_published": 4,
"reviews_submitted": 5,
"runs": {
"failed": 41,
"succeeded": 30,
"total": 6
}
}
}
]
}
400Malformed window, unknown granularity, or unknown breakdownapplication/json
Error codes
- BAD_REQUESTThe request is malformed: a parameter or a body field is not a well-formed value of its type
errorErrorBody
- The ErrorBody schema
- codestringThe coarse category, tied to the status:
NOT_FOUND,CONFLICT,INSUFFICIENT_SCOPE. Every error has one; the API reference's error catalogue lists them all. - messagestringWhat went wrong, for a person. Written to be read, not parsed: match on
reasonorcode. - fieldstring or nulloptionalOn a
400that refused one field's value, the field, as its JSON path:email,items[0].name. Put the message under that input. Absent on every other error. - reasonstring or nulloptionalThe specific code, when the error has one:
LAST_ORGANIZATION_OWNER,BRANCH_PROTECTED. The message starts with it too. Match on this when it is present, and oncodeotherwise. - required_scopestring or nulloptionalThe scope the access token was missing, on
INSUFFICIENT_SCOPE. - violationsanyoptionalPresent on the structured-validation errors (
PROVIDER_VALIDATION_FAILEDper-node,PIPELINE_VALIDATION_FAILEDDAG): a JSON array of the offending elements, so a caller can fix every one in a single round-trip. Absent (omitted) on every other error.
400 exampleSynthesized example
{
"error": {
"code": "code-578b",
"message": "Stream pipeline status into the run header"
}
}
401Unauthenticated — no credential, or an invalid oneapplication/json
Error codes
- UNAUTHORIZEDNo credential was sent, or the one sent is invalid, expired or revoked
errorErrorBody
- The ErrorBody schema
- codestringThe coarse category, tied to the status:
NOT_FOUND,CONFLICT,INSUFFICIENT_SCOPE. Every error has one; the API reference's error catalogue lists them all. - messagestringWhat went wrong, for a person. Written to be read, not parsed: match on
reasonorcode. - fieldstring or nulloptionalOn a
400that refused one field's value, the field, as its JSON path:email,items[0].name. Put the message under that input. Absent on every other error. - reasonstring or nulloptionalThe specific code, when the error has one:
LAST_ORGANIZATION_OWNER,BRANCH_PROTECTED. The message starts with it too. Match on this when it is present, and oncodeotherwise. - required_scopestring or nulloptionalThe scope the access token was missing, on
INSUFFICIENT_SCOPE. - violationsanyoptionalPresent on the structured-validation errors (
PROVIDER_VALIDATION_FAILEDper-node,PIPELINE_VALIDATION_FAILEDDAG): a JSON array of the offending elements, so a caller can fix every one in a single round-trip. Absent (omitted) on every other error.
401 exampleSynthesized example
{
"error": {
"code": "code-383f",
"message": "Pin a page's payload to the build that rendered it"
}
}
403Forbidden — the caller's access level or token scope is insufficientapplication/json
Error codes
- FORBIDDENYou are signed in but may not do this here;
reasonnames the permission or the rule that refused it - INSUFFICIENT_SCOPEThe access token lacks the scope this operation needs;
required_scopenames it - PERMISSION_REQUIREDYou need a permission you do not hold here; the message names it
errorErrorBody
- The ErrorBody schema
- codestringThe coarse category, tied to the status:
NOT_FOUND,CONFLICT,INSUFFICIENT_SCOPE. Every error has one; the API reference's error catalogue lists them all. - messagestringWhat went wrong, for a person. Written to be read, not parsed: match on
reasonorcode. - fieldstring or nulloptionalOn a
400that refused one field's value, the field, as its JSON path:email,items[0].name. Put the message under that input. Absent on every other error. - reasonstring or nulloptionalThe specific code, when the error has one:
LAST_ORGANIZATION_OWNER,BRANCH_PROTECTED. The message starts with it too. Match on this when it is present, and oncodeotherwise. - required_scopestring or nulloptionalThe scope the access token was missing, on
INSUFFICIENT_SCOPE. - violationsanyoptionalPresent on the structured-validation errors (
PROVIDER_VALIDATION_FAILEDper-node,PIPELINE_VALIDATION_FAILEDDAG): a JSON array of the offending elements, so a caller can fix every one in a single round-trip. Absent (omitted) on every other error.
403 exampleSynthesized example
{
"error": {
"code": "code-087e",
"message": "Draw the region map from operation density"
}
}
404No such group, or it is not visible to the callerapplication/json
Error codes
- NOT_FOUNDThe resource does not exist — or exists and you cannot see it: a private resource you have no access to answers exactly as an absent one does
errorErrorBody
- The ErrorBody schema
- codestringThe coarse category, tied to the status:
NOT_FOUND,CONFLICT,INSUFFICIENT_SCOPE. Every error has one; the API reference's error catalogue lists them all. - messagestringWhat went wrong, for a person. Written to be read, not parsed: match on
reasonorcode. - fieldstring or nulloptionalOn a
400that refused one field's value, the field, as its JSON path:email,items[0].name. Put the message under that input. Absent on every other error. - reasonstring or nulloptionalThe specific code, when the error has one:
LAST_ORGANIZATION_OWNER,BRANCH_PROTECTED. The message starts with it too. Match on this when it is present, and oncodeotherwise. - required_scopestring or nulloptionalThe scope the access token was missing, on
INSUFFICIENT_SCOPE. - violationsanyoptionalPresent on the structured-validation errors (
PROVIDER_VALIDATION_FAILEDper-node,PIPELINE_VALIDATION_FAILEDDAG): a JSON array of the offending elements, so a caller can fix every one in a single round-trip. Absent (omitted) on every other error.
404 exampleSynthesized example
{
"error": {
"code": "code-0318",
"message": "Stream pipeline status into the run header"
}
}
CLI
gitmoap insights get-group-insights
- --group-ididThe group's id (id or group path)
- --breakdownstringoptionalnone | repository (default: none)
- --fromstringoptionalYYYY-MM-DD start of the window
- --granularitystringoptionalday | week | month (default: day)
- --tostringoptionalYYYY-MM-DD end, inclusive