{"openapi":"3.1.0","x-id":["reitit.openapi/default"],"info":{"title":"CodeScene API","description":"API for CodeScene","version":"3.0"},"paths":{"/api/account/ui-context":{"get":{"responses":{"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BadRequestError"}}}},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UnauthorizedError"}}}},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ForbiddenError"}}}},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/NotFoundError"}}}},"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"admin?":{"type":"boolean"},"username":{"oneOf":[{"type":"string"},{"type":"null"}]},"userId":{"type":"integer"},"accountId":{"type":"integer"},"featureFlags":{"type":"array","items":{"type":"string"}},"product":{"type":"string"}},"required":["admin?","username","userId","accountId","featureFlags","product"],"additionalProperties":false}}}}},"tags":["account"],"summary":"Get UI context","description":"Returns user context information required for the UI"}},"/api/analytics/metrics":{"get":{"responses":{"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BadRequestError"}}}},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UnauthorizedError"}}}},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ForbiddenError"}}}},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/NotFoundError"}}}},"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"metrics":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"label":{"type":"string"},"unitLabel":{"type":"string"},"unitType":{"type":"string","enum":["scalar","percentage","ranged","code-health","duration"]},"directionality":{"type":"string","enum":["higher-is-better","lower-is-better","neutral"]},"displayable":{"type":"boolean"},"public":{"type":"boolean"},"category":{"type":"string"},"boundedScale":{"type":"object","properties":{"min":{"type":"number"},"max":{"type":"number"}},"required":["min","max"],"additionalProperties":false},"ranges":{"type":"array","items":{"type":"object","properties":{"min":{"type":"object","properties":{"type":{"type":"string","enum":["inclusive","exclusive"]},"val":{"type":"number"}},"required":["type","val"],"additionalProperties":false},"max":{"type":"object","properties":{"type":{"type":"string","enum":["inclusive","exclusive"]},"val":{"type":"number"}},"required":["type","val"],"additionalProperties":false},"meaning":{"type":"string","enum":["success","warning","danger","invalid","info"]},"label":{"type":"string"}},"required":["min","max","meaning","label"],"additionalProperties":false}},"weightMetric":{"type":"string"},"description":{"type":"string"},"interpretation":{"type":"string"},"deprecated?":{"type":"boolean"}},"required":["id","label","unitLabel","unitType","directionality","displayable","public","description"],"additionalProperties":false}}},"required":["metrics"],"additionalProperties":false}}}}},"tags":["analytics"],"summary":"List all metric definitions"}},"/api/analytics/areas":{"get":{"parameters":[{"in":"query","name":"pageSize","required":false,"schema":{"type":"integer","minimum":1,"maximum":15000},"description":"Number of data points to return per page. Defaults to 100."},{"in":"query","name":"pageToken","required":false,"schema":{"type":"string"},"description":"Opaque cursor returned as nextPageToken in a previous response. Resumes pagination from where the previous page ended. pageSize may differ from the original request."},{"in":"query","name":"sort","required":false,"schema":{"type":"string"},"description":"Sort results by a property. Format: property or property:asc / property:desc. Valid sort properties depend on the endpoint."}],"responses":{"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BadRequestError"}}}},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UnauthorizedError"}}}},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ForbiddenError"}}}},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/NotFoundError"}}}},"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"areas":{"type":"array","items":{"type":"object","properties":{"id":{"type":"integer"},"name":{"type":"string"},"parentAreaId":{"oneOf":[{"type":"integer"},{"type":"null"}]},"areas":{"type":"array","items":{}},"projects":{"type":"array","items":{}}},"required":["id","name"],"additionalProperties":false}},"nextPageToken":{"type":"string","description":"Opaque cursor for the next page. Absent on the last page or when all results fit in one page.","example":"eyJwYWdlTmJyIjoxLCJwYWdlU2l6ZSI6NTB9"}},"required":["areas"],"additionalProperties":false}}}}},"tags":["analytics"],"summary":"List all areas"},"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string"},"parentAreaId":{"type":"integer"}},"required":["name"],"additionalProperties":false}}}},"responses":{"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BadRequestError"}}}},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UnauthorizedError"}}}},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ForbiddenError"}}}},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/NotFoundError"}}}},"201":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Area"}}}}},"tags":["analytics"],"summary":"Create a new area"}},"/api/analytics/areas/{areaId}":{"get":{"parameters":[{"in":"path","name":"areaId","required":true,"schema":{"type":"integer"}}],"responses":{"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BadRequestError"}}}},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UnauthorizedError"}}}},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ForbiddenError"}}}},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/NotFoundError"}}}},"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Area"}}}}},"tags":["analytics"],"summary":"Get area by ID"},"delete":{"parameters":[{"in":"path","name":"areaId","required":true,"schema":{"type":"integer"}}],"responses":{"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BadRequestError"}}}},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UnauthorizedError"}}}},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ForbiddenError"}}}},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/NotFoundError"}}}},"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"],"additionalProperties":false}}}}},"tags":["analytics"],"summary":"Delete area"},"patch":{"parameters":[{"in":"path","name":"areaId","required":true,"schema":{"type":"integer"}}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string"}},"required":["name"],"additionalProperties":false}}}},"responses":{"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BadRequestError"}}}},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UnauthorizedError"}}}},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ForbiddenError"}}}},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/NotFoundError"}}}},"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Area"}}}}},"tags":["analytics"],"summary":"Update area"}},"/api/analytics/areas/{areaId}/projects":{"post":{"parameters":[{"in":"path","name":"areaId","required":true,"schema":{"type":"integer"}}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"projectIds":{"type":"array","items":{"type":"integer"}}},"required":["projectIds"],"additionalProperties":false}}}},"responses":{"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BadRequestError"}}}},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UnauthorizedError"}}}},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ForbiddenError"}}}},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/NotFoundError"}}}},"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"],"additionalProperties":false}}}}},"tags":["analytics"],"summary":"Assign projects to area"},"delete":{"parameters":[{"in":"path","name":"areaId","required":true,"schema":{"type":"integer"}}],"responses":{"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BadRequestError"}}}},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UnauthorizedError"}}}},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ForbiddenError"}}}},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/NotFoundError"}}}},"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"],"additionalProperties":false}}}}},"tags":["analytics"],"summary":"Unassign all projects from area"}},"/api/analytics/areas/{areaId}/projects/{projectId}":{"delete":{"parameters":[{"in":"path","name":"areaId","required":true,"schema":{"type":"integer"}},{"in":"path","name":"projectId","required":true,"schema":{"type":"integer"}}],"responses":{"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BadRequestError"}}}},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UnauthorizedError"}}}},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ForbiddenError"}}}},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/NotFoundError"}}}},"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"],"additionalProperties":false}}}}},"tags":["analytics"],"summary":"Unassign specific project from area"}},"/api/analytics/tags":{"get":{"parameters":[{"in":"query","name":"pageSize","required":false,"schema":{"type":"integer","minimum":1,"maximum":15000},"description":"Number of data points to return per page. Defaults to 100."},{"in":"query","name":"pageToken","required":false,"schema":{"type":"string"},"description":"Opaque cursor returned as nextPageToken in a previous response. Resumes pagination from where the previous page ended. pageSize may differ from the original request."},{"in":"query","name":"sort","required":false,"schema":{"type":"string"},"description":"Sort results by a property. Format: property or property:asc / property:desc. Valid sort properties depend on the endpoint."}],"responses":{"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BadRequestError"}}}},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UnauthorizedError"}}}},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ForbiddenError"}}}},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/NotFoundError"}}}},"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"tags":{"type":"array","items":{"type":"object","properties":{"id":{"type":"integer"},"name":{"type":"string"}},"required":["id","name"],"additionalProperties":false}},"nextPageToken":{"type":"string","description":"Opaque cursor for the next page. Absent on the last page or when all results fit in one page.","example":"eyJwYWdlTmJyIjoxLCJwYWdlU2l6ZSI6NTB9"}},"required":["tags"],"additionalProperties":false}}}}},"tags":["analytics"],"summary":"List all tags"},"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string"}},"required":["name"],"additionalProperties":false}}}},"responses":{"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BadRequestError"}}}},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UnauthorizedError"}}}},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ForbiddenError"}}}},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/NotFoundError"}}}},"201":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Tag"}}}}},"tags":["analytics"],"summary":"Create a new tag"}},"/api/analytics/tags/{tagId}":{"get":{"parameters":[{"in":"path","name":"tagId","required":true,"schema":{"type":"integer"}}],"responses":{"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BadRequestError"}}}},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UnauthorizedError"}}}},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ForbiddenError"}}}},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/NotFoundError"}}}},"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Tag"}}}}},"tags":["analytics"],"summary":"Get tag by ID"},"delete":{"parameters":[{"in":"path","name":"tagId","required":true,"schema":{"type":"integer"}}],"responses":{"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BadRequestError"}}}},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UnauthorizedError"}}}},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ForbiddenError"}}}},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/NotFoundError"}}}},"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"],"additionalProperties":false}}}}},"tags":["analytics"],"summary":"Delete tag"},"patch":{"parameters":[{"in":"path","name":"tagId","required":true,"schema":{"type":"integer"}}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string"}},"required":["name"],"additionalProperties":false}}}},"responses":{"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BadRequestError"}}}},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UnauthorizedError"}}}},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ForbiddenError"}}}},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/NotFoundError"}}}},"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Tag"}}}}},"tags":["analytics"],"summary":"Update tag"}},"/api/analytics/projects":{"get":{"parameters":[{"in":"query","name":"pageSize","required":false,"schema":{"type":"integer","minimum":1,"maximum":15000},"description":"Number of data points to return per page. Defaults to 100."},{"in":"query","name":"pageToken","required":false,"schema":{"type":"string"},"description":"Opaque cursor returned as nextPageToken in a previous response. Resumes pagination from where the previous page ended. pageSize may differ from the original request."},{"in":"query","name":"sort","required":false,"schema":{"type":"string"},"description":"Sort results by a property. Format: property or property:asc / property:desc. Valid sort properties depend on the endpoint."}],"responses":{"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BadRequestError"}}}},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UnauthorizedError"}}}},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ForbiddenError"}}}},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/NotFoundError"}}}},"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"projects":{"type":"array","items":{"type":"object","properties":{"analyticalUnitId":{"type":"integer"},"projectId":{"type":"integer"},"name":{"type":"string"},"parentAreaId":{"oneOf":[{"type":"integer"},{"type":"null"}]},"archivedAt":{"oneOf":[{"type":"string"},{"type":"null"}]}},"required":["analyticalUnitId","projectId","name"],"additionalProperties":false}},"nextPageToken":{"type":"string","description":"Opaque cursor for the next page. Absent on the last page or when all results fit in one page.","example":"eyJwYWdlTmJyIjoxLCJwYWdlU2l6ZSI6NTB9"}},"required":["projects"],"additionalProperties":false}}}}},"tags":["analytics"],"summary":"List all projects"}},"/api/analytics/projects/{projectId}/tags":{"get":{"parameters":[{"in":"path","name":"projectId","required":true,"schema":{"type":"integer"}},{"in":"query","name":"component","required":false,"schema":{"type":"string"}},{"in":"query","name":"team","required":false,"schema":{"type":"string"}},{"in":"query","name":"language","required":false,"schema":{"type":"string"}},{"in":"query","name":"pageSize","required":false,"schema":{"type":"integer","minimum":1,"maximum":15000},"description":"Number of data points to return per page. Defaults to 100."},{"in":"query","name":"pageToken","required":false,"schema":{"type":"string"},"description":"Opaque cursor returned as nextPageToken in a previous response. Resumes pagination from where the previous page ended. pageSize may differ from the original request."},{"in":"query","name":"sort","required":false,"schema":{"type":"string"},"description":"Sort results by a property. Format: property or property:asc / property:desc. Valid sort properties depend on the endpoint."}],"responses":{"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BadRequestError"}}}},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UnauthorizedError"}}}},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ForbiddenError"}}}},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/NotFoundError"}}}},"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"tags":{"type":"array","items":{"type":"object","properties":{"id":{"type":"integer"},"name":{"type":"string"}},"required":["id","name"],"additionalProperties":false}},"nextPageToken":{"type":"string","description":"Opaque cursor for the next page. Absent on the last page or when all results fit in one page.","example":"eyJwYWdlTmJyIjoxLCJwYWdlU2l6ZSI6NTB9"}},"required":["tags"],"additionalProperties":false}}}}},"tags":["analytics"],"summary":"List tags for project, component, team, or language","description":"Scope is determined by the first matching query param: component > team > language. Omit all three to target the project itself. Passing multiple scope params is not recommended — only the highest-priority one takes effect."},"post":{"parameters":[{"in":"path","name":"projectId","required":true,"schema":{"type":"integer"}},{"in":"query","name":"component","required":false,"schema":{"type":"string"}},{"in":"query","name":"team","required":false,"schema":{"type":"string"}},{"in":"query","name":"language","required":false,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"tagIds":{"type":"array","items":{"type":"integer"}}},"required":["tagIds"],"additionalProperties":false}}}},"responses":{"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BadRequestError"}}}},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UnauthorizedError"}}}},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ForbiddenError"}}}},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/NotFoundError"}}}},"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"],"additionalProperties":false}}}}},"tags":["analytics"],"summary":"Assign tags to project, component, team, or language","description":"Scope is determined by the first matching query param: component > team > language. Omit all three to target the project itself. Passing multiple scope params is not recommended — only the highest-priority one takes effect."},"delete":{"parameters":[{"in":"path","name":"projectId","required":true,"schema":{"type":"integer"}},{"in":"query","name":"component","required":false,"schema":{"type":"string"}},{"in":"query","name":"team","required":false,"schema":{"type":"string"}},{"in":"query","name":"language","required":false,"schema":{"type":"string"}}],"responses":{"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BadRequestError"}}}},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UnauthorizedError"}}}},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ForbiddenError"}}}},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/NotFoundError"}}}},"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"],"additionalProperties":false}}}}},"tags":["analytics"],"summary":"Unassign all tags from project, component, team, or language","description":"Scope is determined by the first matching query param: component > team > language. Omit all three to target the project itself. Passing multiple scope params is not recommended — only the highest-priority one takes effect."}},"/api/analytics/projects/{projectId}/tags/{tagId}":{"delete":{"parameters":[{"in":"path","name":"projectId","required":true,"schema":{"type":"integer"}},{"in":"path","name":"tagId","required":true,"schema":{"type":"integer"}},{"in":"query","name":"component","required":false,"schema":{"type":"string"}},{"in":"query","name":"team","required":false,"schema":{"type":"string"}},{"in":"query","name":"language","required":false,"schema":{"type":"string"}}],"responses":{"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BadRequestError"}}}},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UnauthorizedError"}}}},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ForbiddenError"}}}},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/NotFoundError"}}}},"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"],"additionalProperties":false}}}}},"tags":["analytics"],"summary":"Unassign specific tag from project, component, team, or language","description":"Scope is determined by the first matching query param: component > team > language. Omit all three to target the project itself. Passing multiple scope params is not recommended — only the highest-priority one takes effect."}},"/api/analytics/query":{"post":{"responses":{"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BadRequestError"}}}},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UnauthorizedError"}}}},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ForbiddenError"}}}},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/NotFoundError"}}}},"200":{"content":{"application/json":{"schema":{}}}}},"tags":["analytics"],"summary":"Query user's default area metrics","deprecated":true}},"/api/analytics/query/area/{areaId}":{"post":{"parameters":[{"in":"path","name":"areaId","required":true,"schema":{"type":"integer"}}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"startDate":{"type":"string","format":"date-time","example":"2026-03-20T00:00:00.000Z"},"endDate":{"type":"string","format":"date-time","example":"2026-03-20T00:00:00.000Z"}},"additionalProperties":false}}}},"responses":{"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BadRequestError"}}}},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UnauthorizedError"}}}},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ForbiddenError"}}}},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/NotFoundError"}}}},"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"type":{"const":"area"},"areaId":{"type":"integer"},"name":{"type":"string"},"metrics":{"type":"object","additionalProperties":{"type":"object","properties":{"current":{"type":"object","properties":{"found":{"type":"integer"},"missing":{"type":"integer"},"value":{"type":"number"}},"required":["found","missing","value"],"additionalProperties":false},"previous":{"type":"object","properties":{"value":{"type":"number"}},"required":["value"],"additionalProperties":false}},"required":["current"],"additionalProperties":false}},"children":{"type":"object","properties":{"items":{"type":"array","items":{"anyOf":[{"type":"object","properties":{"type":{"const":"area"},"areaId":{"type":"integer"},"name":{"type":"string"},"metrics":{"type":"object","additionalProperties":{"type":"object","properties":{"current":{"type":"object","properties":{"found":{"type":"integer"},"missing":{"type":"integer"},"value":{"type":"number"}},"required":["found","missing","value"],"additionalProperties":false},"previous":{"type":"object","properties":{"value":{"type":"number"}},"required":["value"],"additionalProperties":false}},"required":["current"],"additionalProperties":false}}},"required":["type","areaId","name","metrics"],"additionalProperties":false},{"type":"object","properties":{"type":{"const":"analytical-unit"},"analyticalUnitId":{"type":"integer"},"name":{"type":"string"},"metrics":{"type":"object","additionalProperties":{"type":"object","properties":{"current":{"type":"object","properties":{"found":{"type":"integer"},"missing":{"type":"integer"},"value":{"type":"number"}},"required":["found","missing","value"],"additionalProperties":false},"previous":{"type":"object","properties":{"value":{"type":"number"}},"required":["value"],"additionalProperties":false}},"required":["current"],"additionalProperties":false}},"archivedAt":{"type":"string"}},"required":["type","analyticalUnitId","name","metrics"],"additionalProperties":false}]}}},"required":["items"],"additionalProperties":false}},"required":["type","areaId","name","metrics","children"],"additionalProperties":false}}}}},"tags":["analytics"],"summary":"Query area metrics"}},"/api/analytics/query/analytical-unit/{analyticalUnitId}":{"post":{"parameters":[{"in":"path","name":"analyticalUnitId","required":true,"schema":{"type":"integer"}}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"startDate":{"type":"string","format":"date-time","example":"2026-03-20T00:00:00.000Z"},"endDate":{"type":"string","format":"date-time","example":"2026-03-20T00:00:00.000Z"}},"additionalProperties":false}}}},"responses":{"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BadRequestError"}}}},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UnauthorizedError"}}}},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ForbiddenError"}}}},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/NotFoundError"}}}},"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"type":{"const":"analytical-unit"},"analyticalUnitType":{"type":"string"},"analyticalUnitId":{"type":"integer"},"name":{"type":"string"},"metrics":{"type":"object","additionalProperties":{"type":"object","properties":{"current":{"type":"object","properties":{"found":{"type":"integer"},"missing":{"type":"integer"},"value":{"type":"number"}},"required":["found","missing","value"],"additionalProperties":false},"previous":{"type":"object","properties":{"value":{"type":"number"}},"required":["value"],"additionalProperties":false}},"required":["current"],"additionalProperties":false}}},"required":["type","analyticalUnitType","analyticalUnitId","name","metrics"],"additionalProperties":false}}}}},"tags":["analytics"],"summary":"Query analytical unit metrics"}},"/api/analytics/dashboards":{"get":{"parameters":[{"in":"query","name":"owner","required":false,"schema":{"type":"boolean"}}],"responses":{"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BadRequestError"}}}},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UnauthorizedError"}}}},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ForbiddenError"}}}},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/NotFoundError"}}}},"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"dashboards":{"type":"array","items":{"type":"object","properties":{"id":{"type":"integer"},"name":{"type":"string"},"owner":{"type":"object","properties":{"id":{"anyOf":[{"type":"integer"},{"type":"string"}]},"name":{"type":"string"}},"required":["id","name"],"additionalProperties":false},"query":{"type":"object","properties":{"type":{"const":"project-aggregation"},"nameParams":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"value":{"oneOf":[{"type":"string"},{"type":"null"}]},"sortOrder":{"type":"integer"}},"required":["name","value","sortOrder"],"additionalProperties":false}},"tagsFilter":{}},"required":["type","nameParams"],"additionalProperties":false},"visibility":{"type":"object","properties":{"published":{"type":"boolean"}},"required":["published"],"additionalProperties":false},"permissions":{"type":"object","properties":{"canEdit":{"type":"boolean"},"canDelete":{"type":"boolean"}},"required":["canEdit","canDelete"],"additionalProperties":false},"dateRange":{"anyOf":[{"allOf":[{"type":"object","properties":{"rangeType":{"const":"relative"},"value":{"allOf":[{"type":"integer"},{"type":"number","minimum":0}]},"unit":{"type":"string","enum":["week","month","quarter","year"]}},"required":["rangeType","value","unit"],"additionalProperties":false},{}]},{"type":"object","properties":{"rangeType":{"const":"absolute"},"startDate":{"type":"string"},"endDate":{"type":"string"}},"required":["rangeType","startDate","endDate"],"additionalProperties":false}]},"widgets":{"type":"array","items":{"type":"object","properties":{"id":{"type":"integer"},"variantId":{"type":"string"},"type":{"type":"string","enum":["kpiCard","lineChart","table","histogram","systemMap","aiText"]},"inputs":{"type":"array","items":{"anyOf":[{"type":"object","properties":{"type":{"const":"metric"},"value":{"type":"string"},"internalId":{"type":"string"},"label":{"type":"string"}},"required":["type","value"],"additionalProperties":false},{"type":"object","properties":{"type":{"const":"queryKey"},"value":{"type":"string"},"internalId":{"type":"string"},"label":{"type":"string"}},"required":["type","value"],"additionalProperties":false},{"type":"object","properties":{"type":{"const":"number"},"value":{"type":"number"},"internalId":{"type":"string"},"label":{"type":"string"}},"required":["type","value"],"additionalProperties":false}]}},"layout":{"type":"string","enum":["narrow","quarter","third","half","full","main"]},"placement":{"type":"object","properties":{"colSpan":{"type":"integer","minimum":1,"maximum":4},"rowSpan":{"type":"integer","minimum":1,"maximum":3},"detail":{"type":"string","enum":["compact","standard","detailed"]}},"required":["colSpan","rowSpan"],"additionalProperties":false},"title":{"oneOf":[{"type":"string"},{"type":"null"}]},"position":{"type":"integer"},"query":{"type":"object","properties":{"type":{"const":"project-aggregation"},"nameParams":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"value":{"oneOf":[{"type":"string"},{"type":"null"}]},"sortOrder":{"type":"integer"}},"required":["name","value","sortOrder"],"additionalProperties":false}},"tagsFilter":{}},"required":["type","nameParams"],"additionalProperties":false}},"required":["id","variantId","type","inputs"],"additionalProperties":false}},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"deletedAt":{"oneOf":[{"type":"string"},{"type":"null"}]}},"required":["id","name","owner","query","visibility","permissions","dateRange","widgets","createdAt","updatedAt"],"additionalProperties":false}}},"required":["dashboards"],"additionalProperties":false}}}}},"tags":["analytics"],"summary":"List account dashboards"},"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string"},"query":{"type":"object","properties":{"type":{"const":"project-aggregation"},"nameParams":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"value":{"oneOf":[{"type":"string"},{"type":"null"}]},"sortOrder":{"type":"integer"}},"required":["name","value","sortOrder"],"additionalProperties":false}},"tagsFilter":{}},"required":["type","nameParams"],"additionalProperties":false},"visibility":{"type":"object","properties":{"published":{"type":"boolean"}},"required":["published"],"additionalProperties":false},"dateRange":{"anyOf":[{"allOf":[{"type":"object","properties":{"rangeType":{"const":"relative"},"value":{"allOf":[{"type":"integer"},{"type":"number","minimum":0}]},"unit":{"type":"string","enum":["week","month","quarter","year"]}},"required":["rangeType","value","unit"],"additionalProperties":false},{}]},{"type":"object","properties":{"rangeType":{"const":"absolute"},"startDate":{"type":"string"},"endDate":{"type":"string"}},"required":["rangeType","startDate","endDate"],"additionalProperties":false}]},"widgets":{"type":"array","items":{"type":"object","properties":{"variantId":{"type":"string"},"layout":{"type":"string","enum":["narrow","quarter","third","half","full","main"]},"placement":{"type":"object","properties":{"colSpan":{"type":"integer","minimum":1,"maximum":4},"rowSpan":{"type":"integer","minimum":1,"maximum":3},"detail":{"type":"string","enum":["compact","standard","detailed"]}},"required":["colSpan","rowSpan"],"additionalProperties":false},"title":{"oneOf":[{"type":"string"},{"type":"null"}]},"position":{"type":"integer"}},"required":["variantId"],"additionalProperties":false}}},"required":["name","query","visibility","dateRange","widgets"],"additionalProperties":false}}}},"responses":{"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BadRequestError"}}}},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UnauthorizedError"}}}},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ForbiddenError"}}}},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/NotFoundError"}}}},"201":{"content":{"application/json":{"schema":{"type":"object","properties":{"dashboard":{"type":"object","properties":{"id":{"type":"integer"},"name":{"type":"string"},"owner":{"type":"object","properties":{"id":{"anyOf":[{"type":"integer"},{"type":"string"}]},"name":{"type":"string"}},"required":["id","name"],"additionalProperties":false},"query":{"type":"object","properties":{"type":{"const":"project-aggregation"},"nameParams":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"value":{"oneOf":[{"type":"string"},{"type":"null"}]},"sortOrder":{"type":"integer"}},"required":["name","value","sortOrder"],"additionalProperties":false}},"tagsFilter":{}},"required":["type","nameParams"],"additionalProperties":false},"visibility":{"type":"object","properties":{"published":{"type":"boolean"}},"required":["published"],"additionalProperties":false},"permissions":{"type":"object","properties":{"canEdit":{"type":"boolean"},"canDelete":{"type":"boolean"}},"required":["canEdit","canDelete"],"additionalProperties":false},"dateRange":{"anyOf":[{"allOf":[{"type":"object","properties":{"rangeType":{"const":"relative"},"value":{"allOf":[{"type":"integer"},{"type":"number","minimum":0}]},"unit":{"type":"string","enum":["week","month","quarter","year"]}},"required":["rangeType","value","unit"],"additionalProperties":false},{}]},{"type":"object","properties":{"rangeType":{"const":"absolute"},"startDate":{"type":"string"},"endDate":{"type":"string"}},"required":["rangeType","startDate","endDate"],"additionalProperties":false}]},"widgets":{"type":"array","items":{"type":"object","properties":{"id":{"type":"integer"},"variantId":{"type":"string"},"type":{"type":"string","enum":["kpiCard","lineChart","table","histogram","systemMap","aiText"]},"inputs":{"type":"array","items":{"anyOf":[{"type":"object","properties":{"type":{"const":"metric"},"value":{"type":"string"},"internalId":{"type":"string"},"label":{"type":"string"}},"required":["type","value"],"additionalProperties":false},{"type":"object","properties":{"type":{"const":"queryKey"},"value":{"type":"string"},"internalId":{"type":"string"},"label":{"type":"string"}},"required":["type","value"],"additionalProperties":false},{"type":"object","properties":{"type":{"const":"number"},"value":{"type":"number"},"internalId":{"type":"string"},"label":{"type":"string"}},"required":["type","value"],"additionalProperties":false}]}},"layout":{"type":"string","enum":["narrow","quarter","third","half","full","main"]},"placement":{"type":"object","properties":{"colSpan":{"type":"integer","minimum":1,"maximum":4},"rowSpan":{"type":"integer","minimum":1,"maximum":3},"detail":{"type":"string","enum":["compact","standard","detailed"]}},"required":["colSpan","rowSpan"],"additionalProperties":false},"title":{"oneOf":[{"type":"string"},{"type":"null"}]},"position":{"type":"integer"},"query":{"type":"object","properties":{"type":{"const":"project-aggregation"},"nameParams":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"value":{"oneOf":[{"type":"string"},{"type":"null"}]},"sortOrder":{"type":"integer"}},"required":["name","value","sortOrder"],"additionalProperties":false}},"tagsFilter":{}},"required":["type","nameParams"],"additionalProperties":false}},"required":["id","variantId","type","inputs"],"additionalProperties":false}},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"deletedAt":{"oneOf":[{"type":"string"},{"type":"null"}]}},"required":["id","name","owner","query","visibility","permissions","dateRange","widgets","createdAt","updatedAt"],"additionalProperties":false}},"required":["dashboard"],"additionalProperties":false}}}}},"tags":["analytics"],"summary":"Create a dashboard"}},"/api/analytics/dashboards/{dashboardId}":{"get":{"parameters":[{"in":"path","name":"dashboardId","required":true,"schema":{"type":"integer"}}],"responses":{"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BadRequestError"}}}},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UnauthorizedError"}}}},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ForbiddenError"}}}},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/NotFoundError"}}}},"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"dashboard":{"type":"object","properties":{"id":{"type":"integer"},"name":{"type":"string"},"owner":{"type":"object","properties":{"id":{"anyOf":[{"type":"integer"},{"type":"string"}]},"name":{"type":"string"}},"required":["id","name"],"additionalProperties":false},"query":{"type":"object","properties":{"type":{"const":"project-aggregation"},"nameParams":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"value":{"oneOf":[{"type":"string"},{"type":"null"}]},"sortOrder":{"type":"integer"}},"required":["name","value","sortOrder"],"additionalProperties":false}},"tagsFilter":{}},"required":["type","nameParams"],"additionalProperties":false},"visibility":{"type":"object","properties":{"published":{"type":"boolean"}},"required":["published"],"additionalProperties":false},"permissions":{"type":"object","properties":{"canEdit":{"type":"boolean"},"canDelete":{"type":"boolean"}},"required":["canEdit","canDelete"],"additionalProperties":false},"dateRange":{"anyOf":[{"allOf":[{"type":"object","properties":{"rangeType":{"const":"relative"},"value":{"allOf":[{"type":"integer"},{"type":"number","minimum":0}]},"unit":{"type":"string","enum":["week","month","quarter","year"]}},"required":["rangeType","value","unit"],"additionalProperties":false},{}]},{"type":"object","properties":{"rangeType":{"const":"absolute"},"startDate":{"type":"string"},"endDate":{"type":"string"}},"required":["rangeType","startDate","endDate"],"additionalProperties":false}]},"widgets":{"type":"array","items":{"type":"object","properties":{"id":{"type":"integer"},"variantId":{"type":"string"},"type":{"type":"string","enum":["kpiCard","lineChart","table","histogram","systemMap","aiText"]},"inputs":{"type":"array","items":{"anyOf":[{"type":"object","properties":{"type":{"const":"metric"},"value":{"type":"string"},"internalId":{"type":"string"},"label":{"type":"string"}},"required":["type","value"],"additionalProperties":false},{"type":"object","properties":{"type":{"const":"queryKey"},"value":{"type":"string"},"internalId":{"type":"string"},"label":{"type":"string"}},"required":["type","value"],"additionalProperties":false},{"type":"object","properties":{"type":{"const":"number"},"value":{"type":"number"},"internalId":{"type":"string"},"label":{"type":"string"}},"required":["type","value"],"additionalProperties":false}]}},"layout":{"type":"string","enum":["narrow","quarter","third","half","full","main"]},"placement":{"type":"object","properties":{"colSpan":{"type":"integer","minimum":1,"maximum":4},"rowSpan":{"type":"integer","minimum":1,"maximum":3},"detail":{"type":"string","enum":["compact","standard","detailed"]}},"required":["colSpan","rowSpan"],"additionalProperties":false},"title":{"oneOf":[{"type":"string"},{"type":"null"}]},"position":{"type":"integer"},"query":{"type":"object","properties":{"type":{"const":"project-aggregation"},"nameParams":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"value":{"oneOf":[{"type":"string"},{"type":"null"}]},"sortOrder":{"type":"integer"}},"required":["name","value","sortOrder"],"additionalProperties":false}},"tagsFilter":{}},"required":["type","nameParams"],"additionalProperties":false}},"required":["id","variantId","type","inputs"],"additionalProperties":false}},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"deletedAt":{"oneOf":[{"type":"string"},{"type":"null"}]}},"required":["id","name","owner","query","visibility","permissions","dateRange","widgets","createdAt","updatedAt"],"additionalProperties":false}},"required":["dashboard"],"additionalProperties":false}}}}},"tags":["analytics"],"summary":"Get dashboard by ID"},"delete":{"parameters":[{"in":"path","name":"dashboardId","required":true,"schema":{"type":"integer"}}],"responses":{"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BadRequestError"}}}},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UnauthorizedError"}}}},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ForbiddenError"}}}},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/NotFoundError"}}}},"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"integer"}},"required":["id"],"additionalProperties":false}}}}},"tags":["analytics"],"summary":"Delete dashboard"},"patch":{"parameters":[{"in":"path","name":"dashboardId","required":true,"schema":{"type":"integer"}}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string"},"query":{"type":"object","properties":{"type":{"const":"project-aggregation"},"nameParams":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"value":{"oneOf":[{"type":"string"},{"type":"null"}]},"sortOrder":{"type":"integer"}},"required":["name","value","sortOrder"],"additionalProperties":false}},"tagsFilter":{}},"additionalProperties":false},"visibility":{"type":"object","properties":{"published":{"type":"boolean"}},"additionalProperties":false},"dateRange":{"anyOf":[{"allOf":[{"type":"object","properties":{"rangeType":{"const":"relative"},"value":{"allOf":[{"type":"integer"},{"type":"number","minimum":0}]},"unit":{"type":"string","enum":["week","month","quarter","year"]}},"required":["rangeType","value","unit"],"additionalProperties":false},{}]},{"type":"object","properties":{"rangeType":{"const":"absolute"},"startDate":{"type":"string"},"endDate":{"type":"string"}},"required":["rangeType","startDate","endDate"],"additionalProperties":false}]},"widgets":{"type":"array","items":{"type":"object","properties":{"variantId":{"type":"string"},"layout":{"type":"string","enum":["narrow","quarter","third","half","full","main"]},"placement":{"type":"object","properties":{"colSpan":{"type":"integer","minimum":1,"maximum":4},"rowSpan":{"type":"integer","minimum":1,"maximum":3},"detail":{"type":"string","enum":["compact","standard","detailed"]}},"required":["colSpan","rowSpan"],"additionalProperties":false},"title":{"oneOf":[{"type":"string"},{"type":"null"}]},"position":{"type":"integer"}},"required":["variantId"],"additionalProperties":false}}},"additionalProperties":false}}}},"responses":{"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BadRequestError"}}}},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UnauthorizedError"}}}},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ForbiddenError"}}}},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/NotFoundError"}}}},"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"dashboard":{"type":"object","properties":{"id":{"type":"integer"},"name":{"type":"string"},"owner":{"type":"object","properties":{"id":{"anyOf":[{"type":"integer"},{"type":"string"}]},"name":{"type":"string"}},"required":["id","name"],"additionalProperties":false},"query":{"type":"object","properties":{"type":{"const":"project-aggregation"},"nameParams":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"value":{"oneOf":[{"type":"string"},{"type":"null"}]},"sortOrder":{"type":"integer"}},"required":["name","value","sortOrder"],"additionalProperties":false}},"tagsFilter":{}},"required":["type","nameParams"],"additionalProperties":false},"visibility":{"type":"object","properties":{"published":{"type":"boolean"}},"required":["published"],"additionalProperties":false},"permissions":{"type":"object","properties":{"canEdit":{"type":"boolean"},"canDelete":{"type":"boolean"}},"required":["canEdit","canDelete"],"additionalProperties":false},"dateRange":{"anyOf":[{"allOf":[{"type":"object","properties":{"rangeType":{"const":"relative"},"value":{"allOf":[{"type":"integer"},{"type":"number","minimum":0}]},"unit":{"type":"string","enum":["week","month","quarter","year"]}},"required":["rangeType","value","unit"],"additionalProperties":false},{}]},{"type":"object","properties":{"rangeType":{"const":"absolute"},"startDate":{"type":"string"},"endDate":{"type":"string"}},"required":["rangeType","startDate","endDate"],"additionalProperties":false}]},"widgets":{"type":"array","items":{"type":"object","properties":{"id":{"type":"integer"},"variantId":{"type":"string"},"type":{"type":"string","enum":["kpiCard","lineChart","table","histogram","systemMap","aiText"]},"inputs":{"type":"array","items":{"anyOf":[{"type":"object","properties":{"type":{"const":"metric"},"value":{"type":"string"},"internalId":{"type":"string"},"label":{"type":"string"}},"required":["type","value"],"additionalProperties":false},{"type":"object","properties":{"type":{"const":"queryKey"},"value":{"type":"string"},"internalId":{"type":"string"},"label":{"type":"string"}},"required":["type","value"],"additionalProperties":false},{"type":"object","properties":{"type":{"const":"number"},"value":{"type":"number"},"internalId":{"type":"string"},"label":{"type":"string"}},"required":["type","value"],"additionalProperties":false}]}},"layout":{"type":"string","enum":["narrow","quarter","third","half","full","main"]},"placement":{"type":"object","properties":{"colSpan":{"type":"integer","minimum":1,"maximum":4},"rowSpan":{"type":"integer","minimum":1,"maximum":3},"detail":{"type":"string","enum":["compact","standard","detailed"]}},"required":["colSpan","rowSpan"],"additionalProperties":false},"title":{"oneOf":[{"type":"string"},{"type":"null"}]},"position":{"type":"integer"},"query":{"type":"object","properties":{"type":{"const":"project-aggregation"},"nameParams":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"value":{"oneOf":[{"type":"string"},{"type":"null"}]},"sortOrder":{"type":"integer"}},"required":["name","value","sortOrder"],"additionalProperties":false}},"tagsFilter":{}},"required":["type","nameParams"],"additionalProperties":false}},"required":["id","variantId","type","inputs"],"additionalProperties":false}},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"deletedAt":{"oneOf":[{"type":"string"},{"type":"null"}]}},"required":["id","name","owner","query","visibility","permissions","dateRange","widgets","createdAt","updatedAt"],"additionalProperties":false}},"required":["dashboard"],"additionalProperties":false}}}}},"tags":["analytics"],"summary":"Update dashboard"}},"/api/analytics/dashboards/{dashboardId}/restore":{"post":{"parameters":[{"in":"path","name":"dashboardId","required":true,"schema":{"type":"integer"}}],"responses":{"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BadRequestError"}}}},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UnauthorizedError"}}}},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ForbiddenError"}}}},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/NotFoundError"}}}},"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"dashboard":{"type":"object","properties":{"id":{"type":"integer"},"name":{"type":"string"},"owner":{"type":"object","properties":{"id":{"anyOf":[{"type":"integer"},{"type":"string"}]},"name":{"type":"string"}},"required":["id","name"],"additionalProperties":false},"query":{"type":"object","properties":{"type":{"const":"project-aggregation"},"nameParams":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"value":{"oneOf":[{"type":"string"},{"type":"null"}]},"sortOrder":{"type":"integer"}},"required":["name","value","sortOrder"],"additionalProperties":false}},"tagsFilter":{}},"required":["type","nameParams"],"additionalProperties":false},"visibility":{"type":"object","properties":{"published":{"type":"boolean"}},"required":["published"],"additionalProperties":false},"permissions":{"type":"object","properties":{"canEdit":{"type":"boolean"},"canDelete":{"type":"boolean"}},"required":["canEdit","canDelete"],"additionalProperties":false},"dateRange":{"anyOf":[{"allOf":[{"type":"object","properties":{"rangeType":{"const":"relative"},"value":{"allOf":[{"type":"integer"},{"type":"number","minimum":0}]},"unit":{"type":"string","enum":["week","month","quarter","year"]}},"required":["rangeType","value","unit"],"additionalProperties":false},{}]},{"type":"object","properties":{"rangeType":{"const":"absolute"},"startDate":{"type":"string"},"endDate":{"type":"string"}},"required":["rangeType","startDate","endDate"],"additionalProperties":false}]},"widgets":{"type":"array","items":{"type":"object","properties":{"id":{"type":"integer"},"variantId":{"type":"string"},"type":{"type":"string","enum":["kpiCard","lineChart","table","histogram","systemMap","aiText"]},"inputs":{"type":"array","items":{"anyOf":[{"type":"object","properties":{"type":{"const":"metric"},"value":{"type":"string"},"internalId":{"type":"string"},"label":{"type":"string"}},"required":["type","value"],"additionalProperties":false},{"type":"object","properties":{"type":{"const":"queryKey"},"value":{"type":"string"},"internalId":{"type":"string"},"label":{"type":"string"}},"required":["type","value"],"additionalProperties":false},{"type":"object","properties":{"type":{"const":"number"},"value":{"type":"number"},"internalId":{"type":"string"},"label":{"type":"string"}},"required":["type","value"],"additionalProperties":false}]}},"layout":{"type":"string","enum":["narrow","quarter","third","half","full","main"]},"placement":{"type":"object","properties":{"colSpan":{"type":"integer","minimum":1,"maximum":4},"rowSpan":{"type":"integer","minimum":1,"maximum":3},"detail":{"type":"string","enum":["compact","standard","detailed"]}},"required":["colSpan","rowSpan"],"additionalProperties":false},"title":{"oneOf":[{"type":"string"},{"type":"null"}]},"position":{"type":"integer"},"query":{"type":"object","properties":{"type":{"const":"project-aggregation"},"nameParams":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"value":{"oneOf":[{"type":"string"},{"type":"null"}]},"sortOrder":{"type":"integer"}},"required":["name","value","sortOrder"],"additionalProperties":false}},"tagsFilter":{}},"required":["type","nameParams"],"additionalProperties":false}},"required":["id","variantId","type","inputs"],"additionalProperties":false}},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"deletedAt":{"oneOf":[{"type":"string"},{"type":"null"}]}},"required":["id","name","owner","query","visibility","permissions","dateRange","widgets","createdAt","updatedAt"],"additionalProperties":false}},"required":["dashboard"],"additionalProperties":false}}}}},"tags":["analytics"],"summary":"Restore a soft-deleted dashboard"}},"/api/analytics/dashboard-templates":{"get":{"responses":{"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BadRequestError"}}}},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UnauthorizedError"}}}},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ForbiddenError"}}}},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/NotFoundError"}}}},"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"templates":{"type":"array","items":{"type":"object","properties":{"id":{"type":"integer"},"definitionId":{"type":"integer"},"name":{"type":"string"},"description":{"type":"string"},"query":{"type":"object","properties":{"type":{"const":"project-aggregation"},"nameParams":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"value":{"oneOf":[{"type":"string"},{"type":"null"}]},"sortOrder":{"type":"integer"}},"required":["name","value","sortOrder"],"additionalProperties":false}},"tagsFilter":{}},"required":["type","nameParams"],"additionalProperties":false},"dateRange":{"anyOf":[{"allOf":[{"type":"object","properties":{"rangeType":{"const":"relative"},"value":{"allOf":[{"type":"integer"},{"type":"number","minimum":0}]},"unit":{"type":"string","enum":["week","month","quarter","year"]}},"required":["rangeType","value","unit"],"additionalProperties":false},{}]},{"type":"object","properties":{"rangeType":{"const":"absolute"},"startDate":{"type":"string"},"endDate":{"type":"string"}},"required":["rangeType","startDate","endDate"],"additionalProperties":false}]},"widgets":{"type":"array","items":{"type":"object","properties":{"variantId":{"type":"string"},"layout":{"type":"string","enum":["narrow","quarter","third","half","full","main"]},"placement":{"type":"object","properties":{"colSpan":{"type":"integer","minimum":1,"maximum":4},"rowSpan":{"type":"integer","minimum":1,"maximum":3},"detail":{"type":"string","enum":["compact","standard","detailed"]}},"required":["colSpan","rowSpan"],"additionalProperties":false},"title":{"oneOf":[{"type":"string"},{"type":"null"}]},"position":{"type":"integer"}},"required":["variantId"],"additionalProperties":false}},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","definitionId","name","description","query","dateRange","widgets","createdAt","updatedAt"],"additionalProperties":false}},"startFromScratch":{"type":"object","properties":{"enabled":{"type":"boolean"},"defaultName":{"type":"string"},"defaultDateRange":{"anyOf":[{"allOf":[{"type":"object","properties":{"rangeType":{"const":"relative"},"value":{"allOf":[{"type":"integer"},{"type":"number","minimum":0}]},"unit":{"type":"string","enum":["week","month","quarter","year"]}},"required":["rangeType","value","unit"],"additionalProperties":false},{}]},{"type":"object","properties":{"rangeType":{"const":"absolute"},"startDate":{"type":"string"},"endDate":{"type":"string"}},"required":["rangeType","startDate","endDate"],"additionalProperties":false}]}},"required":["enabled","defaultName","defaultDateRange"],"additionalProperties":false}},"required":["templates","startFromScratch"],"additionalProperties":false}}}}},"tags":["analytics"],"summary":"List dashboard templates"}},"/api/dashboards/widgets":{"get":{"parameters":[{"in":"query","name":"scope","required":false,"schema":{"type":"string","enum":["area","project","team","component"]}}],"responses":{"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BadRequestError"}}}},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UnauthorizedError"}}}},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ForbiddenError"}}}},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/NotFoundError"}}}},"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"widgetTypes":{"type":"object","additionalProperties":{"type":"object","properties":{"reqBindings":{"type":"array","items":{"type":"string"}},"optBindings":{"type":"array","items":{"type":"string"}},"defaultLayout":{"type":"object","properties":{"size":{"type":"string","enum":["full","half","third","main","narrow","quarter"]}},"additionalProperties":false},"availableLayouts":{"type":"object","properties":{"size":{"anyOf":[{"type":"string","enum":["all"]},{"type":"array","items":{"type":"string","enum":["full","half","third","main","narrow","quarter"]}}]}},"additionalProperties":false},"availableDetails":{"type":"array","items":{"type":"string","enum":["compact","standard","detailed"]}},"defaultDetail":{"type":"string","enum":["compact","standard","detailed"]}},"required":["reqBindings","optBindings","defaultLayout","availableLayouts","availableDetails","defaultDetail"],"additionalProperties":false}},"widgetVariants":{"type":"object","properties":{"CodeHealthKpiCard":{"type":"object","properties":{"widgetType":{"type":"string","enum":["kpiCard"]},"title":{"oneOf":[{"type":"string"},{"type":"null"}]},"category":{"type":"string","enum":["code-health","code-coverage","hotspots","other"]},"scopes":{"type":"array","items":{"type":"string","enum":["area","project","team","component"]}},"dashboardAddable":{"type":"boolean"},"inputs":{"type":"object","properties":{"metrics":{"type":"object","properties":{"query":{"type":"string","enum":["queries/code-health"]}},"required":["query"],"additionalProperties":false},"metricDescription":{"type":"object","properties":{"query":{"type":"string","enum":["queries/code-health-description"]}},"required":["query"],"additionalProperties":false},"weightMetric":{"type":"object","properties":{"query":{"type":"string","enum":["queries/lines-of-code"]}},"required":["query"],"additionalProperties":false},"children":{"type":"object","properties":{"query":{"type":"string","enum":["queries/code-health-children"]}},"required":["query"],"additionalProperties":false}},"required":["metrics","metricDescription","weightMetric","children"],"additionalProperties":false}},"required":["widgetType","category","scopes","dashboardAddable","inputs"],"additionalProperties":false},"HotspotCodeHealthKpiCard":{"type":"object","properties":{"widgetType":{"type":"string","enum":["kpiCard"]},"title":{"oneOf":[{"type":"string"},{"type":"null"}]},"category":{"type":"string","enum":["code-health","code-coverage","hotspots","other"]},"scopes":{"type":"array","items":{"type":"string","enum":["area","project","team","component"]}},"dashboardAddable":{"type":"boolean"},"inputs":{"type":"object","properties":{"metrics":{"type":"object","properties":{"query":{"type":"string","enum":["queries/hotspot-code-health"]}},"required":["query"],"additionalProperties":false},"metricDescription":{"type":"object","properties":{"query":{"type":"string","enum":["queries/hotspot-code-health-description"]}},"required":["query"],"additionalProperties":false},"weightMetric":{"type":"object","properties":{"query":{"type":"string","enum":["queries/lines-of-code"]}},"required":["query"],"additionalProperties":false},"children":{"type":"object","properties":{"query":{"type":"string","enum":["queries/hotspot-code-health-children"]}},"required":["query"],"additionalProperties":false}},"required":["metrics","metricDescription","weightMetric","children"],"additionalProperties":false}},"required":["widgetType","category","scopes","dashboardAddable","inputs"],"additionalProperties":false},"CodeHealthTrendLineChart":{"type":"object","properties":{"widgetType":{"type":"string","enum":["lineChart"]},"title":{"oneOf":[{"type":"string"},{"type":"null"}]},"category":{"type":"string","enum":["code-health","code-coverage","hotspots","other"]},"scopes":{"type":"array","items":{"type":"string","enum":["area","project","team","component"]}},"dashboardAddable":{"type":"boolean"},"inputs":{"type":"object","properties":{"series":{"type":"object","properties":{"query":{"type":"string","enum":["queries/code-health-trend"]}},"required":["query"],"additionalProperties":false},"thresholds":{"type":"object","properties":{"query":{"type":"string","enum":["queries/code-health-thresholds"]}},"required":["query"],"additionalProperties":false},"contextLines":{"type":"object","properties":{"query":{"type":"string","enum":["queries/code-health-context-lines"]}},"required":["query"],"additionalProperties":false}},"required":["series","thresholds","contextLines"],"additionalProperties":false}},"required":["widgetType","category","scopes","dashboardAddable","inputs"],"additionalProperties":false},"HotspotCodeHealthTrendLineChart":{"type":"object","properties":{"widgetType":{"type":"string","enum":["lineChart"]},"title":{"oneOf":[{"type":"string"},{"type":"null"}]},"category":{"type":"string","enum":["code-health","code-coverage","hotspots","other"]},"scopes":{"type":"array","items":{"type":"string","enum":["area","project","team","component"]}},"dashboardAddable":{"type":"boolean"},"inputs":{"type":"object","properties":{"series":{"type":"object","properties":{"query":{"type":"string","enum":["queries/hotspot-code-health-trend"]}},"required":["query"],"additionalProperties":false},"thresholds":{"type":"object","properties":{"query":{"type":"string","enum":["queries/code-health-thresholds"]}},"required":["query"],"additionalProperties":false},"contextLines":{"type":"object","properties":{"query":{"type":"string","enum":["queries/hotspot-code-health-context-lines"]}},"required":["query"],"additionalProperties":false}},"required":["series","thresholds","contextLines"],"additionalProperties":false}},"required":["widgetType","category","scopes","dashboardAddable","inputs"],"additionalProperties":false},"CodeCoverageKpiCard":{"type":"object","properties":{"widgetType":{"type":"string","enum":["kpiCard"]},"title":{"oneOf":[{"type":"string"},{"type":"null"}]},"category":{"type":"string","enum":["code-health","code-coverage","hotspots","other"]},"scopes":{"type":"array","items":{"type":"string","enum":["area","project","team","component"]}},"dashboardAddable":{"type":"boolean"},"inputs":{"type":"object","properties":{"metrics":{"type":"object","properties":{"query":{"type":"string","enum":["queries/code-coverage"]}},"required":["query"],"additionalProperties":false},"metricDescription":{"type":"object","properties":{"query":{"type":"string","enum":["queries/code-coverage-description"]}},"required":["query"],"additionalProperties":false},"weightMetric":{"type":"object","properties":{"query":{"type":"string","enum":["queries/code-coverage-total-loc"]}},"required":["query"],"additionalProperties":false},"secondaryWeightMetric":{"type":"object","properties":{"query":{"type":"string","enum":["queries/code-coverage-covered-loc"]}},"required":["query"],"additionalProperties":false},"children":{"type":"object","properties":{"query":{"type":"string","enum":["queries/code-coverage-children"]}},"required":["query"],"additionalProperties":false}},"required":["metrics","metricDescription","weightMetric","secondaryWeightMetric","children"],"additionalProperties":false}},"required":["widgetType","category","scopes","dashboardAddable","inputs"],"additionalProperties":false},"HotspotsTable":{"type":"object","properties":{"widgetType":{"type":"string","enum":["table"]},"title":{"oneOf":[{"type":"string"},{"type":"null"}]},"category":{"type":"string","enum":["code-health","code-coverage","hotspots","other"]},"scopes":{"type":"array","items":{"type":"string","enum":["area","project","team","component"]}},"dashboardAddable":{"type":"boolean"},"inputs":{"type":"object","properties":{"items":{"type":"object","properties":{"query":{"type":"string","enum":["queries/hotspots"]}},"required":["query"],"additionalProperties":false}},"required":["items"],"additionalProperties":false}},"required":["widgetType","category","scopes","dashboardAddable","inputs"],"additionalProperties":false},"PseudoRandomUiObject":{"type":"object","properties":{"widgetType":{"type":"string","enum":["pseudoWidget"]},"title":{"oneOf":[{"type":"string"},{"type":"null"}]},"category":{"type":"string","enum":["code-health","code-coverage","hotspots","other"]},"scopes":{"type":"array","items":{"type":"string","enum":["area","project","team","component"]}},"dashboardAddable":{"type":"boolean"},"inputs":{"type":"object","properties":{"xAxis":{"type":"object","properties":{"query":{"type":"string","enum":["pseudo-queries/horizontal-fake"]}},"required":["query"],"additionalProperties":false},"yAxis":{"type":"object","properties":{"query":{"type":"string","enum":["pseudo-queries/vertical-fake"]}},"required":["query"],"additionalProperties":false}},"required":["xAxis","yAxis"],"additionalProperties":false}},"required":["widgetType","category","scopes","dashboardAddable","inputs"],"additionalProperties":false}},"additionalProperties":false}},"required":["widgetTypes","widgetVariants"],"additionalProperties":false}}}}},"tags":["dashboards"],"summary":"Dashboard widget types and descriptions","description":"Widget types and descriptions for widget variants, optionally narrowed to those a scope (area, project, or a project's team or component) can feed."}},"/api/invitations":{"post":{"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/InvitationsRequest"}}}},"responses":{"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BadRequestError"}}}},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UnauthorizedError"}}}},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ForbiddenError"}}}},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/NotFoundError"}}}},"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/InvitationsResponse"}}}}},"tags":["invitations"],"summary":"Invite developers to the current cloud organization by email","description":"Admins and owners send member invitations valid for seven days. Other organization members request admin approval before emails are sent. Requires REST read/write scopes. Existing members are not reinvited. Optional telemetry.actionId preserves an opaque outreach action ID through later reviews and resends; telemetry.projectId supplies project context. Callers without telemetry receive a server-generated action ID in backend events."}},"/api/projects/{project-id}/safeguards/pr/insights":{"get":{"parameters":[{"in":"path","name":"project-id","required":true,"schema":{"type":"integer"}},{"in":"query","name":"from","required":false,"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$","format":"date"}},{"in":"query","name":"to","required":false,"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$","format":"date"}}],"responses":{"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BadRequestError"}}}},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UnauthorizedError"}}}},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ForbiddenError"}}}},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/NotFoundError"}}}},"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SafeguardsPrInsights"}}}}},"tags":["safeguards"],"summary":"Get project Code Health safeguard insights from PR analyses"}},"/api/projects/{project-id}/safeguards/pr/outcomes":{"get":{"parameters":[{"in":"path","name":"project-id","required":true,"schema":{"type":"integer"}},{"in":"query","name":"from","required":false,"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$","format":"date"}},{"in":"query","name":"to","required":false,"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$","format":"date"}},{"in":"query","name":"page","required":false,"schema":{"default":1,"type":"integer","minimum":1}},{"in":"query","name":"pageSize","required":false,"schema":{"default":100,"type":"integer","minimum":1}}],"responses":{"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BadRequestError"}}}},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UnauthorizedError"}}}},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ForbiddenError"}}}},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/NotFoundError"}}}},"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SafeguardsPrOutcomes"}}}}},"tags":["safeguards"],"summary":"Get project Code Health safeguard outcomes from PR analyses"}},"/api/projects/{project-id}/safeguards/mcp/insights":{"get":{"parameters":[{"in":"path","name":"project-id","required":true,"schema":{"type":"integer"}},{"in":"query","name":"period","required":false,"schema":{"type":"string","enum":["weekly","monthly"]}},{"in":"query","name":"through","required":false,"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$","format":"date"}}],"responses":{"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BadRequestError"}}}},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UnauthorizedError"}}}},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ForbiddenError"}}}},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/NotFoundError"}}}},"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SafeguardsProjectMcpInsights"}}}}},"tags":["safeguards"],"summary":"Get project MCP Code Health safeguard insights"}},"/api/projects/{project-id}/safeguards/mcp/outcomes":{"get":{"parameters":[{"in":"path","name":"project-id","required":true,"schema":{"type":"integer"}},{"in":"query","name":"page","required":false,"schema":{"default":1,"type":"integer","minimum":1}},{"in":"query","name":"pageSize","required":false,"schema":{"default":100,"type":"integer","minimum":1}}],"responses":{"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BadRequestError"}}}},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UnauthorizedError"}}}},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ForbiddenError"}}}},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/NotFoundError"}}}},"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SafeguardsProjectMcpOutcomes"}}}}},"tags":["safeguards"],"summary":"Get project MCP Code Health safeguard outcomes"}},"/api/projects/{project-id}/safeguards/mcp/users":{"get":{"parameters":[{"in":"path","name":"project-id","required":true,"schema":{"type":"integer"}},{"in":"query","name":"page","required":false,"schema":{"default":1,"type":"integer","minimum":1}},{"in":"query","name":"pageSize","required":false,"schema":{"default":100,"type":"integer","minimum":1}},{"in":"query","name":"sortBy","required":false,"schema":{"type":"string","enum":["lastEventDate","latestMcpVersion","name","team","commits","adoptionStatus","numberOfSafeguardChecks","numberOfDegradationsPrevented","numberOfUplifts"]}},{"in":"query","name":"sortOrder","required":false,"schema":{"default":"asc","type":"string","enum":["asc","desc"]}},{"in":"query","name":"period","required":false,"schema":{"type":"string","enum":["weekly","monthly"]}},{"in":"query","name":"through","required":false,"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$","format":"date"}},{"in":"query","name":"cohort","required":false,"schema":{"type":"string","enum":["no-account","never-connected","dormant","active","activated"]}}],"responses":{"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BadRequestError"}}}},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UnauthorizedError"}}}},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ForbiddenError"}}}},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/NotFoundError"}}}},"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SafeguardsProjectMcpUsers"}}}}},"tags":["safeguards"],"summary":"Get project MCP users with per-user safeguard insights"}},"/api/safeguards/mcp/insights/me":{"get":{"responses":{"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BadRequestError"}}}},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UnauthorizedError"}}}},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ForbiddenError"}}}},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/NotFoundError"}}}},"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SafeguardsUserMcpInsights"}}}}},"tags":["safeguards"],"summary":"Get MCP Code Health safeguard insights for the authenticated user"}},"/api/safeguards/mcp/outcomes/me":{"get":{"parameters":[{"in":"query","name":"page","required":false,"schema":{"default":1,"type":"integer","minimum":1}},{"in":"query","name":"pageSize","required":false,"schema":{"default":100,"type":"integer","minimum":1}}],"responses":{"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BadRequestError"}}}},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UnauthorizedError"}}}},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ForbiddenError"}}}},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/NotFoundError"}}}},"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SafeguardsMcpOutcomes"}}}}},"tags":["safeguards"],"summary":"Get MCP Code Health safeguard outcomes for the authenticated user"}},"/api/safeguards/mcp/insights":{"get":{"parameters":[{"in":"query","name":"period","required":false,"schema":{"type":"string","enum":["weekly","monthly"]}},{"in":"query","name":"through","required":false,"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$","format":"date"}},{"in":"query","name":"includeProjects","required":false,"schema":{"type":"boolean"},"description":"Include accessible projects, including projects without MCP usage. Project metrics default to the monthly period."}],"responses":{"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BadRequestError"}}}},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UnauthorizedError"}}}},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ForbiddenError"}}}},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/NotFoundError"}}}},"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SafeguardsOrganizationMcpInsights"}}}}},"tags":["safeguards"],"summary":"Get organization MCP Code Health safeguard insights","description":"With includeProjects=true, adds project summaries without changing organization aggregates. Project author/account counts exclude former and excluded developers. numberOfUsers is lifetime activation; numberOfActiveUsers and selectedPeriod use the selected 7/30-day window. Project activity includes contributors from other accounts; shared events count once per associated project."}},"/api/safeguards/mcp/outcomes":{"get":{"parameters":[{"in":"query","name":"page","required":false,"schema":{"default":1,"type":"integer","minimum":1}},{"in":"query","name":"pageSize","required":false,"schema":{"default":100,"type":"integer","minimum":1}}],"responses":{"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BadRequestError"}}}},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UnauthorizedError"}}}},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ForbiddenError"}}}},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/NotFoundError"}}}},"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SafeguardsMcpOutcomes"}}}}},"tags":["safeguards"],"summary":"Get organization MCP Code Health safeguard outcomes"}},"/api/safeguards/mcp/users":{"get":{"parameters":[{"in":"query","name":"page","required":false,"schema":{"default":1,"type":"integer","minimum":1}},{"in":"query","name":"pageSize","required":false,"schema":{"default":100,"type":"integer","minimum":1}},{"in":"query","name":"sortBy","required":false,"schema":{"type":"string","enum":["lastEventDate","latestMcpVersion"]}},{"in":"query","name":"sortOrder","required":false,"schema":{"default":"asc","type":"string","enum":["asc","desc"]}}],"responses":{"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BadRequestError"}}}},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UnauthorizedError"}}}},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ForbiddenError"}}}},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/NotFoundError"}}}},"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SafeguardsOrganizationUsers"}}}}},"tags":["safeguards"],"summary":"Get organization MCP users with per-user safeguard insights"}},"/api/quality/engineering-outcomes":{"get":{"parameters":[{"in":"query","name":"baseline","required":true,"schema":{"type":"number","minimum":1.0,"maximum":10.0,"example":6.2},"description":"Baseline Code Health score between 1.0 and 10.0."},{"in":"query","name":"target","required":true,"schema":{"type":"number","minimum":1.0,"maximum":10.0,"example":6.2},"description":"Target Code Health score between 1.0 and 10.0."},{"in":"query","name":"initialUnplannedWorkPct","required":false,"schema":{"type":"number"},"description":"Initial unplanned work percentage to use for the derived combined productivity impact estimate. When omitted, the default depends on baseline Code Health: 50 below 4.0, 30 below 7.0, otherwise 10."}],"responses":{"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BadRequestError"}}}},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UnauthorizedError"}}}},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ForbiddenError"}}}},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/NotFoundError"}}}},"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/EngineeringOutcomes"}}}}},"tags":["quality"],"summary":"Returns estimated engineering outcome intervals for a Code Health change."}},"/api/projects/{project-id}/quality/code-health/alerts":{"get":{"parameters":[{"in":"path","name":"project-id","required":true,"schema":{"type":"integer"}}],"responses":{"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BadRequestError"}}}},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UnauthorizedError"}}}},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ForbiddenError"}}}},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/NotFoundError"}}}},"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/QualityAlerts"}}}}},"tags":["quality"],"summary":"Returns packaged code-health alerts for the latest successful analysis."}},"/api/projects/{project-id}/quality/code-health/alerts/code-health-decline":{"get":{"parameters":[{"in":"path","name":"project-id","required":true,"schema":{"type":"integer"}}],"responses":{"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BadRequestError"}}}},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UnauthorizedError"}}}},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ForbiddenError"}}}},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/NotFoundError"}}}},"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CodeHealthDeclineAlertDetails"}}}}},"tags":["quality"],"summary":"Returns detailed markers for the Code Health Decline alert."}},"/api/projects/{project-id}/quality/code-health/alerts/code-health-predicted-decline":{"get":{"parameters":[{"in":"path","name":"project-id","required":true,"schema":{"type":"integer"}}],"responses":{"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BadRequestError"}}}},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UnauthorizedError"}}}},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ForbiddenError"}}}},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/NotFoundError"}}}},"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CodeHealthPredictedDeclineAlertDetails"}}}}},"tags":["quality"],"summary":"Returns files that are predicted to degrade in code health unless acted upon."}},"/api/projects/{project-id}/quality/code-health/alerts/rising-hotspots-code-health-issues":{"get":{"parameters":[{"in":"path","name":"project-id","required":true,"schema":{"type":"integer"}}],"responses":{"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BadRequestError"}}}},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UnauthorizedError"}}}},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ForbiddenError"}}}},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/NotFoundError"}}}},"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RisingHotspotsCodeHealthAlertDetails"}}}}},"tags":["quality"],"summary":"Returns rising hotspot files whose increased commit frequency coincides with unhealthy code."}},"/api/projects/{project-id}/quality/code-health/benchmarks":{"get":{"parameters":[{"in":"path","name":"project-id","required":true,"schema":{"type":"integer"}}],"responses":{"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BadRequestError"}}}},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UnauthorizedError"}}}},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ForbiddenError"}}}},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/NotFoundError"}}}},"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CodeHealthBenchmarks"}}}}},"tags":["quality"],"summary":"Returns backend-managed thresholds and benchmark values used for interpretation and visualization of Code Health metrics."}},"/api/projects/{project-id}/quality/code-health":{"get":{"parameters":[{"in":"path","name":"project-id","required":true,"schema":{"type":"integer"}}],"responses":{"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BadRequestError"}}}},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UnauthorizedError"}}}},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ForbiddenError"}}}},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/NotFoundError"}}}},"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CodeHealthSummary"}}}}},"tags":["quality"],"summary":"Returns the current Code Health state, comparison metrics, projection summaries, and Quality Gate impact."}},"/api/projects/{project-id}/quality/code-health/trend":{"get":{"parameters":[{"in":"path","name":"project-id","required":true,"schema":{"type":"integer"}},{"in":"query","name":"type","required":false,"schema":{"allOf":[{"type":"string"},{"type":"string","enum":["team","component"]}]},"description":"Filter the trend by a team or component."},{"in":"query","name":"name","required":false,"schema":{"type":"string"},"description":"Name of the team or component to filter by. Required when type is specified."},{"in":"query","name":"pageSize","required":false,"schema":{"type":"integer","minimum":1,"maximum":15000},"description":"Number of data points to return per page. Defaults to 100."},{"in":"query","name":"pageToken","required":false,"schema":{"type":"string"},"description":"Opaque cursor returned as nextPageToken in a previous response. Resumes pagination from where the previous page ended. pageSize may differ from the original request."},{"in":"query","name":"sort","required":false,"schema":{"type":"string"},"description":"Sort results by a property. Format: property or property:asc / property:desc. Valid sort properties depend on the endpoint."},{"in":"query","name":"from","required":false,"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$","format":"date","example":"2026-03-20"},"description":"Include only data points on or after this date (inclusive). Format: YYYY-MM-DD."},{"in":"query","name":"to","required":false,"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$","format":"date","example":"2026-03-20"},"description":"Include only data points on or before this date (inclusive). Format: YYYY-MM-DD."}],"responses":{"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BadRequestError"}}}},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UnauthorizedError"}}}},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ForbiddenError"}}}},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/NotFoundError"}}}},"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CodeHealthTrend"}}}}},"tags":["quality"],"summary":"Returns historical Code Health metrics over time."}},"/api/projects/{project-id}/quality/files/code-health-review":{"get":{"parameters":[{"in":"path","name":"project-id","required":true,"schema":{"type":"integer"}},{"in":"query","name":"path","required":true,"schema":{"type":"string"},"description":"Repo-scoped relative file path to retrieve the Code Health review for."}],"responses":{"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BadRequestError"}}}},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UnauthorizedError"}}}},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ForbiddenError"}}}},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/NotFoundError"}}}},"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CodeHealthReview"}}}}},"tags":["quality"],"summary":"Returns the packaged Code Health review for a repo-scoped file path."}},"/api/projects/{project-id}/quality/files/inventory":{"get":{"parameters":[{"in":"path","name":"project-id","required":true,"schema":{"type":"integer"}},{"in":"query","name":"pageSize","required":false,"schema":{"type":"integer","minimum":1,"maximum":15000},"description":"Number of data points to return per page. Defaults to 100."},{"in":"query","name":"pageToken","required":false,"schema":{"type":"string"},"description":"Opaque cursor returned as nextPageToken in a previous response. Resumes pagination from where the previous page ended. pageSize may differ from the original request."},{"in":"query","name":"sort","required":false,"schema":{"type":"string"},"description":"Sort results by a property. Format: property or property:asc / property:desc. Valid sort properties depend on the endpoint."}],"responses":{"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BadRequestError"}}}},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UnauthorizedError"}}}},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ForbiddenError"}}}},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/NotFoundError"}}}},"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/HotspotFileInventory"}}}}},"tags":["quality"],"summary":"Returns per-file change frequency, code health, hotspot flag, and uplift target classification."}},"/api/projects/{project-id}/quality/components/inventory":{"get":{"parameters":[{"in":"path","name":"project-id","required":true,"schema":{"type":"integer"}},{"in":"query","name":"pageSize","required":false,"schema":{"type":"integer","minimum":1,"maximum":15000},"description":"Number of data points to return per page. Defaults to 100."},{"in":"query","name":"pageToken","required":false,"schema":{"type":"string"},"description":"Opaque cursor returned as nextPageToken in a previous response. Resumes pagination from where the previous page ended. pageSize may differ from the original request."},{"in":"query","name":"sort","required":false,"schema":{"type":"string"},"description":"Sort results by a property. Format: property or property:asc / property:desc. Valid sort properties depend on the endpoint."}],"responses":{"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BadRequestError"}}}},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UnauthorizedError"}}}},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ForbiddenError"}}}},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/NotFoundError"}}}},"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ComponentInventory"}}}}},"tags":["quality"],"summary":"Returns per-component change frequency, code health, knowledge, and counts of hotspots, uplift targets, and off-boarding risks, plus a summary of files that match no component."}},"/api/projects/{project-id}/quality/folders/inventory":{"get":{"parameters":[{"in":"path","name":"project-id","required":true,"schema":{"type":"integer"}},{"in":"query","name":"pageSize","required":false,"schema":{"type":"integer","minimum":1,"maximum":15000},"description":"Number of data points to return per page. Defaults to 100."},{"in":"query","name":"pageToken","required":false,"schema":{"type":"string"},"description":"Opaque cursor returned as nextPageToken in a previous response. Resumes pagination from where the previous page ended. pageSize may differ from the original request."}],"responses":{"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BadRequestError"}}}},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UnauthorizedError"}}}},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ForbiddenError"}}}},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/NotFoundError"}}}},"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/FolderInventory"}}}}},"tags":["quality"],"summary":"Returns all folder nodes in breadth-first order, each with path and optional parentPath."}},"/api/projects/{project-id}/quality/hotspots/recommendations":{"get":{"parameters":[{"in":"path","name":"project-id","required":true,"schema":{"type":"integer"}},{"in":"query","name":"path","required":true,"schema":{"type":"string"}}],"responses":{"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BadRequestError"}}}},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UnauthorizedError"}}}},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ForbiddenError"}}}},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/NotFoundError"}}}},"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/HotspotRecommendationsResult"}}}}},"tags":["quality"],"summary":"Returns packaged hotspot recommendations for a repo-scoped file path."}},"/api/projects/{project-id}/quality/commit-activity":{"get":{"parameters":[{"in":"path","name":"project-id","required":true,"schema":{"type":"integer"}},{"in":"query","name":"pageSize","required":false,"schema":{"type":"integer","minimum":1,"maximum":15000},"description":"Number of data points to return per page. Defaults to 100."},{"in":"query","name":"pageToken","required":false,"schema":{"type":"string"},"description":"Opaque cursor returned as nextPageToken in a previous response. Resumes pagination from where the previous page ended. pageSize may differ from the original request."},{"in":"query","name":"sort","required":false,"schema":{"type":"string"},"description":"Sort results by a property. Format: property or property:asc / property:desc. Valid sort properties depend on the endpoint."},{"in":"query","name":"from","required":false,"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$","format":"date","example":"2026-03-20"},"description":"Include only data points on or after this date (inclusive). Format: YYYY-MM-DD."},{"in":"query","name":"to","required":false,"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$","format":"date","example":"2026-03-20"},"description":"Include only data points on or before this date (inclusive). Format: YYYY-MM-DD."}],"responses":{"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BadRequestError"}}}},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UnauthorizedError"}}}},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ForbiddenError"}}}},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/NotFoundError"}}}},"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CommitActivityStatistics"}}}}},"tags":["quality"],"summary":"Returns commit activity and lines-affected time series, with metric interpretations broken down by team and component."}},"/api/projects/{project-id}/teams/{team-id}/quality/code-health":{"get":{"parameters":[{"in":"path","name":"project-id","required":true,"schema":{"type":"integer"}},{"in":"path","name":"team-id","required":true,"schema":{"type":"integer"}}],"responses":{"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BadRequestError"}}}},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UnauthorizedError"}}}},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ForbiddenError"}}}},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/NotFoundError"}}}},"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UnitCodeHealthResult"}}}}},"tags":["quality"],"summary":"Returns the current Code Health of a team, ranked against the other teams of the project."}},"/api/projects/{project-id}/teams/{team-id}/quality/code-health/trend":{"get":{"parameters":[{"in":"path","name":"project-id","required":true,"schema":{"type":"integer"}},{"in":"path","name":"team-id","required":true,"schema":{"type":"integer"}},{"in":"query","name":"pageSize","required":false,"schema":{"type":"integer","minimum":1,"maximum":15000},"description":"Number of data points to return per page. Defaults to 100."},{"in":"query","name":"pageToken","required":false,"schema":{"type":"string"},"description":"Opaque cursor returned as nextPageToken in a previous response. Resumes pagination from where the previous page ended. pageSize may differ from the original request."},{"in":"query","name":"sort","required":false,"schema":{"type":"string"},"description":"Sort results by a property. Format: property or property:asc / property:desc. Valid sort properties depend on the endpoint."},{"in":"query","name":"from","required":false,"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$","format":"date","example":"2026-03-20"},"description":"Include only data points on or after this date (inclusive). Format: YYYY-MM-DD."},{"in":"query","name":"to","required":false,"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$","format":"date","example":"2026-03-20"},"description":"Include only data points on or before this date (inclusive). Format: YYYY-MM-DD."}],"responses":{"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BadRequestError"}}}},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UnauthorizedError"}}}},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ForbiddenError"}}}},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/NotFoundError"}}}},"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UnitCodeHealthTrendResult"}}}}},"tags":["quality"],"summary":"Returns historical Code Health metrics of a team over time."}},"/api/projects/{project-id}/teams/{team-id}/quality/files/inventory":{"get":{"parameters":[{"in":"path","name":"project-id","required":true,"schema":{"type":"integer"}},{"in":"path","name":"team-id","required":true,"schema":{"type":"integer"}},{"in":"query","name":"pageSize","required":false,"schema":{"type":"integer","minimum":1,"maximum":15000},"description":"Number of data points to return per page. Defaults to 100."},{"in":"query","name":"pageToken","required":false,"schema":{"type":"string"},"description":"Opaque cursor returned as nextPageToken in a previous response. Resumes pagination from where the previous page ended. pageSize may differ from the original request."},{"in":"query","name":"sort","required":false,"schema":{"type":"string"},"description":"Sort results by a property. Format: property or property:asc / property:desc. Valid sort properties depend on the endpoint."}],"responses":{"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BadRequestError"}}}},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UnauthorizedError"}}}},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ForbiddenError"}}}},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/NotFoundError"}}}},"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UnitFileInventoryResult"}}}}},"tags":["quality"],"summary":"Returns the file inventory narrowed to the files a team owns."}},"/api/projects/{project-id}/components/{component-id}/quality/code-health":{"get":{"parameters":[{"in":"path","name":"project-id","required":true,"schema":{"type":"integer"}},{"in":"path","name":"component-id","required":true,"schema":{"type":"integer"}}],"responses":{"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BadRequestError"}}}},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UnauthorizedError"}}}},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ForbiddenError"}}}},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/NotFoundError"}}}},"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UnitCodeHealthResult"}}}}},"tags":["quality"],"summary":"Returns the current Code Health of a component, ranked against the other components of the project."}},"/api/projects/{project-id}/components/{component-id}/quality/code-health/trend":{"get":{"parameters":[{"in":"path","name":"project-id","required":true,"schema":{"type":"integer"}},{"in":"path","name":"component-id","required":true,"schema":{"type":"integer"}},{"in":"query","name":"pageSize","required":false,"schema":{"type":"integer","minimum":1,"maximum":15000},"description":"Number of data points to return per page. Defaults to 100."},{"in":"query","name":"pageToken","required":false,"schema":{"type":"string"},"description":"Opaque cursor returned as nextPageToken in a previous response. Resumes pagination from where the previous page ended. pageSize may differ from the original request."},{"in":"query","name":"sort","required":false,"schema":{"type":"string"},"description":"Sort results by a property. Format: property or property:asc / property:desc. Valid sort properties depend on the endpoint."},{"in":"query","name":"from","required":false,"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$","format":"date","example":"2026-03-20"},"description":"Include only data points on or after this date (inclusive). Format: YYYY-MM-DD."},{"in":"query","name":"to","required":false,"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$","format":"date","example":"2026-03-20"},"description":"Include only data points on or before this date (inclusive). Format: YYYY-MM-DD."}],"responses":{"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BadRequestError"}}}},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UnauthorizedError"}}}},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ForbiddenError"}}}},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/NotFoundError"}}}},"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UnitCodeHealthTrendResult"}}}}},"tags":["quality"],"summary":"Returns historical Code Health metrics of a component over time."}},"/api/projects/{project-id}/components/{component-id}/quality/files/inventory":{"get":{"parameters":[{"in":"path","name":"project-id","required":true,"schema":{"type":"integer"}},{"in":"path","name":"component-id","required":true,"schema":{"type":"integer"}},{"in":"query","name":"pageSize","required":false,"schema":{"type":"integer","minimum":1,"maximum":15000},"description":"Number of data points to return per page. Defaults to 100."},{"in":"query","name":"pageToken","required":false,"schema":{"type":"string"},"description":"Opaque cursor returned as nextPageToken in a previous response. Resumes pagination from where the previous page ended. pageSize may differ from the original request."},{"in":"query","name":"sort","required":false,"schema":{"type":"string"},"description":"Sort results by a property. Format: property or property:asc / property:desc. Valid sort properties depend on the endpoint."}],"responses":{"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BadRequestError"}}}},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UnauthorizedError"}}}},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ForbiddenError"}}}},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/NotFoundError"}}}},"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UnitFileInventoryResult"}}}}},"tags":["quality"],"summary":"Returns the file inventory narrowed to the files a component owns."}}},"components":{"schemas":{"Area":{"type":"object","properties":{"id":{"type":"integer"},"name":{"type":"string"},"parentAreaId":{"oneOf":[{"type":"integer"},{"type":"null"}]},"areas":{"type":"array","items":{}},"projects":{"type":"array","items":{}}},"required":["id","name"]},"BadRequestError":{"type":"object","properties":{"error":{"type":"string","description":"Human-readable description of the error.","example":"Path must be a repo-scoped relative file path."},"hint":{"type":"string","description":"Optional additional context or suggestion to resolve the error.","example":"Use a relative path like src/foo/bar.cs"}},"required":["error"]},"CodeHealthBenchmarks":{"type":"object","properties":{"benchmarks":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","description":"Unique identifier of the benchmark entry.","example":"industry-average"},"label":{"type":"string","description":"Human-readable label for the benchmark entry.","example":"Industry Average"},"type":{"type":"string","enum":["threshold","benchmark","ai-readiness"],"description":"The source and context for the entry: benchmark, threshold, or ai-readiness score.","example":"benchmark"},"value":{"type":"number","description":"Numeric value associated with the benchmark entry.","example":5.15}},"required":["id","label","type","value"]},"description":"List of benchmark and threshold entries for the metric."},"metric":{"type":"string","description":"Name of the metric these benchmarks apply to.","example":"codeHealth"},"scale":{"type":"object","properties":{"min":{"type":"number","description":"Minimum value of the Code Health scale.","example":1.0},"max":{"type":"number","description":"Maximum value of the Code Health scale.","example":10.0}},"required":["min","max"],"description":"The numeric scale used for the metric.","example":{"min":1.0,"max":10.0}}},"required":["benchmarks","metric","scale"]},"CodeHealthDeclineAlertDetails":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","description":"Repo-scoped file path for a degrading file.","example":"src/payments.clj"},"year":{"oneOf":[{"type":"number"},{"type":"null"}],"description":"Code Health score one year back.","example":8.0},"month":{"oneOf":[{"type":"number"},{"type":"null"}],"description":"Code Health score one month back.","example":7.6},"now":{"oneOf":[{"type":"number"},{"type":"null"}],"description":"Current Code Health score.","example":6.2},"delta":{"type":"number","description":"The code health decline delta that triggered the alert.","example":1.4}},"required":["name","year","month","now","delta"]}},"CodeHealthPredictedDeclineAlertDetails":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","description":"Repo-scoped file path for a file predicted to degrade in code health unless acted upon.","example":"src/refunds.clj"},"year":{"oneOf":[{"type":"number"},{"type":"null"}],"description":"Code Health score one year back.","example":9.6},"month":{"oneOf":[{"type":"number"},{"type":"null"}],"description":"Code Health score one month back.","example":9.4},"now":{"oneOf":[{"type":"number"},{"type":"null"}],"description":"Current Code Health score.","example":8.7}},"required":["name","year","month","now"]}},"CodeHealthReview":{"type":"object","properties":{"file":{"type":"object","properties":{"path":{"type":"string","description":"Path of the file relative to the repository root.","example":"aspnetcore/src/Http/Http.Extensions/src/RequestDelegateFactory.cs"}},"required":["path"],"description":"Identity of the reviewed source file.","example":{"path":"aspnetcore/src/Http/Http.Extensions/src/RequestDelegateFactory.cs"}},"metrics":{"type":"object","properties":{"linesOfCode":{"type":"integer","description":"Lines of code in the reviewed file.","example":1842},"revisions":{"type":"integer","description":"Number of revisions to the reviewed file in the analysis period.","example":73},"coverage":{"oneOf":[{"type":"object","properties":{"percent":{"type":"number","description":"Code coverage percentage for the reviewed file when available.","example":82.4}},"required":["percent"]},{"type":"null"}],"description":"Optional code coverage metric for the reviewed file.","example":{"percent":82.4}}},"required":["linesOfCode","revisions","coverage"],"description":"File-level metrics relevant to the Code Health review.","example":{"linesOfCode":1842,"revisions":73,"coverage":{"percent":82.4}}},"codeHealth":{"type":"object","properties":{"score":{"type":"number","description":"Current Code Health score for the reviewed file.","example":7.6},"trend":{"type":"array","items":{"type":"object","properties":{"date":{"type":"string","description":"Historical observation point for the file-level Code Health trend.","example":"2026-09-01"},"score":{"type":"number","description":"Code Health score observed at this point in time.","example":7.6}},"required":["date","score"]},"description":"Historical Code Health observations for the reviewed file."}},"required":["score","trend"],"description":"Current Code Health score and historical trend for the reviewed file.","example":{"score":7.6,"trend":[{"date":"2026-04-14","score":8.1},{"date":"2026-06-03","score":7.9},{"date":"2026-09-01","score":7.6}]}},"findings":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","description":"Stable identifier for the finding type.","example":"complex-method"},"name":{"type":"string","description":"Human-readable finding name.","example":"Complex Method"},"description":{"type":"string","description":"Explanation of the Code Health issue or positive quality signal.","example":"The method contains multiple conditional paths that increase the cognitive load required to understand it."},"severity":{"type":"string","enum":["improvement","warning","problem"],"description":"Severity classification for the finding.","example":"warning"},"location":{"type":"object","properties":{"startLine":{"type":"integer","description":"First line of the source range associated with the finding.","example":412},"endLine":{"type":"integer","description":"Last line of the source range associated with the finding.","example":487},"symbol":{"type":"string","description":"Function or symbol name associated with the finding.","example":"CreateArgument"}},"required":["startLine","endLine","symbol"],"description":"Source location associated with the finding when the finding is tied to a specific symbol."},"recommendation":{"type":"string","description":"Recommended action or guidance for the finding.","example":"Decompose the method into smaller functions that represent distinct responsibilities."}},"required":["id","name","description","severity","recommendation"]},"description":"Code Health findings for the reviewed file."},"analysis":{"type":"object","properties":{"date":{"type":"string","format":"date-time","description":"ISO 8601 timestamp of the analysis that produced this review.","example":"2026-09-01T14:32:18Z"}},"required":["date"],"description":"Metadata about the analysis that produced this review.","example":{"date":"2026-09-01T14:32:18Z"}}},"required":["file","metrics","codeHealth","findings","analysis"]},"CodeHealthSummary":{"type":"object","properties":{"projectId":{"type":"integer","description":"The numeric ID of the project.","example":1},"asOf":{"type":"string","format":"date-time","description":"ISO 8601 datetime of when the snapshot was taken.","example":"2026-06-09T10:15:00Z"},"codeAsOf":{"type":"string","format":"date-time","description":"ISO 8601 timestamp of the newest code included in the analysis.","example":"2026-06-08T14:22:00Z"},"staleness":{"type":"object","properties":{"classification":{"type":"string","enum":["fresh","stale","dormant"],"description":"Freshness classification based on analysis age and recent commit activity.","example":"fresh"},"analysisAgeDays":{"type":"integer","description":"Whole days since the analysis snapshot.","example":0},"codeAgeDays":{"type":"integer","description":"Whole days since the latest commit activity.","example":2}},"required":["classification","analysisAgeDays","codeAgeDays"],"description":"Backend-owned freshness verdict for the analysis and analyzed code.","example":{"classification":"fresh","analysisAgeDays":0,"codeAgeDays":2}},"repositories":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","description":"Repository name from the analyzed file paths.","example":"payments-service"},"sha":{"type":"string","description":"Analyzed Git commit SHA.","example":"a1b2c3d"},"codeAsOf":{"type":"string","format":"date-time","description":"ISO 8601 timestamp of the analyzed commit.","example":"2026-06-08T14:22:00Z"},"commitUrl":{"oneOf":[{"type":"string"},{"type":"null"}],"description":"Provider commit link when a repository URL is available.","example":"https://github.com/example/payments-service/commit/a1b2c3d"}},"required":["name","sha","codeAsOf"]},"description":"Latest analyzed revision per repository."},"comparisonPeriod":{"type":"object","properties":{"from":{"type":"string","format":"date","description":"Start date of the period (inclusive).","example":"2026-01-01"},"to":{"type":"string","format":"date","description":"End date of the period (inclusive).","example":"2026-06-09"}},"required":["from","to"],"description":"Date range used to compute the delta values.","example":{"from":"2026-01-01","to":"2026-06-09"}},"languages":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","description":"Analyzed language supported by CodeScene.","example":"Clojure"},"fileCount":{"type":"integer","description":"Number of analyzed files in this language.","example":120},"linesOfCode":{"type":"integer","description":"Lines of code analyzed for this language.","example":21050}},"required":["name","fileCount","linesOfCode"]},"description":"Analyzed languages supported by CodeScene, with file and code counts."},"averageCodeHealth":{"type":"object","properties":{"value":{"oneOf":[{"type":"number"},{"type":"null"}],"description":"Code health score on a scale from 1 to 10.","example":7.4},"delta":{"oneOf":[{"type":"number"},{"type":"null"}],"description":"Change in code health score relative to the comparison period. Null if no prior data.","example":0.3},"classification":{"oneOf":[{"type":"string","enum":["unhealthy-code","problematic-code","healthy-code"]},{"type":"null"}],"description":"Human-readable classification of the code health score (e.g. healthy-code, problematic-code, unhealthy-code).","example":"problematic-code"},"nextGoal":{"oneOf":[{"type":"object","properties":{"id":{"type":"string","description":"Unique identifier of the benchmark entry.","example":"industry-average"},"label":{"type":"string","description":"Human-readable label for the benchmark entry.","example":"Industry Average"},"type":{"type":"string","enum":["threshold","benchmark","ai-readiness"],"description":"The source and context for the entry: benchmark, threshold, or ai-readiness score.","example":"benchmark"},"value":{"type":"number","description":"Numeric value associated with the benchmark entry.","example":5.15}},"required":["id","label","type","value"]},{"type":"null"}],"description":"Next benchmark threshold to reach. Present when a higher threshold remains.","example":{"id":"healthy-code","label":"Healthy","value":9.0,"type":"threshold"}},"trend":{"$ref":"#/components/schemas/TrendInterpretation","description":"Trend interpretation derived from the packaged code-health trend series. Absent when the series is unavailable or too short to classify.","example":{"direction":"improving","pace":"slow"}},"series":{"type":"array","items":{"type":"object","properties":{"date":{"type":"string","format":"date","description":"Date of the code-health measurement.","example":"2026-06-01"},"value":{"type":"number","description":"Code-health score measured on this date.","example":7.2}},"required":["date","value"]},"description":"Dated code-health history over the comparison period. Empty when no usable measurements exist."}},"required":["value","delta","classification"],"description":"Code health averaged across all files in the project. Absent if no analysis exists.","example":{"value":7.4,"delta":0.3,"classification":"problematic-code","nextGoal":{"id":"healthy-code","label":"Healthy","value":9.0,"type":"threshold"}}},"hotspotCodeHealth":{"type":"object","properties":{"value":{"oneOf":[{"type":"number"},{"type":"null"}],"description":"Code health score on a scale from 1 to 10.","example":7.4},"delta":{"oneOf":[{"type":"number"},{"type":"null"}],"description":"Change in code health score relative to the comparison period. Null if no prior data.","example":0.3},"classification":{"oneOf":[{"type":"string","enum":["unhealthy-code","problematic-code","healthy-code"]},{"type":"null"}],"description":"Human-readable classification of the code health score (e.g. healthy-code, problematic-code, unhealthy-code).","example":"problematic-code"},"nextGoal":{"oneOf":[{"type":"object","properties":{"id":{"type":"string","description":"Unique identifier of the benchmark entry.","example":"industry-average"},"label":{"type":"string","description":"Human-readable label for the benchmark entry.","example":"Industry Average"},"type":{"type":"string","enum":["threshold","benchmark","ai-readiness"],"description":"The source and context for the entry: benchmark, threshold, or ai-readiness score.","example":"benchmark"},"value":{"type":"number","description":"Numeric value associated with the benchmark entry.","example":5.15}},"required":["id","label","type","value"]},{"type":"null"}],"description":"Next benchmark threshold to reach. Present when a higher threshold remains.","example":{"id":"healthy-code","label":"Healthy","value":9.0,"type":"threshold"}},"trend":{"$ref":"#/components/schemas/TrendInterpretation","description":"Trend interpretation derived from the packaged code-health trend series. Absent when the series is unavailable or too short to classify.","example":{"direction":"improving","pace":"slow"}},"series":{"type":"array","items":{"type":"object","properties":{"date":{"type":"string","format":"date","description":"Date of the code-health measurement.","example":"2026-06-01"},"value":{"type":"number","description":"Code-health score measured on this date.","example":7.2}},"required":["date","value"]},"description":"Dated code-health history over the comparison period. Empty when no usable measurements exist."}},"required":["value","delta","classification"],"description":"Code health averaged across hotspot files in the project. Absent if no analysis exists.","example":{"value":3.8,"delta":0.6,"classification":"unhealthy-code","nextGoal":{"id":"problematic-code","label":"Problematic","value":4.0,"type":"threshold"}}},"aiReadinessContext":{"type":"object","properties":{"averageCodeHealth":{"type":"object","properties":{"interpretation":{"type":"object","properties":{"id":{"type":"string","description":"Unique identifier of the benchmark entry.","example":"industry-average"},"label":{"type":"string","description":"Human-readable label for the benchmark entry.","example":"Industry Average"},"type":{"type":"string","enum":["threshold","benchmark","ai-readiness"],"description":"The source and context for the entry: benchmark, threshold, or ai-readiness score.","example":"benchmark"},"value":{"type":"number","description":"Numeric value associated with the benchmark entry.","example":5.15}},"required":["id","label","type","value"],"description":"Benchmark interpretation of the current code health score.","example":{"id":"industry-average","label":"Average Organizations","value":5.15,"type":"benchmark"}},"nextGoal":{"oneOf":[{"type":"object","properties":{"id":{"type":"string","description":"Unique identifier of the benchmark entry.","example":"industry-average"},"label":{"type":"string","description":"Human-readable label for the benchmark entry.","example":"Industry Average"},"type":{"type":"string","enum":["threshold","benchmark","ai-readiness"],"description":"The source and context for the entry: benchmark, threshold, or ai-readiness score.","example":"benchmark"},"value":{"type":"number","description":"Numeric value associated with the benchmark entry.","example":5.15}},"required":["id","label","type","value"]},{"type":"null"}],"description":"Next benchmark threshold to reach. Absent when the score is already at the top.","example":{"id":"problematic-code","label":"Problematic","value":8.9,"type":"threshold"}}},"required":["interpretation","nextGoal"],"description":"Interpretation and next goal for average code health.","example":{"interpretation":{"id":"industry-average","label":"Average Organizations","value":5.15,"type":"benchmark"},"nextGoal":{"id":"problematic-code","label":"Problematic","value":8.9,"type":"threshold"}}},"hotspotCodeHealth":{"type":"object","properties":{"interpretation":{"type":"object","properties":{"id":{"type":"string","description":"Unique identifier of the benchmark entry.","example":"industry-average"},"label":{"type":"string","description":"Human-readable label for the benchmark entry.","example":"Industry Average"},"type":{"type":"string","enum":["threshold","benchmark","ai-readiness"],"description":"The source and context for the entry: benchmark, threshold, or ai-readiness score.","example":"benchmark"},"value":{"type":"number","description":"Numeric value associated with the benchmark entry.","example":5.15}},"required":["id","label","type","value"],"description":"Benchmark interpretation of the current code health score.","example":{"id":"industry-average","label":"Average Organizations","value":5.15,"type":"benchmark"}},"nextGoal":{"oneOf":[{"type":"object","properties":{"id":{"type":"string","description":"Unique identifier of the benchmark entry.","example":"industry-average"},"label":{"type":"string","description":"Human-readable label for the benchmark entry.","example":"Industry Average"},"type":{"type":"string","enum":["threshold","benchmark","ai-readiness"],"description":"The source and context for the entry: benchmark, threshold, or ai-readiness score.","example":"benchmark"},"value":{"type":"number","description":"Numeric value associated with the benchmark entry.","example":5.15}},"required":["id","label","type","value"]},{"type":"null"}],"description":"Next benchmark threshold to reach. Absent when the score is already at the top.","example":{"id":"problematic-code","label":"Problematic","value":8.9,"type":"threshold"}}},"required":["interpretation","nextGoal"],"description":"Interpretation and next goal for hotspot code health.","example":{"interpretation":{"id":"industry-average","label":"Average Organizations","value":5.15,"type":"benchmark"},"nextGoal":{"id":"problematic-code","label":"Problematic","value":8.9,"type":"threshold"}}}},"description":"AI readiness interpretation and next goal for the latest scores.","example":{"averageCodeHealth":{"interpretation":{"id":"ai-assisted","label":"AI Assisted","value":6.5,"type":"ai-readiness"},"nextGoal":{"id":"ai-friendly","label":"AI Friendly","value":9.5,"type":"ai-readiness"}},"hotspotCodeHealth":{"interpretation":{"id":"ai-caution","label":"AI Caution","value":1.0,"type":"ai-readiness"},"nextGoal":{"id":"ai-assisted","label":"AI Assisted","value":6.5,"type":"ai-readiness"}}}},"teams":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","description":"Display name of the team or component.","example":"Payments Team"},"analyticalUnitId":{"type":"integer","description":"Analytics analytical-unit ID for this team or component.","example":9101},"linesOfCode":{"type":"integer","description":"Latest analyzed lines of code for this team or component.","example":48200},"averageCodeHealth":{"type":"object","properties":{"value":{"oneOf":[{"type":"number"},{"type":"null"}],"description":"Code health score on a scale from 1 to 10.","example":7.4},"delta":{"oneOf":[{"type":"number"},{"type":"null"}],"description":"Change in code health score relative to the comparison period. Null if no prior data.","example":0.3},"classification":{"oneOf":[{"type":"string","enum":["unhealthy-code","problematic-code","healthy-code"]},{"type":"null"}],"description":"Human-readable classification of the code health score (e.g. healthy-code, problematic-code, unhealthy-code).","example":"problematic-code"},"nextGoal":{"oneOf":[{"type":"object","properties":{"id":{"type":"string","description":"Unique identifier of the benchmark entry.","example":"industry-average"},"label":{"type":"string","description":"Human-readable label for the benchmark entry.","example":"Industry Average"},"type":{"type":"string","enum":["threshold","benchmark","ai-readiness"],"description":"The source and context for the entry: benchmark, threshold, or ai-readiness score.","example":"benchmark"},"value":{"type":"number","description":"Numeric value associated with the benchmark entry.","example":5.15}},"required":["id","label","type","value"]},{"type":"null"}],"description":"Next benchmark threshold to reach. Present when a higher threshold remains.","example":{"id":"healthy-code","label":"Healthy","value":9.0,"type":"threshold"}},"trend":{"$ref":"#/components/schemas/TrendInterpretation","description":"Trend interpretation derived from the packaged code-health trend series. Absent when the series is unavailable or too short to classify.","example":{"direction":"improving","pace":"slow"}},"series":{"type":"array","items":{"type":"object","properties":{"date":{"type":"string","format":"date","description":"Date of the code-health measurement.","example":"2026-06-01"},"value":{"type":"number","description":"Code-health score measured on this date.","example":7.2}},"required":["date","value"]},"description":"Dated code-health history over the comparison period. Empty when no usable measurements exist."}},"required":["value","delta","classification"],"description":"Code health averaged across all files in this scope."},"hotspotCodeHealth":{"type":"object","properties":{"value":{"oneOf":[{"type":"number"},{"type":"null"}],"description":"Code health score on a scale from 1 to 10.","example":7.4},"delta":{"oneOf":[{"type":"number"},{"type":"null"}],"description":"Change in code health score relative to the comparison period. Null if no prior data.","example":0.3},"classification":{"oneOf":[{"type":"string","enum":["unhealthy-code","problematic-code","healthy-code"]},{"type":"null"}],"description":"Human-readable classification of the code health score (e.g. healthy-code, problematic-code, unhealthy-code).","example":"problematic-code"},"nextGoal":{"oneOf":[{"type":"object","properties":{"id":{"type":"string","description":"Unique identifier of the benchmark entry.","example":"industry-average"},"label":{"type":"string","description":"Human-readable label for the benchmark entry.","example":"Industry Average"},"type":{"type":"string","enum":["threshold","benchmark","ai-readiness"],"description":"The source and context for the entry: benchmark, threshold, or ai-readiness score.","example":"benchmark"},"value":{"type":"number","description":"Numeric value associated with the benchmark entry.","example":5.15}},"required":["id","label","type","value"]},{"type":"null"}],"description":"Next benchmark threshold to reach. Present when a higher threshold remains.","example":{"id":"healthy-code","label":"Healthy","value":9.0,"type":"threshold"}},"trend":{"$ref":"#/components/schemas/TrendInterpretation","description":"Trend interpretation derived from the packaged code-health trend series. Absent when the series is unavailable or too short to classify.","example":{"direction":"improving","pace":"slow"}},"series":{"type":"array","items":{"type":"object","properties":{"date":{"type":"string","format":"date","description":"Date of the code-health measurement.","example":"2026-06-01"},"value":{"type":"number","description":"Code-health score measured on this date.","example":7.2}},"required":["date","value"]},"description":"Dated code-health history over the comparison period. Empty when no usable measurements exist."}},"required":["value","delta","classification"],"description":"Code health averaged across hotspot files in this scope."},"links":{"type":"object","properties":{"trend":{"type":"string"}},"required":["trend"],"description":"Related resource links for this scope."}},"required":["name","averageCodeHealth","hotspotCodeHealth"]},"description":"Code health breakdown per team."},"components":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","description":"Display name of the team or component.","example":"Payments Team"},"analyticalUnitId":{"type":"integer","description":"Analytics analytical-unit ID for this team or component.","example":9101},"linesOfCode":{"type":"integer","description":"Latest analyzed lines of code for this team or component.","example":48200},"averageCodeHealth":{"type":"object","properties":{"value":{"oneOf":[{"type":"number"},{"type":"null"}],"description":"Code health score on a scale from 1 to 10.","example":7.4},"delta":{"oneOf":[{"type":"number"},{"type":"null"}],"description":"Change in code health score relative to the comparison period. Null if no prior data.","example":0.3},"classification":{"oneOf":[{"type":"string","enum":["unhealthy-code","problematic-code","healthy-code"]},{"type":"null"}],"description":"Human-readable classification of the code health score (e.g. healthy-code, problematic-code, unhealthy-code).","example":"problematic-code"},"nextGoal":{"oneOf":[{"type":"object","properties":{"id":{"type":"string","description":"Unique identifier of the benchmark entry.","example":"industry-average"},"label":{"type":"string","description":"Human-readable label for the benchmark entry.","example":"Industry Average"},"type":{"type":"string","enum":["threshold","benchmark","ai-readiness"],"description":"The source and context for the entry: benchmark, threshold, or ai-readiness score.","example":"benchmark"},"value":{"type":"number","description":"Numeric value associated with the benchmark entry.","example":5.15}},"required":["id","label","type","value"]},{"type":"null"}],"description":"Next benchmark threshold to reach. Present when a higher threshold remains.","example":{"id":"healthy-code","label":"Healthy","value":9.0,"type":"threshold"}},"trend":{"$ref":"#/components/schemas/TrendInterpretation","description":"Trend interpretation derived from the packaged code-health trend series. Absent when the series is unavailable or too short to classify.","example":{"direction":"improving","pace":"slow"}},"series":{"type":"array","items":{"type":"object","properties":{"date":{"type":"string","format":"date","description":"Date of the code-health measurement.","example":"2026-06-01"},"value":{"type":"number","description":"Code-health score measured on this date.","example":7.2}},"required":["date","value"]},"description":"Dated code-health history over the comparison period. Empty when no usable measurements exist."}},"required":["value","delta","classification"],"description":"Code health averaged across all files in this scope."},"hotspotCodeHealth":{"type":"object","properties":{"value":{"oneOf":[{"type":"number"},{"type":"null"}],"description":"Code health score on a scale from 1 to 10.","example":7.4},"delta":{"oneOf":[{"type":"number"},{"type":"null"}],"description":"Change in code health score relative to the comparison period. Null if no prior data.","example":0.3},"classification":{"oneOf":[{"type":"string","enum":["unhealthy-code","problematic-code","healthy-code"]},{"type":"null"}],"description":"Human-readable classification of the code health score (e.g. healthy-code, problematic-code, unhealthy-code).","example":"problematic-code"},"nextGoal":{"oneOf":[{"type":"object","properties":{"id":{"type":"string","description":"Unique identifier of the benchmark entry.","example":"industry-average"},"label":{"type":"string","description":"Human-readable label for the benchmark entry.","example":"Industry Average"},"type":{"type":"string","enum":["threshold","benchmark","ai-readiness"],"description":"The source and context for the entry: benchmark, threshold, or ai-readiness score.","example":"benchmark"},"value":{"type":"number","description":"Numeric value associated with the benchmark entry.","example":5.15}},"required":["id","label","type","value"]},{"type":"null"}],"description":"Next benchmark threshold to reach. Present when a higher threshold remains.","example":{"id":"healthy-code","label":"Healthy","value":9.0,"type":"threshold"}},"trend":{"$ref":"#/components/schemas/TrendInterpretation","description":"Trend interpretation derived from the packaged code-health trend series. Absent when the series is unavailable or too short to classify.","example":{"direction":"improving","pace":"slow"}},"series":{"type":"array","items":{"type":"object","properties":{"date":{"type":"string","format":"date","description":"Date of the code-health measurement.","example":"2026-06-01"},"value":{"type":"number","description":"Code-health score measured on this date.","example":7.2}},"required":["date","value"]},"description":"Dated code-health history over the comparison period. Empty when no usable measurements exist."}},"required":["value","delta","classification"],"description":"Code health averaged across hotspot files in this scope."},"links":{"type":"object","properties":{"trend":{"type":"string"}},"required":["trend"],"description":"Related resource links for this scope."}},"required":["name","averageCodeHealth","hotspotCodeHealth"]},"description":"Code health breakdown per component."},"projections":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","description":"Unique identifier of the projection.","example":"without-gating"},"name":{"type":"string","description":"Display name of the projection.","example":"Without Quality Gates"},"averageCodeHealthDifference":{"type":"number","description":"Difference in average code health attributable to this projection.","example":-0.6},"hotspotCodeHealthDifference":{"type":"number","description":"Difference in hotspot code health attributable to this projection.","example":-0.9},"links":{"type":"object","properties":{"trend":{"type":"string"}},"required":["trend"],"description":"Related resource links for this projection.","example":{"trend":"/projects/payments-service/quality/code-health/projections/without-gating?from=2026-01-01&to=2026-06-09&granularity=week&metrics=averageCodeHealth,hotspotCodeHealth"}}},"required":["id","name","averageCodeHealthDifference","hotspotCodeHealthDifference","links"]},"description":"Projections showing the code health impact of individual sub-systems or components.","example":[{"id":"without-gating","name":"Without Quality Gates","averageCodeHealthDifference":-0.6,"hotspotCodeHealthDifference":-0.9,"links":{"trend":"/projects/payments-service/quality/code-health/projections/without-gating?from=2026-01-01&to=2026-06-09&granularity=week&metrics=averageCodeHealth,hotspotCodeHealth"}}]},"qualityGateImpact":{"type":"object","properties":{"preventedDeclines":{"type":"integer","description":"Number of code health declines prevented by the quality gate.","example":37},"links":{"type":"object","properties":{"details":{"type":"string"}},"required":["details"],"description":"Related resource links for the quality gate impact.","example":{"details":"/projects/payments-service/quality/code-health/declines?from=2026-01-01&to=2026-06-09&status=prevented&sort=detectedAt:desc&pageSize=50"}}},"required":["preventedDeclines","links"],"description":"Summary of how the quality gate has influenced code health over the comparison period.","example":{"preventedDeclines":37,"links":{"details":"/projects/payments-service/quality/code-health/declines?from=2026-01-01&to=2026-06-09&status=prevented&sort=detectedAt:desc&pageSize=50"}}},"links":{"type":"object","properties":{"benchmarks":{"type":"string"},"trend":{"type":"string"},"projections":{"type":"string"},"qualityGateImpact":{"type":"string"}},"required":["benchmarks","trend","projections","qualityGateImpact"],"description":"Top-level resource links related to this summary.","example":{"benchmarks":"/projects/payments-service/quality/code-health/benchmarks","trend":"/projects/payments-service/quality/code-health/trend?from=2026-01-01&to=2026-06-09&granularity=week&metrics=averageCodeHealth,hotspotCodeHealth","projections":"/projects/payments-service/quality/code-health/projections?from=2026-01-01&to=2026-06-09","qualityGateImpact":"/projects/payments-service/quality/code-health/gating-impact?from=2026-01-01&to=2026-06-09"}}},"required":["projectId","asOf","comparisonPeriod"]},"CodeHealthTrend":{"type":"object","properties":{"projectId":{"type":"integer","description":"The numeric ID of the project.","example":1},"period":{"type":"object","properties":{"from":{"type":"string","format":"date","description":"Start date of the period (inclusive).","example":"2026-01-01"},"to":{"type":"string","format":"date","description":"End date of the period (inclusive).","example":"2026-06-09"}},"required":["from","to"],"description":"Date range covered by the trend series.","example":{"from":"2026-01-01","to":"2026-06-09"}},"metrics":{"type":"array","items":{"type":"string"},"description":"List of metric names included in the trend series.","example":["averageCodeHealth","hotspotCodeHealth"]},"series":{"type":"array","items":{"type":"object","properties":{"date":{"type":"string","description":"Date of this data point.","example":"2026-01-05"},"averageCodeHealth":{"oneOf":[{"type":"number"},{"type":"null"}],"description":"Average code health score across all files on this date.","example":7.1},"hotspotCodeHealth":{"oneOf":[{"type":"number"},{"type":"null"}],"description":"Average code health score across hotspot files on this date.","example":5.2},"projections":{"type":"object","properties":{"realized":{"type":"object","properties":{"averageCodeHealth":{"oneOf":[{"type":"number"},{"type":"null"}]}},"required":["averageCodeHealth"]},"potential":{"type":"object","properties":{"averageCodeHealth":{"oneOf":[{"type":"number"},{"type":"null"}]}},"required":["averageCodeHealth"]}},"required":["realized","potential"],"description":"Projected Code Health based on PR actions (fixed vs ignored).","example":{"realized":{"averageCodeHealth":6.4},"potential":{"averageCodeHealth":6.8}}}},"required":["date","averageCodeHealth","hotspotCodeHealth"]},"description":"Ordered list of data points forming the trend."},"context":{"type":"object","properties":{"averageCodeHealth":{"type":"object","properties":{"interpretation":{"type":"object","properties":{"id":{"type":"string","description":"Unique identifier of the benchmark entry.","example":"industry-average"},"label":{"type":"string","description":"Human-readable label for the benchmark entry.","example":"Industry Average"},"type":{"type":"string","enum":["threshold","benchmark","ai-readiness"],"description":"The source and context for the entry: benchmark, threshold, or ai-readiness score.","example":"benchmark"},"value":{"type":"number","description":"Numeric value associated with the benchmark entry.","example":5.15}},"required":["id","label","type","value"],"description":"Benchmark interpretation of the current code health score.","example":{"id":"industry-average","label":"Average Organizations","value":5.15,"type":"benchmark"}},"nextGoal":{"oneOf":[{"type":"object","properties":{"id":{"type":"string","description":"Unique identifier of the benchmark entry.","example":"industry-average"},"label":{"type":"string","description":"Human-readable label for the benchmark entry.","example":"Industry Average"},"type":{"type":"string","enum":["threshold","benchmark","ai-readiness"],"description":"The source and context for the entry: benchmark, threshold, or ai-readiness score.","example":"benchmark"},"value":{"type":"number","description":"Numeric value associated with the benchmark entry.","example":5.15}},"required":["id","label","type","value"]},{"type":"null"}],"description":"Next benchmark threshold to reach. Absent when the score is already at the top.","example":{"id":"problematic-code","label":"Problematic","value":8.9,"type":"threshold"}}},"required":["interpretation","nextGoal"],"description":"Interpretation and next goal for average code health.","example":{"interpretation":{"id":"industry-average","label":"Average Organizations","value":5.15,"type":"benchmark"},"nextGoal":{"id":"problematic-code","label":"Problematic","value":8.9,"type":"threshold"}}},"hotspotCodeHealth":{"type":"object","properties":{"interpretation":{"type":"object","properties":{"id":{"type":"string","description":"Unique identifier of the benchmark entry.","example":"industry-average"},"label":{"type":"string","description":"Human-readable label for the benchmark entry.","example":"Industry Average"},"type":{"type":"string","enum":["threshold","benchmark","ai-readiness"],"description":"The source and context for the entry: benchmark, threshold, or ai-readiness score.","example":"benchmark"},"value":{"type":"number","description":"Numeric value associated with the benchmark entry.","example":5.15}},"required":["id","label","type","value"],"description":"Benchmark interpretation of the current code health score.","example":{"id":"industry-average","label":"Average Organizations","value":5.15,"type":"benchmark"}},"nextGoal":{"oneOf":[{"type":"object","properties":{"id":{"type":"string","description":"Unique identifier of the benchmark entry.","example":"industry-average"},"label":{"type":"string","description":"Human-readable label for the benchmark entry.","example":"Industry Average"},"type":{"type":"string","enum":["threshold","benchmark","ai-readiness"],"description":"The source and context for the entry: benchmark, threshold, or ai-readiness score.","example":"benchmark"},"value":{"type":"number","description":"Numeric value associated with the benchmark entry.","example":5.15}},"required":["id","label","type","value"]},{"type":"null"}],"description":"Next benchmark threshold to reach. Absent when the score is already at the top.","example":{"id":"problematic-code","label":"Problematic","value":8.9,"type":"threshold"}}},"required":["interpretation","nextGoal"],"description":"Interpretation and next goal for hotspot code health.","example":{"interpretation":{"id":"industry-average","label":"Average Organizations","value":5.15,"type":"benchmark"},"nextGoal":{"id":"problematic-code","label":"Problematic","value":8.9,"type":"threshold"}}}},"description":"Benchmark-based interpretation and next goal for the latest scores in the trend.","example":{"averageCodeHealth":{"interpretation":{"id":"industry-average","label":"Average Organizations","value":5.15,"type":"benchmark"},"nextGoal":{"id":"problematic-code","label":"Problematic","value":8.9,"type":"threshold"}},"hotspotCodeHealth":{"interpretation":{"id":"industry-average","label":"Average Organizations","value":5.15,"type":"benchmark"},"nextGoal":{"id":"problematic-code","label":"Problematic","value":8.9,"type":"threshold"}}}},"aiReadinessContext":{"type":"object","properties":{"averageCodeHealth":{"type":"object","properties":{"interpretation":{"type":"object","properties":{"id":{"type":"string","description":"Unique identifier of the benchmark entry.","example":"industry-average"},"label":{"type":"string","description":"Human-readable label for the benchmark entry.","example":"Industry Average"},"type":{"type":"string","enum":["threshold","benchmark","ai-readiness"],"description":"The source and context for the entry: benchmark, threshold, or ai-readiness score.","example":"benchmark"},"value":{"type":"number","description":"Numeric value associated with the benchmark entry.","example":5.15}},"required":["id","label","type","value"],"description":"Benchmark interpretation of the current code health score.","example":{"id":"industry-average","label":"Average Organizations","value":5.15,"type":"benchmark"}},"nextGoal":{"oneOf":[{"type":"object","properties":{"id":{"type":"string","description":"Unique identifier of the benchmark entry.","example":"industry-average"},"label":{"type":"string","description":"Human-readable label for the benchmark entry.","example":"Industry Average"},"type":{"type":"string","enum":["threshold","benchmark","ai-readiness"],"description":"The source and context for the entry: benchmark, threshold, or ai-readiness score.","example":"benchmark"},"value":{"type":"number","description":"Numeric value associated with the benchmark entry.","example":5.15}},"required":["id","label","type","value"]},{"type":"null"}],"description":"Next benchmark threshold to reach. Absent when the score is already at the top.","example":{"id":"problematic-code","label":"Problematic","value":8.9,"type":"threshold"}}},"required":["interpretation","nextGoal"],"description":"Interpretation and next goal for average code health.","example":{"interpretation":{"id":"industry-average","label":"Average Organizations","value":5.15,"type":"benchmark"},"nextGoal":{"id":"problematic-code","label":"Problematic","value":8.9,"type":"threshold"}}},"hotspotCodeHealth":{"type":"object","properties":{"interpretation":{"type":"object","properties":{"id":{"type":"string","description":"Unique identifier of the benchmark entry.","example":"industry-average"},"label":{"type":"string","description":"Human-readable label for the benchmark entry.","example":"Industry Average"},"type":{"type":"string","enum":["threshold","benchmark","ai-readiness"],"description":"The source and context for the entry: benchmark, threshold, or ai-readiness score.","example":"benchmark"},"value":{"type":"number","description":"Numeric value associated with the benchmark entry.","example":5.15}},"required":["id","label","type","value"],"description":"Benchmark interpretation of the current code health score.","example":{"id":"industry-average","label":"Average Organizations","value":5.15,"type":"benchmark"}},"nextGoal":{"oneOf":[{"type":"object","properties":{"id":{"type":"string","description":"Unique identifier of the benchmark entry.","example":"industry-average"},"label":{"type":"string","description":"Human-readable label for the benchmark entry.","example":"Industry Average"},"type":{"type":"string","enum":["threshold","benchmark","ai-readiness"],"description":"The source and context for the entry: benchmark, threshold, or ai-readiness score.","example":"benchmark"},"value":{"type":"number","description":"Numeric value associated with the benchmark entry.","example":5.15}},"required":["id","label","type","value"]},{"type":"null"}],"description":"Next benchmark threshold to reach. Absent when the score is already at the top.","example":{"id":"problematic-code","label":"Problematic","value":8.9,"type":"threshold"}}},"required":["interpretation","nextGoal"],"description":"Interpretation and next goal for hotspot code health.","example":{"interpretation":{"id":"industry-average","label":"Average Organizations","value":5.15,"type":"benchmark"},"nextGoal":{"id":"problematic-code","label":"Problematic","value":8.9,"type":"threshold"}}}},"description":"AI readiness interpretation and next goal for the latest scores in the trend.","example":{"averageCodeHealth":{"interpretation":{"id":"ai-assisted","label":"AI Assisted","value":6.5,"type":"ai-readiness"},"nextGoal":{"id":"ai-friendly","label":"AI Friendly","value":9.5,"type":"ai-readiness"}},"hotspotCodeHealth":{"interpretation":{"id":"ai-caution","label":"AI Caution","value":1.0,"type":"ai-readiness"},"nextGoal":{"id":"ai-assisted","label":"AI Assisted","value":6.5,"type":"ai-readiness"}}}},"nextPageToken":{"type":"string","description":"Opaque cursor for the next page. Absent on the last page or when all results fit in one page.","example":"eyJwYWdlTmJyIjoxLCJwYWdlU2l6ZSI6NTB9"}},"required":["projectId","period","metrics","series","context","aiReadinessContext"]},"CommitActivityStatistics":{"type":"object","properties":{"projectId":{"type":"integer","description":"The numeric ID of the project.","example":123},"period":{"type":"object","properties":{"from":{"type":"string","format":"date","description":"Start date of the period (inclusive).","example":"2026-01-01"},"to":{"type":"string","format":"date","description":"End date of the period (inclusive).","example":"2026-06-09"}},"required":["from","to"],"description":"Date range covered by the commit activity series.","example":{"from":"2025-10-24","to":"2026-08-04"}},"metrics":{"type":"array","items":{"type":"string"},"description":"List of metric names included in the series.","example":["commitsActivity","linesAffected"]},"series":{"type":"array","items":{"type":"object","properties":{"date":{"type":"string","format":"date","description":"Date of this data point.","example":"2025-10-24"},"commitsActivity":{"oneOf":[{"type":"integer"},{"type":"null"}],"description":"Commit activity value for this date.","example":10},"linesAffected":{"oneOf":[{"type":"integer"},{"type":"null"}],"description":"Lines affected value for this date.","example":10}},"required":["date"]},"description":"Ordered list of data points forming the commit activity trend."},"context":{"type":"object","properties":{"commitsActivity":{"type":"object","properties":{"interpretation":{"$ref":"#/components/schemas/TrendInterpretation","description":"Shared trend interpretation for the observed activity pattern.","example":{"direction":"steady","pace":null}},"status":{"type":"string","enum":["stale","insufficient"],"description":"Reason why no trend interpretation could be produced for the current series.","example":"stale"},"points":{"type":"integer","description":"Number of dated numeric samples used for interpretation.","example":4},"idleDays":{"type":"integer","description":"Days since the latest valid sample. Present when status is stale.","example":41},"minPoints":{"type":"integer","description":"Minimum number of data points required for interpretation. Present when status is insufficient.","example":4},"delta":{"oneOf":[{"type":"number"},{"type":"null"}],"description":"Change in the metric over the observed series period, expressed in the metric's own unit. Null when fewer than two valid values are available.","example":2}},"description":"Interpretation for the commits activity metric.","example":{"interpretation":{"direction":"steady","pace":null},"points":4,"delta":2}},"linesAffected":{"type":"object","properties":{"interpretation":{"$ref":"#/components/schemas/TrendInterpretation","description":"Shared trend interpretation for the observed activity pattern.","example":{"direction":"steady","pace":null}},"status":{"type":"string","enum":["stale","insufficient"],"description":"Reason why no trend interpretation could be produced for the current series.","example":"stale"},"points":{"type":"integer","description":"Number of dated numeric samples used for interpretation.","example":4},"idleDays":{"type":"integer","description":"Days since the latest valid sample. Present when status is stale.","example":41},"minPoints":{"type":"integer","description":"Minimum number of data points required for interpretation. Present when status is insufficient.","example":4},"delta":{"oneOf":[{"type":"number"},{"type":"null"}],"description":"Change in the metric over the observed series period, expressed in the metric's own unit. Null when fewer than two valid values are available.","example":2}},"description":"Interpretation for the lines affected metric.","example":{"interpretation":{"direction":"steady","pace":null},"points":4,"delta":80}}},"description":"Metric interpretations for the latest values in the series.","example":{"commitsActivity":{"interpretation":{"direction":"steady","pace":null},"points":4,"delta":2},"linesAffected":{"interpretation":{"direction":"steady","pace":null},"points":4,"delta":80}}},"teams":{"type":"array","items":{"type":"object","properties":{"teamName":{"type":"string","description":"Name of the team.","example":"team_1"},"series":{"type":"array","items":{"type":"object","properties":{"date":{"type":"string","format":"date","description":"Date of this data point.","example":"2025-10-24"},"commitsActivity":{"oneOf":[{"type":"integer"},{"type":"null"}],"description":"Commit activity value for this date.","example":10},"linesAffected":{"oneOf":[{"type":"integer"},{"type":"null"}],"description":"Lines affected value for this date.","example":10}},"required":["date"]},"description":"Ordered list of data points for this team."},"context":{"type":"object","properties":{"commitsActivity":{"type":"object","properties":{"interpretation":{"$ref":"#/components/schemas/TrendInterpretation","description":"Shared trend interpretation for the observed activity pattern.","example":{"direction":"steady","pace":null}},"status":{"type":"string","enum":["stale","insufficient"],"description":"Reason why no trend interpretation could be produced for the current series.","example":"stale"},"points":{"type":"integer","description":"Number of dated numeric samples used for interpretation.","example":4},"idleDays":{"type":"integer","description":"Days since the latest valid sample. Present when status is stale.","example":41},"minPoints":{"type":"integer","description":"Minimum number of data points required for interpretation. Present when status is insufficient.","example":4},"delta":{"oneOf":[{"type":"number"},{"type":"null"}],"description":"Change in the metric over the observed series period, expressed in the metric's own unit. Null when fewer than two valid values are available.","example":2}},"description":"Interpretation for the commits activity metric.","example":{"interpretation":{"direction":"steady","pace":null},"points":4,"delta":2}},"linesAffected":{"type":"object","properties":{"interpretation":{"$ref":"#/components/schemas/TrendInterpretation","description":"Shared trend interpretation for the observed activity pattern.","example":{"direction":"steady","pace":null}},"status":{"type":"string","enum":["stale","insufficient"],"description":"Reason why no trend interpretation could be produced for the current series.","example":"stale"},"points":{"type":"integer","description":"Number of dated numeric samples used for interpretation.","example":4},"idleDays":{"type":"integer","description":"Days since the latest valid sample. Present when status is stale.","example":41},"minPoints":{"type":"integer","description":"Minimum number of data points required for interpretation. Present when status is insufficient.","example":4},"delta":{"oneOf":[{"type":"number"},{"type":"null"}],"description":"Change in the metric over the observed series period, expressed in the metric's own unit. Null when fewer than two valid values are available.","example":2}},"description":"Interpretation for the lines affected metric.","example":{"interpretation":{"direction":"steady","pace":null},"points":4,"delta":80}}},"description":"Metric interpretations for the latest values for this team.","example":{"commitsActivity":{"interpretation":{"direction":"steady","pace":null},"points":4,"delta":2},"linesAffected":{"interpretation":{"direction":"steady","pace":null},"points":4,"delta":80}}}},"required":["teamName","series","context"]},"description":"Per-team commit activity breakdown. Absent when no team filter is applied."},"components":{"type":"array","items":{"type":"object","properties":{"componentName":{"type":"string","description":"Name of the component.","example":"component_1"},"series":{"type":"array","items":{"type":"object","properties":{"date":{"type":"string","format":"date","description":"Date of this data point.","example":"2025-10-24"},"commitsActivity":{"oneOf":[{"type":"integer"},{"type":"null"}],"description":"Commit activity value for this date.","example":10},"linesAffected":{"oneOf":[{"type":"integer"},{"type":"null"}],"description":"Lines affected value for this date.","example":10}},"required":["date"]},"description":"Ordered list of data points for this component."},"context":{"type":"object","properties":{"commitsActivity":{"type":"object","properties":{"interpretation":{"$ref":"#/components/schemas/TrendInterpretation","description":"Shared trend interpretation for the observed activity pattern.","example":{"direction":"steady","pace":null}},"status":{"type":"string","enum":["stale","insufficient"],"description":"Reason why no trend interpretation could be produced for the current series.","example":"stale"},"points":{"type":"integer","description":"Number of dated numeric samples used for interpretation.","example":4},"idleDays":{"type":"integer","description":"Days since the latest valid sample. Present when status is stale.","example":41},"minPoints":{"type":"integer","description":"Minimum number of data points required for interpretation. Present when status is insufficient.","example":4},"delta":{"oneOf":[{"type":"number"},{"type":"null"}],"description":"Change in the metric over the observed series period, expressed in the metric's own unit. Null when fewer than two valid values are available.","example":2}},"description":"Interpretation for the commits activity metric.","example":{"interpretation":{"direction":"steady","pace":null},"points":4,"delta":2}},"linesAffected":{"type":"object","properties":{"interpretation":{"$ref":"#/components/schemas/TrendInterpretation","description":"Shared trend interpretation for the observed activity pattern.","example":{"direction":"steady","pace":null}},"status":{"type":"string","enum":["stale","insufficient"],"description":"Reason why no trend interpretation could be produced for the current series.","example":"stale"},"points":{"type":"integer","description":"Number of dated numeric samples used for interpretation.","example":4},"idleDays":{"type":"integer","description":"Days since the latest valid sample. Present when status is stale.","example":41},"minPoints":{"type":"integer","description":"Minimum number of data points required for interpretation. Present when status is insufficient.","example":4},"delta":{"oneOf":[{"type":"number"},{"type":"null"}],"description":"Change in the metric over the observed series period, expressed in the metric's own unit. Null when fewer than two valid values are available.","example":2}},"description":"Interpretation for the lines affected metric.","example":{"interpretation":{"direction":"steady","pace":null},"points":4,"delta":80}}},"description":"Metric interpretations for the latest values for this component.","example":{"commitsActivity":{"interpretation":{"direction":"steady","pace":null},"points":4,"delta":2},"linesAffected":{"interpretation":{"direction":"steady","pace":null},"points":4,"delta":80}}}},"required":["componentName","series","context"]},"description":"Per-component commit activity breakdown. Absent when no component filter is applied."},"nextPageToken":{"type":"string","description":"Opaque cursor for the next page. Absent on the last page or when all results fit in one page.","example":"eyJwYWdlTmJyIjoxLCJwYWdlU2l6ZSI6NTB9"}},"required":["projectId","period","metrics","series","context"]},"ComponentInventory":{"type":"object","properties":{"projectId":{"type":"integer","description":"Identifier of the project.","example":1},"asOf":{"type":"string","format":"date-time","description":"ISO 8601 datetime of when the snapshot was taken.","example":"2026-06-09T10:15:00Z"},"components":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","description":"Name of the architectural component.","example":"Payments"},"changeFrequency":{"type":"integer","description":"Number of commits that modified any file in the component. A commit touching several of the component's files counts once.","example":70},"linesOfCode":{"type":"integer","description":"Lines of code in the component.","example":600},"averageCodeHealth":{"oneOf":[{"type":"object","properties":{"value":{"type":"number","description":"Code health score on a scale from 1 to 10.","example":6.0},"classification":{"oneOf":[{"type":"string","enum":["unhealthy-code","problematic-code","healthy-code"]},{"type":"null"}],"description":"Human-readable classification of the code health score.","example":"problematic-code"},"trend":{"$ref":"#/components/schemas/TrendInterpretation","description":"Trend interpretation of the component's code health series, the same as in the code health summary. Absent when the series is too short to classify.","example":{"direction":"declining","pace":"slow"}}},"required":["value","classification"]},{"type":"null"}],"description":"Code health averaged across all files in the component. Null when no code health is available."},"hotspotCodeHealth":{"oneOf":[{"type":"object","properties":{"value":{"type":"number","description":"Code health score on a scale from 1 to 10.","example":6.0},"classification":{"oneOf":[{"type":"string","enum":["unhealthy-code","problematic-code","healthy-code"]},{"type":"null"}],"description":"Human-readable classification of the code health score.","example":"problematic-code"},"trend":{"$ref":"#/components/schemas/TrendInterpretation","description":"Trend interpretation of the component's code health series, the same as in the code health summary. Absent when the series is too short to classify.","example":{"direction":"declining","pace":"slow"}}},"required":["value","classification"]},{"type":"null"}],"description":"Code health averaged across the component's hotspots. Null when no code health is available."},"knowledge":{"oneOf":[{"type":"object","properties":{"mainAuthor":{"type":"object","properties":{"name":{"type":"string","description":"Name of the author with the highest ownership of the file or component.","example":"Bob"},"ownership":{"type":"number","description":"Share (0-1) of the file's or component's added lines written by the main author.","example":0.75},"linesAdded":{"type":"integer","description":"Number of lines the main author added to the file or component.","example":300},"isActive":{"type":"boolean","description":"Whether the main author is an active contributor, i.e. not a former contributor.","example":true}},"required":["name","ownership","linesAdded","isActive"],"description":"The author with the highest ownership of the file or component."},"formerContributorShare":{"oneOf":[{"type":"number"},{"type":"null"}],"description":"Share (0-1) of the file's or component's code written by former contributors. Null when inconclusive, e.g. when some authors are excluded from the analysis.","example":0.0},"authorCount":{"type":"integer","description":"Number of authors who contributed to the file or component.","example":2},"contributors":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","description":"Name of the contributor.","example":"Alice"},"ownership":{"type":"number","description":"Share (0-1) of the file's or component's added lines written by the contributor.","example":0.25},"isActive":{"type":"boolean","description":"Whether the contributor is active, i.e. not a former contributor.","example":true}},"required":["name","ownership","isActive"]},"description":"Authors owning more than 10% of the file or component, ordered by descending ownership."}},"required":["mainAuthor","formerContributorShare","authorCount","contributors"]},{"type":"null"}],"description":"Authorship of the component. Null when no ownership data exists."},"team":{"oneOf":[{"type":"object","properties":{"mainTeam":{"oneOf":[{"type":"object","properties":{"name":{"type":"string","description":"Name of the team owning the largest share of the file or component.","example":"team-core"},"ownership":{"type":"number","description":"Share (0-1) of the file's or component's added lines written by the main team.","example":1.0}},"required":["name","ownership"]},{"type":"null"}],"description":"The team owning the largest share of the file or component. Null when no team owns the code."},"authorCount":{"oneOf":[{"type":"integer"},{"type":"null"}],"description":"Number of teams that contributed to the file or component.","example":1}},"required":["mainTeam","authorCount"]},{"type":"null"}],"description":"Team ownership of the component. Null when no team data exists."},"lastModified":{"oneOf":[{"type":"object","properties":{"date":{"oneOf":[{"type":"string","format":"date"},{"type":"null"}],"description":"Date of the most recent change to the file or, for a component, to any of its files.","example":"2026-04-03"},"ageMonths":{"oneOf":[{"type":"integer"},{"type":"null"}],"description":"Number of months since the file or component was last modified.","example":2}},"required":["date","ageMonths"]},{"type":"null"}],"description":"When any of the component's files was last modified. Null when unknown."},"fileCount":{"type":"integer","description":"Number of files in the component.","example":2},"hotspots":{"type":"integer","description":"Number of the component's files that are hotspots.","example":2},"upliftTargets":{"type":"integer","description":"Number of the component's files that are uplift targets of any type, including local targets.","example":1},"offboardingRisks":{"type":"integer","description":"Number of the component's files that are off-boarding risks.","example":1}},"required":["name","changeFrequency","linesOfCode","averageCodeHealth","hotspotCodeHealth","knowledge","team","lastModified","fileCount","hotspots","upliftTargets","offboardingRisks"]},"description":"Per-component inventory entries. Files that match no component are reported in the summary instead."},"summary":{"type":"object","properties":{"totalComponents":{"type":"integer","description":"Total number of components in the inventory.","example":2},"hotspots":{"type":"integer","description":"Number of hotspots across all components.","example":2},"upliftTargets":{"type":"integer","description":"Number of uplift targets, including local targets, across all components.","example":1},"offboardingRisks":{"type":"integer","description":"Number of off-boarding risks across all components.","example":1},"unmappedFiles":{"type":"object","properties":{"fileCount":{"type":"integer","description":"Number of files that match no architectural component.","example":42},"topFolders":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string","description":"Path of a folder holding unmapped files, relative to the project root.","example":"payments-service/legacy"},"fileCount":{"type":"integer","description":"Number of unmapped files directly in this folder.","example":17}},"required":["path","fileCount"]},"description":"Up to ten folders holding the most unmapped files, ordered by descending file count. Adding components for these folders covers the most unmapped code."}},"required":["fileCount","topFolders"],"description":"Files that match no component, and the folders holding most of them."}},"required":["totalComponents","hotspots","upliftTargets","offboardingRisks","unmappedFiles"],"description":"Aggregate counts across the components, and the unmapped files.","example":{"totalComponents":2,"hotspots":2,"upliftTargets":1,"offboardingRisks":1,"unmappedFiles":{"fileCount":1,"topFolders":[{"path":"payments-service/src","fileCount":1}]}}},"nextPageToken":{"type":"string","description":"Opaque cursor for the next page. Absent on the last page or when all results fit in one page.","example":"eyJwYWdlTmJyIjoxLCJwYWdlU2l6ZSI6NTB9"}},"required":["projectId","asOf","components","summary"]},"EngineeringOutcomes":{"type":"object","properties":{"baselineCodeHealth":{"type":"number","description":"Baseline Code Health score used for the estimate.","example":6.2},"targetCodeHealth":{"type":"number","description":"Target Code Health score used for the estimate.","example":8.1},"unit":{"type":"string","enum":["percent"],"description":"Unit of the outcome interval bounds. Every bound is a relative change from the baseline.","example":"percent"},"confidenceLevel":{"type":"integer","description":"Confidence level of the outcome intervals, in percent.","example":90},"assumptions":{"type":"object","properties":{"initialUnplannedWorkPct":{"type":"number","description":"Initial unplanned work percentage used for the combined productivity impact estimate.","example":30.0},"initialUnplannedWorkPctSource":{"type":"string","enum":["provided","default"],"description":"Whether the initial unplanned work percentage was provided in the request or defaulted from the baseline Code Health.","example":"default"}},"required":["initialUnplannedWorkPct","initialUnplannedWorkPctSource"],"description":"Inputs the estimate depends on beyond the two Code Health scores."},"summary":{"type":"string","description":"Human-readable summary of the estimate, intended to be shown as-is by every client.","example":"Improving Code Health from 6.2 to 8.1 is associated with 7% to 22% fewer defects and 11% to 23% less development time for future changes to this code. Combined, that is 18% to 37% higher productivity, assuming 30% of current work is unplanned. Ranges are 90% confidence intervals."},"outcomes":{"type":"object","properties":{"defects":{"type":"object","properties":{"lower":{"type":"number","description":"Lower bound of the estimated 90% interval, expressed as a percentage change.","example":-21.85},"upper":{"type":"number","description":"Upper bound of the estimated 90% interval, expressed as a percentage change.","example":-6.69},"direction":{"type":"string","enum":["decrease","increase","mixed","unchanged"],"description":"Direction of the estimated change: a decrease or increase when the whole interval lies on one side of zero, mixed when it spans zero, unchanged when both bounds are zero.","example":"decrease"},"interpretation":{"type":"string","description":"Human-readable phrase for the interval, with percentages rounded to whole numbers and ordered by magnitude.","example":"7% to 22% fewer defects"}},"required":["lower","upper","direction","interpretation"]},"developmentTime":{"type":"object","properties":{"lower":{"type":"number","description":"Lower bound of the estimated 90% interval, expressed as a percentage change.","example":-21.85},"upper":{"type":"number","description":"Upper bound of the estimated 90% interval, expressed as a percentage change.","example":-6.69},"direction":{"type":"string","enum":["decrease","increase","mixed","unchanged"],"description":"Direction of the estimated change: a decrease or increase when the whole interval lies on one side of zero, mixed when it spans zero, unchanged when both bounds are zero.","example":"decrease"},"interpretation":{"type":"string","description":"Human-readable phrase for the interval, with percentages rounded to whole numbers and ordered by magnitude.","example":"7% to 22% fewer defects"}},"required":["lower","upper","direction","interpretation"]},"combinedProductivityImpact":{"type":"object","properties":{"lower":{"type":"number","description":"Lower bound of the estimated 90% interval, expressed as a percentage change.","example":-21.85},"upper":{"type":"number","description":"Upper bound of the estimated 90% interval, expressed as a percentage change.","example":-6.69},"direction":{"type":"string","enum":["decrease","increase","mixed","unchanged"],"description":"Direction of the estimated change: a decrease or increase when the whole interval lies on one side of zero, mixed when it spans zero, unchanged when both bounds are zero.","example":"decrease"},"interpretation":{"type":"string","description":"Human-readable phrase for the interval, with percentages rounded to whole numbers and ordered by magnitude.","example":"7% to 22% fewer defects"}},"required":["lower","upper","direction","interpretation"]}},"required":["defects","developmentTime","combinedProductivityImpact"],"description":"Estimated 90% intervals for supported engineering outcomes.","example":{"defects":{"lower":-21.85,"upper":-6.69,"direction":"decrease","interpretation":"7% to 22% fewer defects"},"developmentTime":{"lower":-22.79,"upper":-11.46,"direction":"decrease","interpretation":"11% to 23% less development time"},"combinedProductivityImpact":{"lower":18.32,"upper":37.31,"direction":"increase","interpretation":"18% to 37% higher productivity"}}}},"required":["baselineCodeHealth","targetCodeHealth","unit","confidenceLevel","assumptions","summary","outcomes"]},"FolderInventory":{"type":"object","properties":{"projectId":{"type":"integer","description":"Identifier of the project.","example":1},"asOf":{"type":"string","format":"date-time","description":"ISO 8601 datetime of when the snapshot was taken.","example":"2026-06-09T10:15:00Z"},"folders":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","description":"Name of the folder.","example":"src"},"path":{"type":"string","description":"Full path of the folder relative to the project root, using / as separator.","example":"payments-service/src"},"parentPath":{"type":"string","description":"Path of the parent folder. Absent for top-level (repo root) folders.","example":"payments-service"}},"required":["name","path"]},"description":"All folder nodes in breadth-first order, sorted alphabetically within each level."},"nextPageToken":{"type":"string","description":"Opaque cursor for the next page. Absent on the last page or when all results fit in one page.","example":"eyJwYWdlTmJyIjoxLCJwYWdlU2l6ZSI6NTB9"}},"required":["projectId","asOf","folders"]},"ForbiddenError":{"type":"object","properties":{"error":{"type":"string","description":"Human-readable description of the error.","example":"Forbidden access to project with id: 42, missing privilege: analysis-results-read"}},"required":["error"]},"HotspotFileInventory":{"type":"object","properties":{"projectId":{"type":"integer","description":"Identifier of the project.","example":"payments-service"},"asOf":{"type":"string","format":"date-time","description":"ISO 8601 datetime of when the snapshot was taken.","example":"2026-06-09T10:15:00Z"},"files":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string","description":"Path of the file relative to the project root.","example":"my-repo/src/uplift-target.cs"},"parentPath":{"type":"string","description":"Path of the parent folder. Present in all current results; may be absent in older cached results generated before this field was introduced.","example":"my-repo/src"},"component":{"type":"string","description":"Name of the architectural component the file belongs to. Absent when the file matches no component, when the project defines no components, or in results generated before this field was introduced.","example":"Payments"},"changeFrequency":{"type":"integer","description":"Number of commits that modified this file in the analysis period.","example":35},"linesOfCode":{"type":"integer","description":"Lines of code in the file.","example":500},"codeHealth":{"type":"object","properties":{"value":{"type":"number","description":"Code health score on a scale from 1 to 10.","example":3.0},"classification":{"oneOf":[{"type":"string","enum":["unhealthy-code","problematic-code","healthy-code"]},{"type":"null"}],"description":"Human-readable classification of the code health score.","example":"unhealthy-code"},"series":{"type":"array","items":{"type":"object","properties":{"date":{"type":"string","format":"date","description":"Date of the code-health measurement.","example":"2026-06-01"},"value":{"type":"number","description":"Code-health score measured on this date.","example":7.2}},"required":["date","value"]},"description":"Code health a year ago, a month ago and now, oldest first. Reference points without a score are left out. Absent in results generated before this field was introduced."},"trend":{"$ref":"#/components/schemas/TrendInterpretation","description":"Direction of the move from the oldest reference point to now. The pace is fast when the last month moved more than 1.0 in that direction. Absent when the file has fewer than two reference points.","example":{"direction":"declining","pace":"fast"}}},"required":["value","classification"],"description":"Code health score and classification for this file.","example":{"value":3.0,"classification":"unhealthy-code"}},"isHotspot":{"type":"boolean","description":"Whether this file is classified as a hotspot.","example":true},"upliftTarget":{"type":"object","properties":{"isTarget":{"type":"boolean","description":"Whether this file is classified as an uplift target.","example":true},"type":{"oneOf":[{"type":"string"},{"type":"null"}],"description":"Uplift target type (e.g. primary). Null if not a target.","example":"primary"}},"required":["isTarget","type"],"description":"Uplift target classification for this file.","example":{"isTarget":true,"type":"primary"}},"knowledge":{"oneOf":[{"type":"object","properties":{"mainAuthor":{"type":"object","properties":{"name":{"type":"string","description":"Name of the author with the highest ownership of the file or component.","example":"Bob"},"ownership":{"type":"number","description":"Share (0-1) of the file's or component's added lines written by the main author.","example":0.75},"linesAdded":{"type":"integer","description":"Number of lines the main author added to the file or component.","example":300},"isActive":{"type":"boolean","description":"Whether the main author is an active contributor, i.e. not a former contributor.","example":true}},"required":["name","ownership","linesAdded","isActive"],"description":"The author with the highest ownership of the file or component."},"formerContributorShare":{"oneOf":[{"type":"number"},{"type":"null"}],"description":"Share (0-1) of the file's or component's code written by former contributors. Null when inconclusive, e.g. when some authors are excluded from the analysis.","example":0.0},"authorCount":{"type":"integer","description":"Number of authors who contributed to the file or component.","example":2},"contributors":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","description":"Name of the contributor.","example":"Alice"},"ownership":{"type":"number","description":"Share (0-1) of the file's or component's added lines written by the contributor.","example":0.25},"isActive":{"type":"boolean","description":"Whether the contributor is active, i.e. not a former contributor.","example":true}},"required":["name","ownership","isActive"]},"description":"Authors owning more than 10% of the file or component, ordered by descending ownership."}},"required":["mainAuthor","formerContributorShare","authorCount","contributors"]},{"type":"null"}],"description":"Authorship of the file. Null when no ownership data exists. Absent in results generated before this field was introduced."},"team":{"oneOf":[{"type":"object","properties":{"mainTeam":{"oneOf":[{"type":"object","properties":{"name":{"type":"string","description":"Name of the team owning the largest share of the file or component.","example":"team-core"},"ownership":{"type":"number","description":"Share (0-1) of the file's or component's added lines written by the main team.","example":1.0}},"required":["name","ownership"]},{"type":"null"}],"description":"The team owning the largest share of the file or component. Null when no team owns the code."},"authorCount":{"oneOf":[{"type":"integer"},{"type":"null"}],"description":"Number of teams that contributed to the file or component.","example":1}},"required":["mainTeam","authorCount"]},{"type":"null"}],"description":"Team ownership of the file. Null when no team data exists. Absent in results generated before this field was introduced."},"lastModified":{"oneOf":[{"type":"object","properties":{"date":{"oneOf":[{"type":"string","format":"date"},{"type":"null"}],"description":"Date of the most recent change to the file or, for a component, to any of its files.","example":"2026-04-03"},"ageMonths":{"oneOf":[{"type":"integer"},{"type":"null"}],"description":"Number of months since the file or component was last modified.","example":2}},"required":["date","ageMonths"]},{"type":"null"}],"description":"When the file was last modified. Null when unknown. Absent in results generated before this field was introduced."},"offboardingRisk":{"type":"object","properties":{"isRisk":{"type":"boolean","description":"Whether the file is an off-boarding risk: an unhealthy hotspot where half or less of the code would remain with active contributors if its two top active contributors left.","example":true},"remainingKnowledge":{"oneOf":[{"type":"number"},{"type":"null"}],"description":"Share (0-1) of the file's code that stays with active contributors if its two top active contributors leave. Null when it can't be determined.","example":0.0}},"required":["isRisk","remainingKnowledge"],"description":"Off-boarding risk of the file. Absent in results generated before this field was introduced."},"coupling":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string","description":"Path of the coupled file relative to the project root.","example":"my-repo/test/uplift-target-test.cs"},"couplingPercent":{"type":"integer","description":"How strongly the two files are coupled, as a percentage (0-100) of the changes they share. Taken from the strongest of the by-commits and across-commits couplings.","example":85},"averageChangeFrequency":{"type":"integer","description":"Average change frequency of the two coupled files: the average number of commits that modified each of them in the analysis period.","example":12},"component":{"type":"string","description":"Name of the architectural component the coupled file belongs to. Absent when the file matches no component or when the project defines no components.","example":"Payments"}},"required":["path","couplingPercent","averageChangeFrequency"]},"description":"Files that change together with this file, strongest coupling first. Empty when the file has no temporal coupling.","example":[{"path":"my-repo/test/uplift-target-test.cs","couplingPercent":85,"averageChangeFrequency":12,"component":"Payments"}]}},"required":["path","changeFrequency","linesOfCode","codeHealth","isHotspot","upliftTarget","coupling"]},"description":"Per-file inventory entries."},"summary":{"type":"object","properties":{"totalFiles":{"type":"integer","description":"Total number of files in the inventory.","example":3},"hotspotCount":{"type":"integer","description":"Number of files classified as hotspots.","example":2},"upliftTargetCount":{"type":"integer","description":"Number of files classified as uplift targets.","example":1},"healthyHotspotCount":{"type":"integer","description":"Number of hotspots with healthy code health.","example":1},"offboardingRiskCount":{"type":"integer","description":"Number of files that are off-boarding risks. Absent in results generated before this field was introduced.","example":1}},"required":["totalFiles","hotspotCount","upliftTargetCount","healthyHotspotCount"],"description":"Aggregate counts across the file inventory.","example":{"totalFiles":3,"hotspotCount":2,"upliftTargetCount":1,"healthyHotspotCount":1,"offboardingRiskCount":1}},"nextPageToken":{"type":"string","description":"Opaque cursor for the next page. Absent on the last page or when all results fit in one page.","example":"eyJwYWdlTmJyIjoxLCJwYWdlU2l6ZSI6NTB9"}},"required":["projectId","asOf","files","summary"]},"HotspotRecommendationsResult":{"anyOf":[{"type":"object","properties":{"path":{"type":"string","description":"Repo-scoped file path used to identify the hotspot.","example":"sample-repo/src/Pricing.java"},"hotspotName":{"type":"string","description":"Qualified hotspot name returned by analysis.","example":"sample-repo/src/Pricing.java"},"recommendations":{"type":"array","items":{"type":"object","properties":{"rank":{"type":"integer","description":"Rank of the recommendation in descending priority order.","example":1},"scope":{"type":"string","enum":["function","file"],"description":"Whether the recommendation applies to a function or the file.","example":"function"},"target":{"type":"string","description":"Recommended function name or file path.","example":"calculatePrice"},"recommendationType":{"type":"string","description":"Deterministic recommendation type selected by analysis.","example":"unhealthy_hotspot_with_defect_history_and_complexity"},"text":{"type":"string","description":"Predefined human-readable recommendation text.","example":"calculatePrice changes frequently, has Code Health issues, has also been associated with defect history, and combines those problems with high complexity."},"evidence":{"type":"object","properties":{"revisions":{"type":"integer","description":"Number of revisions for the recommended function in the analysis period.","example":42},"loc":{"type":"integer","description":"Lines of code for the recommended function.","example":74},"cyclomaticComplexity":{"type":"integer","description":"Cyclomatic complexity for the recommended function.","example":18},"defects":{"type":"integer","description":"Historical defects associated with the recommended function when available.","example":5},"codeHealthIssues":{"type":"array","items":{"type":"string"},"description":"Code Health issues supporting the recommendation.","example":["Deep, Nested Complexity","Complex Method"]}},"required":["codeHealthIssues"],"description":"Supporting evidence for why this recommendation was selected.","example":{"revisions":42,"loc":74,"cyclomaticComplexity":18,"defects":5,"codeHealthIssues":["Deep, Nested Complexity","Complex Method"]}}},"required":["rank","scope","target","recommendationType","text","evidence"]},"description":"Ordered hotspot recommendations for the requested file."}},"required":["path","hotspotName","recommendations"]},{"type":"object","properties":{"status":{"type":"string","enum":["healthy","not_uplift_target","feature_unavailable"],"description":"Domain status reported when no packaged recommendations are returned.","example":"healthy"},"message":{"type":"string","description":"Human-readable explanation for the returned status.","example":"sample-repo/src/HealthyPricing.java is healthy code. There is nothing to fix."}},"required":["status","message"]}]},"InvitationsRequest":{"type":"object","properties":{"emails":{"type":"array","items":{"allOf":[{"type":"string","maxLength":254},{"type":"string","pattern":"^[^\\s@]+@[^\\s@]+\\.[^\\s@]+$"}],"format":"email","example":"developer@example.com"},"minItems":1,"maxItems":100},"telemetry":{"type":"object","properties":{"actionId":{"type":"string","pattern":"^[A-Za-z0-9_-]{16,128}$"},"projectId":{"type":"integer","minimum":1}},"required":["actionId"],"additionalProperties":false}},"required":["emails"],"additionalProperties":false,"example":{"emails":["developer@example.com","teammate@example.com"]}},"InvitationsResponse":{"type":"object","properties":{"invitations":{"type":"array","items":{"type":"object","properties":{"email":{"type":"string"},"status":{"type":"string","enum":["pending","awaiting-approval","already-member","send-failed","sending"]}},"required":["email","status"]}}},"required":["invitations"]},"NotFoundError":{"type":"object","properties":{"error":{"type":"string","description":"Human-readable description of the error.","example":"Project 42 not found"}},"required":["error"]},"QualityAlerts":{"type":"object","properties":{"alerts":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","description":"Human-readable alert title.","example":"Code Health Decline"},"description":{"type":"string","description":"Human-readable alert summary.","example":"3 files decline in Code Health"},"explanation":{"type":"string","description":"Additional explanation for why the alert matters.","example":"Files are degrading in code health, which makes the system more expensive to maintain."},"domain":{"type":"string","enum":["code-health"],"description":"Alert domain.","example":"code-health"},"detailsRef":{"type":"string","description":"Backend-owned reference to additional alert details.","example":"code-health-decline"}},"required":["name","description","explanation","domain","detailsRef"]},"description":"Code health alerts packaged for the quality API."}},"required":["alerts"]},"RisingHotspotsCodeHealthAlertDetails":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","description":"Repo-scoped file path for a rising hotspot with unhealthy code.","example":"src/rising-hotspot.clj"},"year":{"oneOf":[{"type":"number"},{"type":"null"}],"description":"Code Health score one year back.","example":7.5},"month":{"oneOf":[{"type":"number"},{"type":"null"}],"description":"Code Health score one month back.","example":6.4},"now":{"oneOf":[{"type":"number"},{"type":"null"}],"description":"Current Code Health score.","example":3.8},"commit-frequency-increase":{"type":"integer","description":"Increase in commit frequency that pushed the file up the hotspot ranking.","example":14}},"required":["name","year","month","now","commit-frequency-increase"]}},"SafeguardsMcpOutcomes":{"type":"object","properties":{"page":{"type":"integer"},"maxPages":{"type":"integer"},"outcomes":{"type":"array","items":{"type":"object","properties":{"eventType":{"type":"string"},"timestamp":{"type":"string","format":"date-time"},"eventProperties":{"type":"object","properties":{}},"score":{},"categories":{},"userIdentity":{"type":"string"},"projectId":{"type":"integer"}},"required":["eventType","timestamp","eventProperties"]}}},"required":["page","maxPages","outcomes"]},"SafeguardsOrganizationMcpInsights":{"type":"object","properties":{"meta":{"type":"object","properties":{"generatedAt":{"type":"string"},"period":{"type":"string"},"through":{"type":"string","format":"date","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}},"required":["generatedAt"]},"summary":{"type":"object","properties":{"numberOfSafeguardChecks":{"type":"integer"},"numberOfUplifts":{"type":"integer"},"numberOfDegradationsPrevented":{"type":"integer"},"mostUsedTools":{"type":"array","items":{"type":"object","properties":{"tool":{"type":"string"},"count":{"type":"integer"}},"required":["tool","count"]}},"numberOfInstallations":{"type":"integer"},"numberOfActiveInstallations":{"type":"integer"},"versions":{"type":"array","items":{"type":"object","properties":{"version":{"type":"string"},"numberOfActiveInstalls":{"type":"integer"}},"required":["version","numberOfActiveInstalls"]}},"numberOfUsers":{"type":"integer"},"numberOfActiveUsers":{"type":"integer"},"numberOfPaidSeats":{"type":"integer"},"adoptionPercentage":{"type":"number"}},"required":["numberOfSafeguardChecks","numberOfUplifts","numberOfDegradationsPrevented","mostUsedTools","numberOfInstallations","numberOfActiveInstallations","versions","numberOfUsers","numberOfActiveUsers"]},"projects":{"type":"array","items":{"type":"object","properties":{"projectId":{"type":"integer"},"name":{"type":"string"},"summary":{"type":"object","properties":{"numberOfActiveAuthors":{"type":"integer"},"numberOfCodesceneUsers":{"type":"integer"},"numberOfUsers":{"type":"integer"},"numberOfActiveUsers":{"type":"integer"}},"required":["numberOfActiveAuthors","numberOfCodesceneUsers","numberOfUsers","numberOfActiveUsers"]},"selectedPeriod":{"type":"object","properties":{"from":{"type":"string","format":"date","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"to":{"type":"string","format":"date","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"summary":{"type":"object","properties":{"numberOfSafeguardChecks":{"type":"integer"},"numberOfUplifts":{"type":"integer"},"numberOfDegradationsPrevented":{"type":"integer"},"mostUsedTools":{"type":"array","items":{"type":"object","properties":{"tool":{"type":"string"},"count":{"type":"integer"}},"required":["tool","count"]}}},"required":["numberOfSafeguardChecks","numberOfUplifts","numberOfDegradationsPrevented","mostUsedTools"]},"checksPerDeveloperMedian":{"anyOf":[{"type":"integer"},{"type":"number"}]}},"required":["from","to","summary","checksPerDeveloperMedian"]}},"required":["projectId","name","summary","selectedPeriod"]}},"selectedPeriod":{"type":"object","properties":{"from":{"type":"string","format":"date","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"to":{"type":"string","format":"date","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"summary":{"type":"object","properties":{"numberOfSafeguardChecks":{"type":"integer"},"numberOfUplifts":{"type":"integer"},"numberOfDegradationsPrevented":{"type":"integer"},"mostUsedTools":{"type":"array","items":{"type":"object","properties":{"tool":{"type":"string"},"count":{"type":"integer"}},"required":["tool","count"]}},"numberOfActiveUsers":{"type":"integer"},"numberOfNewUsers":{"type":"integer"}},"required":["numberOfSafeguardChecks","numberOfUplifts","numberOfDegradationsPrevented","mostUsedTools","numberOfActiveUsers","numberOfNewUsers"]},"checksPerDeveloper":{"type":"object","properties":{"median":{"anyOf":[{"type":"integer"},{"type":"number"}]},"range":{"type":"object","properties":{"min":{"type":"integer"},"max":{"type":"integer"}},"required":["min","max"]},"distribution":{"type":"array","items":{"type":"object","properties":{"label":{"type":"string"},"developers":{"type":"integer"}},"required":["label","developers"]}},"topDevelopers":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"label":{"type":"string"},"name":{"type":"string"},"count":{"type":"integer"}},"required":["id","label","count"]}}},"required":["median","range","distribution","topDevelopers"]}},"required":["from","to","summary","checksPerDeveloper"]},"previousPeriod":{"type":"object","properties":{"from":{"type":"string","format":"date","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"to":{"type":"string","format":"date","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"summary":{"type":"object","properties":{"numberOfSafeguardChecks":{"type":"integer"},"numberOfUplifts":{"type":"integer"},"numberOfDegradationsPrevented":{"type":"integer"},"mostUsedTools":{"type":"array","items":{"type":"object","properties":{"tool":{"type":"string"},"count":{"type":"integer"}},"required":["tool","count"]}},"numberOfActiveUsers":{"type":"integer"},"numberOfNewUsers":{"type":"integer"}},"required":["numberOfSafeguardChecks","numberOfUplifts","numberOfDegradationsPrevented","mostUsedTools","numberOfActiveUsers","numberOfNewUsers"]},"checksPerDeveloper":{"type":"object","properties":{"median":{"anyOf":[{"type":"integer"},{"type":"number"}]},"range":{"type":"object","properties":{"min":{"type":"integer"},"max":{"type":"integer"}},"required":["min","max"]},"distribution":{"type":"array","items":{"type":"object","properties":{"label":{"type":"string"},"developers":{"type":"integer"}},"required":["label","developers"]}},"topDevelopers":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"label":{"type":"string"},"name":{"type":"string"},"count":{"type":"integer"}},"required":["id","label","count"]}}},"required":["median","range","distribution","topDevelopers"]}},"required":["from","to","summary","checksPerDeveloper"]},"trends":{"type":"object","properties":{"adoption":{"type":"array","items":{"type":"object","properties":{"from":{"type":"string","format":"date","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"to":{"type":"string","format":"date","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"numberOfActiveUsers":{"type":"integer"}},"required":["from","to","numberOfActiveUsers"]}},"impact":{"type":"array","items":{"type":"object","properties":{"from":{"type":"string","format":"date","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"to":{"type":"string","format":"date","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"numberOfUplifts":{"type":"integer"},"numberOfDegradationsPrevented":{"type":"integer"}},"required":["from","to","numberOfUplifts","numberOfDegradationsPrevented"]}}},"required":["adoption","impact"]}},"required":["meta","summary"]},"SafeguardsOrganizationUsers":{"type":"object","properties":{"page":{"type":"integer"},"maxPages":{"type":"integer"},"meta":{"type":"object","properties":{"generatedAt":{"type":"string"}},"required":["generatedAt"]},"users":{"type":"array","items":{"type":"object","properties":{"identity":{"oneOf":[{"type":"string"},{"type":"null"}]},"userId":{"type":"integer"},"id":{"type":"string"},"name":{"type":"string"},"team":{"oneOf":[{"type":"string"},{"type":"null"}]},"commits":{"oneOf":[{"type":"integer"},{"type":"null"}]},"exDeveloper":{"type":"boolean"},"invitationStatus":{"description":"Invitation to the current organization. Omitted for registered accounts without an invitation record; developers without an account are not-invited.","type":"string","enum":["pending","accepted","requested","rejected","not-invited"]},"adoptionStatus":{"type":"string","enum":["active","no-account","never-connected","dormant"]},"duplicates":{"type":"array","items":{"type":"string"}},"latestMcpVersion":{"oneOf":[{"type":"string"},{"type":"null"}]},"lastEventDate":{"type":"string","format":"date-time"},"summary":{"type":"object","properties":{"numberOfSafeguardChecks":{"type":"integer"},"numberOfUplifts":{"type":"integer"},"numberOfDegradationsPrevented":{"type":"integer"},"mostUsedTools":{"type":"array","items":{"type":"object","properties":{"tool":{"type":"string"},"count":{"type":"integer"}},"required":["tool","count"]}}},"required":["numberOfSafeguardChecks","numberOfUplifts","numberOfDegradationsPrevented","mostUsedTools"]}},"required":["identity"]}}},"required":["page","maxPages","meta","users"]},"SafeguardsPrInsights":{"type":"object","properties":{"meta":{"type":"object","properties":{"projectId":{"type":"integer"},"analysisId":{"type":"integer"},"from":{"type":"string","format":"date","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"to":{"type":"string","format":"date","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"generatedAt":{"type":"string","format":"date-time"}},"required":["projectId","from","to","generatedAt"]},"summary":{"type":"object","properties":{"totalPrAnalyses":{"type":"integer"},"findingsDetected":{"type":"integer"},"findingsFixed":{"type":"integer"},"findingsIgnored":{"type":"integer"},"findingsSuppressed":{"type":"integer"}},"required":["totalPrAnalyses","findingsDetected","findingsFixed","findingsIgnored","findingsSuppressed"]},"interpretation":{"type":"object","properties":{"netChange":{"type":"integer"},"status":{"type":"string","enum":["no-issues","stable","degrading"]}},"required":["netChange","status"]},"monthlyTrends":{"type":"array","items":{"type":"object","properties":{"month":{"type":"string"},"statistics":{"type":"object","properties":{"totalDeltaAnalyses":{"type":"integer"},"totalDetectedViolations":{"type":"integer"},"totalDetectedViolationsFixed":{"type":"integer"},"totalViolationsIgnored":{"type":"integer"},"totalNegativeFindings":{"type":"integer"},"totalIgnoredFindings":{"type":"integer"},"totalSuppressedFindings":{"type":"integer"}},"required":["totalDeltaAnalyses","totalDetectedViolations","totalDetectedViolationsFixed","totalViolationsIgnored","totalNegativeFindings","totalIgnoredFindings","totalSuppressedFindings"]},"interpretation":{"type":"object","properties":{"netChange":{"type":"integer"},"status":{"type":"string","enum":["no-issues","stable","degrading"]}},"required":["netChange","status"]}},"required":["month","statistics","interpretation"]}}},"required":["meta","summary","interpretation","monthlyTrends"]},"SafeguardsPrOutcomes":{"type":"object","properties":{"page":{"type":"integer"},"maxPages":{"type":"integer"},"outcomes":{"type":"array","items":{"type":"object","properties":{"prId":{"type":"string"},"analysisDate":{"type":"string"},"repository":{"type":"string"},"authors":{"type":"array","items":{"type":"string"}},"statistics":{"type":"object","properties":{"findingsDetected":{"type":"integer"},"findingsFixed":{"type":"integer"},"findingsIgnored":{"type":"integer"},"findingsSuppressed":{"type":"integer"}},"required":["findingsDetected","findingsFixed","findingsIgnored","findingsSuppressed"]},"interpretation":{"type":"object","properties":{"netChange":{"type":"integer"},"status":{"type":"string","enum":["no-issues","resolved","unresolved"]}},"required":["netChange","status"]}},"required":["prId","analysisDate","repository","authors","statistics","interpretation"]}}},"required":["page","maxPages","outcomes"]},"SafeguardsProjectMcpInsights":{"type":"object","properties":{"meta":{"type":"object","properties":{"projectId":{"type":"integer"},"generatedAt":{"type":"string"},"period":{"type":"string"},"through":{"type":"string","format":"date","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}},"required":["projectId","generatedAt"]},"summary":{"type":"object","properties":{"numberOfSafeguardChecks":{"type":"integer"},"numberOfUplifts":{"type":"integer"},"numberOfDegradationsPrevented":{"type":"integer"},"mostUsedTools":{"type":"array","items":{"type":"object","properties":{"tool":{"type":"string"},"count":{"type":"integer"}},"required":["tool","count"]}},"numberOfInstallations":{"type":"integer"},"numberOfActiveInstallations":{"type":"integer"},"versions":{"type":"array","items":{"type":"object","properties":{"version":{"type":"string"},"numberOfActiveInstalls":{"type":"integer"}},"required":["version","numberOfActiveInstalls"]}},"numberOfUsers":{"type":"integer"},"numberOfActiveUsers":{"type":"integer"}},"required":["numberOfSafeguardChecks","numberOfUplifts","numberOfDegradationsPrevented","mostUsedTools","numberOfInstallations","numberOfActiveInstallations","versions","numberOfUsers","numberOfActiveUsers"]},"selectedPeriod":{"type":"object","properties":{"from":{"type":"string","format":"date","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"to":{"type":"string","format":"date","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"summary":{"type":"object","properties":{"numberOfSafeguardChecks":{"type":"integer"},"numberOfUplifts":{"type":"integer"},"numberOfDegradationsPrevented":{"type":"integer"},"mostUsedTools":{"type":"array","items":{"type":"object","properties":{"tool":{"type":"string"},"count":{"type":"integer"}},"required":["tool","count"]}},"numberOfActiveUsers":{"type":"integer"},"numberOfNewUsers":{"type":"integer"}},"required":["numberOfSafeguardChecks","numberOfUplifts","numberOfDegradationsPrevented","mostUsedTools","numberOfActiveUsers","numberOfNewUsers"]},"checksPerDeveloper":{"type":"object","properties":{"median":{"anyOf":[{"type":"integer"},{"type":"number"}]},"range":{"type":"object","properties":{"min":{"type":"integer"},"max":{"type":"integer"}},"required":["min","max"]},"distribution":{"type":"array","items":{"type":"object","properties":{"label":{"type":"string"},"developers":{"type":"integer"}},"required":["label","developers"]}},"topDevelopers":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"label":{"type":"string"},"name":{"type":"string"},"count":{"type":"integer"}},"required":["id","label","count"]}}},"required":["median","range","distribution","topDevelopers"]}},"required":["from","to","summary","checksPerDeveloper"]},"previousPeriod":{"type":"object","properties":{"from":{"type":"string","format":"date","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"to":{"type":"string","format":"date","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"summary":{"type":"object","properties":{"numberOfSafeguardChecks":{"type":"integer"},"numberOfUplifts":{"type":"integer"},"numberOfDegradationsPrevented":{"type":"integer"},"mostUsedTools":{"type":"array","items":{"type":"object","properties":{"tool":{"type":"string"},"count":{"type":"integer"}},"required":["tool","count"]}},"numberOfActiveUsers":{"type":"integer"},"numberOfNewUsers":{"type":"integer"}},"required":["numberOfSafeguardChecks","numberOfUplifts","numberOfDegradationsPrevented","mostUsedTools","numberOfActiveUsers","numberOfNewUsers"]},"checksPerDeveloper":{"type":"object","properties":{"median":{"anyOf":[{"type":"integer"},{"type":"number"}]},"range":{"type":"object","properties":{"min":{"type":"integer"},"max":{"type":"integer"}},"required":["min","max"]},"distribution":{"type":"array","items":{"type":"object","properties":{"label":{"type":"string"},"developers":{"type":"integer"}},"required":["label","developers"]}},"topDevelopers":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"label":{"type":"string"},"name":{"type":"string"},"count":{"type":"integer"}},"required":["id","label","count"]}}},"required":["median","range","distribution","topDevelopers"]}},"required":["from","to","summary","checksPerDeveloper"]},"trends":{"type":"object","properties":{"adoption":{"type":"array","items":{"type":"object","properties":{"from":{"type":"string","format":"date","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"to":{"type":"string","format":"date","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"numberOfActiveUsers":{"type":"integer"}},"required":["from","to","numberOfActiveUsers"]}},"impact":{"type":"array","items":{"type":"object","properties":{"from":{"type":"string","format":"date","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"to":{"type":"string","format":"date","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"numberOfUplifts":{"type":"integer"},"numberOfDegradationsPrevented":{"type":"integer"}},"required":["from","to","numberOfUplifts","numberOfDegradationsPrevented"]}}},"required":["adoption","impact"]}},"required":["meta","summary"]},"SafeguardsProjectMcpOutcomes":{"type":"object","properties":{"page":{"type":"integer"},"maxPages":{"type":"integer"},"outcomes":{"type":"array","items":{"type":"object","properties":{"eventType":{"type":"string"},"timestamp":{"type":"string","format":"date-time"},"eventProperties":{"type":"object","properties":{}},"score":{},"categories":{},"userIdentity":{"type":"string"},"projectId":{"type":"integer"},"name":{"type":"string"}},"required":["eventType","timestamp","eventProperties"]}}},"required":["page","maxPages","outcomes"]},"SafeguardsProjectMcpUsers":{"type":"object","properties":{"page":{"type":"integer"},"maxPages":{"type":"integer"},"meta":{"type":"object","properties":{"generatedAt":{"type":"string"}},"required":["generatedAt"]},"users":{"type":"array","items":{"type":"object","properties":{"identity":{"oneOf":[{"type":"string"},{"type":"null"}]},"userId":{"type":"integer"},"id":{"type":"string"},"name":{"type":"string"},"team":{"oneOf":[{"type":"string"},{"type":"null"}]},"commits":{"oneOf":[{"type":"integer"},{"type":"null"}]},"exDeveloper":{"type":"boolean"},"invitationStatus":{"description":"Invitation to the current organization. Omitted for registered accounts without an invitation record; developers without an account are not-invited.","type":"string","enum":["pending","accepted","requested","rejected","not-invited"]},"adoptionStatus":{"type":"string","enum":["active","no-account","never-connected","dormant"]},"duplicates":{"type":"array","items":{"type":"string"}},"latestMcpVersion":{"oneOf":[{"type":"string"},{"type":"null"}]},"lastEventDate":{"type":"string","format":"date-time"},"summary":{"type":"object","properties":{"numberOfSafeguardChecks":{"type":"integer"},"numberOfUplifts":{"type":"integer"},"numberOfDegradationsPrevented":{"type":"integer"},"mostUsedTools":{"type":"array","items":{"type":"object","properties":{"tool":{"type":"string"},"count":{"type":"integer"}},"required":["tool","count"]}}},"required":["numberOfSafeguardChecks","numberOfUplifts","numberOfDegradationsPrevented","mostUsedTools"]},"selectedPeriod":{"type":"object","properties":{"from":{"type":"string","format":"date","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"to":{"type":"string","format":"date","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"summary":{"type":"object","properties":{"numberOfSafeguardChecks":{"type":"integer"},"numberOfUplifts":{"type":"integer"},"numberOfDegradationsPrevented":{"type":"integer"},"mostUsedTools":{"type":"array","items":{"type":"object","properties":{"tool":{"type":"string"},"count":{"type":"integer"}},"required":["tool","count"]}}},"required":["numberOfSafeguardChecks","numberOfUplifts","numberOfDegradationsPrevented","mostUsedTools"]}},"required":["from","to","summary"]}},"required":["identity"]}},"totalCount":{"type":"integer"},"cohorts":{"type":"object","properties":{"noAccount":{"type":"integer"},"neverConnected":{"type":"integer"},"dormant":{"type":"integer"},"active":{"type":"integer"},"activated":{"description":"Eligible event-backed MCP users: active plus dormant. All cohort counts omit excluded authors and are computed before cohort filtering and pagination.","type":"integer"}},"required":["noAccount","neverConnected","dormant","active","activated"]}},"required":["page","maxPages","meta","users","totalCount"]},"SafeguardsUserMcpInsights":{"type":"object","properties":{"meta":{"type":"object","properties":{"generatedAt":{"type":"string"},"userIdentity":{"oneOf":[{"anyOf":[{"type":"string"},{"type":"integer"}]},{"type":"null"}]}},"required":["generatedAt","userIdentity"]},"summary":{"type":"object","properties":{"numberOfSafeguardChecks":{"type":"integer"},"numberOfUplifts":{"type":"integer"},"numberOfDegradationsPrevented":{"type":"integer"},"mostUsedTools":{"type":"array","items":{"type":"object","properties":{"tool":{"type":"string"},"count":{"type":"integer"}},"required":["tool","count"]}},"numberOfInstallations":{"type":"integer"},"numberOfActiveInstallations":{"type":"integer"},"versions":{"type":"array","items":{"type":"object","properties":{"version":{"type":"string"},"numberOfActiveInstalls":{"type":"integer"}},"required":["version","numberOfActiveInstalls"]}}},"required":["numberOfSafeguardChecks","numberOfUplifts","numberOfDegradationsPrevented","mostUsedTools","numberOfInstallations","numberOfActiveInstallations","versions"]}},"required":["meta","summary"]},"Tag":{"type":"object","properties":{"id":{"type":"integer"},"name":{"type":"string"}},"required":["id","name"]},"TrendInterpretation":{"type":"object","properties":{"direction":{"type":"string","enum":["improving","declining","steady"],"description":"Normalized trend direction for reusable trend consumers.","example":"steady"},"pace":{"oneOf":[{"type":"string","enum":["slow","fast"]},{"type":"null"}],"description":"Normalized trend pace. Null when the direction is steady.","example":null}},"required":["direction","pace"]},"UnauthorizedError":{"type":"object","properties":{"error":{"type":"string","description":"Human-readable description of the error.","example":"User not authenticated."}},"required":["error"]},"UnitCodeHealthResult":{"anyOf":[{"type":"object","properties":{"projectId":{"type":"integer","description":"The numeric ID of the project the unit belongs to.","example":1},"asOf":{"type":"string","format":"date-time","description":"ISO 8601 datetime of when the snapshot was taken.","example":"2026-06-09T10:15:00Z"},"comparisonPeriod":{"type":"object","properties":{"from":{"type":"string","format":"date","description":"Start date of the period (inclusive).","example":"2026-01-01"},"to":{"type":"string","format":"date","description":"End date of the period (inclusive).","example":"2026-06-09"}},"required":["from","to"],"description":"Date range used to compute the delta values.","example":{"from":"2026-01-01","to":"2026-06-09"}},"type":{"type":"string","enum":["team","component"],"description":"Kind of the unit.","example":"team"},"analyticalUnitId":{"type":"integer","description":"Analytics analytical-unit ID of the team or component.","example":9101},"name":{"type":"string","description":"Display name of the team or component.","example":"Payments Team"},"averageCodeHealth":{"type":"object","properties":{"value":{"oneOf":[{"type":"number"},{"type":"null"}],"description":"Code health score on a scale from 1 to 10.","example":7.4},"delta":{"oneOf":[{"type":"number"},{"type":"null"}],"description":"Change in code health score relative to the comparison period. Null if no prior data.","example":0.3},"classification":{"oneOf":[{"type":"string","enum":["unhealthy-code","problematic-code","healthy-code"]},{"type":"null"}],"description":"Human-readable classification of the code health score (e.g. healthy-code, problematic-code, unhealthy-code).","example":"problematic-code"},"nextGoal":{"oneOf":[{"type":"object","properties":{"id":{"type":"string","description":"Unique identifier of the benchmark entry.","example":"industry-average"},"label":{"type":"string","description":"Human-readable label for the benchmark entry.","example":"Industry Average"},"type":{"type":"string","enum":["threshold","benchmark","ai-readiness"],"description":"The source and context for the entry: benchmark, threshold, or ai-readiness score.","example":"benchmark"},"value":{"type":"number","description":"Numeric value associated with the benchmark entry.","example":5.15}},"required":["id","label","type","value"]},{"type":"null"}],"description":"Next benchmark threshold to reach. Present when a higher threshold remains.","example":{"id":"healthy-code","label":"Healthy","value":9.0,"type":"threshold"}},"trend":{"$ref":"#/components/schemas/TrendInterpretation","description":"Trend interpretation derived from the packaged code-health trend series. Absent when the series is unavailable or too short to classify.","example":{"direction":"improving","pace":"slow"}},"series":{"type":"array","items":{"type":"object","properties":{"date":{"type":"string","format":"date","description":"Date of the code-health measurement.","example":"2026-06-01"},"value":{"type":"number","description":"Code-health score measured on this date.","example":7.2}},"required":["date","value"]},"description":"Dated code-health history over the comparison period. Empty when no usable measurements exist."}},"required":["value","delta","classification"],"description":"Code health averaged across all files of the unit."},"hotspotCodeHealth":{"type":"object","properties":{"value":{"oneOf":[{"type":"number"},{"type":"null"}],"description":"Code health score on a scale from 1 to 10.","example":7.4},"delta":{"oneOf":[{"type":"number"},{"type":"null"}],"description":"Change in code health score relative to the comparison period. Null if no prior data.","example":0.3},"classification":{"oneOf":[{"type":"string","enum":["unhealthy-code","problematic-code","healthy-code"]},{"type":"null"}],"description":"Human-readable classification of the code health score (e.g. healthy-code, problematic-code, unhealthy-code).","example":"problematic-code"},"nextGoal":{"oneOf":[{"type":"object","properties":{"id":{"type":"string","description":"Unique identifier of the benchmark entry.","example":"industry-average"},"label":{"type":"string","description":"Human-readable label for the benchmark entry.","example":"Industry Average"},"type":{"type":"string","enum":["threshold","benchmark","ai-readiness"],"description":"The source and context for the entry: benchmark, threshold, or ai-readiness score.","example":"benchmark"},"value":{"type":"number","description":"Numeric value associated with the benchmark entry.","example":5.15}},"required":["id","label","type","value"]},{"type":"null"}],"description":"Next benchmark threshold to reach. Present when a higher threshold remains.","example":{"id":"healthy-code","label":"Healthy","value":9.0,"type":"threshold"}},"trend":{"$ref":"#/components/schemas/TrendInterpretation","description":"Trend interpretation derived from the packaged code-health trend series. Absent when the series is unavailable or too short to classify.","example":{"direction":"improving","pace":"slow"}},"series":{"type":"array","items":{"type":"object","properties":{"date":{"type":"string","format":"date","description":"Date of the code-health measurement.","example":"2026-06-01"},"value":{"type":"number","description":"Code-health score measured on this date.","example":7.2}},"required":["date","value"]},"description":"Dated code-health history over the comparison period. Empty when no usable measurements exist."}},"required":["value","delta","classification"],"description":"Code health averaged across hotspot files of the unit."},"context":{"type":"object","properties":{"averageCodeHealth":{"type":"object","properties":{"interpretation":{"type":"object","properties":{"id":{"type":"string","description":"Unique identifier of the benchmark entry.","example":"industry-average"},"label":{"type":"string","description":"Human-readable label for the benchmark entry.","example":"Industry Average"},"type":{"type":"string","enum":["threshold","benchmark","ai-readiness"],"description":"The source and context for the entry: benchmark, threshold, or ai-readiness score.","example":"benchmark"},"value":{"type":"number","description":"Numeric value associated with the benchmark entry.","example":5.15}},"required":["id","label","type","value"],"description":"Benchmark interpretation of the current code health score.","example":{"id":"industry-average","label":"Average Organizations","value":5.15,"type":"benchmark"}},"nextGoal":{"oneOf":[{"type":"object","properties":{"id":{"type":"string","description":"Unique identifier of the benchmark entry.","example":"industry-average"},"label":{"type":"string","description":"Human-readable label for the benchmark entry.","example":"Industry Average"},"type":{"type":"string","enum":["threshold","benchmark","ai-readiness"],"description":"The source and context for the entry: benchmark, threshold, or ai-readiness score.","example":"benchmark"},"value":{"type":"number","description":"Numeric value associated with the benchmark entry.","example":5.15}},"required":["id","label","type","value"]},{"type":"null"}],"description":"Next benchmark threshold to reach. Absent when the score is already at the top.","example":{"id":"problematic-code","label":"Problematic","value":8.9,"type":"threshold"}}},"required":["interpretation","nextGoal"],"description":"Interpretation and next goal for average code health.","example":{"interpretation":{"id":"industry-average","label":"Average Organizations","value":5.15,"type":"benchmark"},"nextGoal":{"id":"problematic-code","label":"Problematic","value":8.9,"type":"threshold"}}},"hotspotCodeHealth":{"type":"object","properties":{"interpretation":{"type":"object","properties":{"id":{"type":"string","description":"Unique identifier of the benchmark entry.","example":"industry-average"},"label":{"type":"string","description":"Human-readable label for the benchmark entry.","example":"Industry Average"},"type":{"type":"string","enum":["threshold","benchmark","ai-readiness"],"description":"The source and context for the entry: benchmark, threshold, or ai-readiness score.","example":"benchmark"},"value":{"type":"number","description":"Numeric value associated with the benchmark entry.","example":5.15}},"required":["id","label","type","value"],"description":"Benchmark interpretation of the current code health score.","example":{"id":"industry-average","label":"Average Organizations","value":5.15,"type":"benchmark"}},"nextGoal":{"oneOf":[{"type":"object","properties":{"id":{"type":"string","description":"Unique identifier of the benchmark entry.","example":"industry-average"},"label":{"type":"string","description":"Human-readable label for the benchmark entry.","example":"Industry Average"},"type":{"type":"string","enum":["threshold","benchmark","ai-readiness"],"description":"The source and context for the entry: benchmark, threshold, or ai-readiness score.","example":"benchmark"},"value":{"type":"number","description":"Numeric value associated with the benchmark entry.","example":5.15}},"required":["id","label","type","value"]},{"type":"null"}],"description":"Next benchmark threshold to reach. Absent when the score is already at the top.","example":{"id":"problematic-code","label":"Problematic","value":8.9,"type":"threshold"}}},"required":["interpretation","nextGoal"],"description":"Interpretation and next goal for hotspot code health.","example":{"interpretation":{"id":"industry-average","label":"Average Organizations","value":5.15,"type":"benchmark"},"nextGoal":{"id":"problematic-code","label":"Problematic","value":8.9,"type":"threshold"}}}},"description":"Benchmark interpretation and next goal for the latest scores."},"aiReadinessContext":{"type":"object","properties":{"averageCodeHealth":{"type":"object","properties":{"interpretation":{"type":"object","properties":{"id":{"type":"string","description":"Unique identifier of the benchmark entry.","example":"industry-average"},"label":{"type":"string","description":"Human-readable label for the benchmark entry.","example":"Industry Average"},"type":{"type":"string","enum":["threshold","benchmark","ai-readiness"],"description":"The source and context for the entry: benchmark, threshold, or ai-readiness score.","example":"benchmark"},"value":{"type":"number","description":"Numeric value associated with the benchmark entry.","example":5.15}},"required":["id","label","type","value"],"description":"Benchmark interpretation of the current code health score.","example":{"id":"industry-average","label":"Average Organizations","value":5.15,"type":"benchmark"}},"nextGoal":{"oneOf":[{"type":"object","properties":{"id":{"type":"string","description":"Unique identifier of the benchmark entry.","example":"industry-average"},"label":{"type":"string","description":"Human-readable label for the benchmark entry.","example":"Industry Average"},"type":{"type":"string","enum":["threshold","benchmark","ai-readiness"],"description":"The source and context for the entry: benchmark, threshold, or ai-readiness score.","example":"benchmark"},"value":{"type":"number","description":"Numeric value associated with the benchmark entry.","example":5.15}},"required":["id","label","type","value"]},{"type":"null"}],"description":"Next benchmark threshold to reach. Absent when the score is already at the top.","example":{"id":"problematic-code","label":"Problematic","value":8.9,"type":"threshold"}}},"required":["interpretation","nextGoal"],"description":"Interpretation and next goal for average code health.","example":{"interpretation":{"id":"industry-average","label":"Average Organizations","value":5.15,"type":"benchmark"},"nextGoal":{"id":"problematic-code","label":"Problematic","value":8.9,"type":"threshold"}}},"hotspotCodeHealth":{"type":"object","properties":{"interpretation":{"type":"object","properties":{"id":{"type":"string","description":"Unique identifier of the benchmark entry.","example":"industry-average"},"label":{"type":"string","description":"Human-readable label for the benchmark entry.","example":"Industry Average"},"type":{"type":"string","enum":["threshold","benchmark","ai-readiness"],"description":"The source and context for the entry: benchmark, threshold, or ai-readiness score.","example":"benchmark"},"value":{"type":"number","description":"Numeric value associated with the benchmark entry.","example":5.15}},"required":["id","label","type","value"],"description":"Benchmark interpretation of the current code health score.","example":{"id":"industry-average","label":"Average Organizations","value":5.15,"type":"benchmark"}},"nextGoal":{"oneOf":[{"type":"object","properties":{"id":{"type":"string","description":"Unique identifier of the benchmark entry.","example":"industry-average"},"label":{"type":"string","description":"Human-readable label for the benchmark entry.","example":"Industry Average"},"type":{"type":"string","enum":["threshold","benchmark","ai-readiness"],"description":"The source and context for the entry: benchmark, threshold, or ai-readiness score.","example":"benchmark"},"value":{"type":"number","description":"Numeric value associated with the benchmark entry.","example":5.15}},"required":["id","label","type","value"]},{"type":"null"}],"description":"Next benchmark threshold to reach. Absent when the score is already at the top.","example":{"id":"problematic-code","label":"Problematic","value":8.9,"type":"threshold"}}},"required":["interpretation","nextGoal"],"description":"Interpretation and next goal for hotspot code health.","example":{"interpretation":{"id":"industry-average","label":"Average Organizations","value":5.15,"type":"benchmark"},"nextGoal":{"id":"problematic-code","label":"Problematic","value":8.9,"type":"threshold"}}}},"description":"AI readiness interpretation and next goal for the latest scores."},"peers":{"type":"object","properties":{"averageCodeHealth":{"type":"object","properties":{"rank":{"type":"integer","description":"Competition rank among the units of the same kind in the project, 1 being the highest score. Tied units share a rank.","example":3},"peerCount":{"type":"integer","description":"Number of units of the same kind with a score, this unit included.","example":12},"median":{"type":"number","description":"Median score across those units.","example":7.1}},"required":["rank","peerCount","median"],"description":"Rank of the average code health. Absent when the unit has no score."},"hotspotCodeHealth":{"type":"object","properties":{"rank":{"type":"integer","description":"Competition rank among the units of the same kind in the project, 1 being the highest score. Tied units share a rank.","example":3},"peerCount":{"type":"integer","description":"Number of units of the same kind with a score, this unit included.","example":12},"median":{"type":"number","description":"Median score across those units.","example":7.1}},"required":["rank","peerCount","median"],"description":"Rank of the hotspot code health. Absent when the unit has no score."}},"description":"Rank of the unit among the units of the same kind in the project."},"files":{"type":"object","properties":{"totalFiles":{"type":"integer","description":"Total number of files in the inventory.","example":3},"hotspotCount":{"type":"integer","description":"Number of files classified as hotspots.","example":2},"upliftTargetCount":{"type":"integer","description":"Number of files classified as uplift targets.","example":1},"healthyHotspotCount":{"type":"integer","description":"Number of hotspots with healthy code health.","example":1},"offboardingRiskCount":{"type":"integer","description":"Number of files that are off-boarding risks. Absent in results generated before this field was introduced.","example":1}},"required":["totalFiles","hotspotCount","upliftTargetCount","healthyHotspotCount"],"description":"Aggregate counts across the files the unit owns: a team owns the files it is the main team of, a component the files mapped to it."}},"required":["projectId","asOf","comparisonPeriod","type","analyticalUnitId","name","averageCodeHealth","hotspotCodeHealth","peers","files"]},{"type":"object","properties":{"status":{"type":"string","enum":["pending_reanalysis"],"description":"Reported when the latest analysis has no packaged results for the unit yet.","example":"pending_reanalysis"},"message":{"type":"string","description":"Human-readable explanation for the returned status.","example":"Payments Team has no packaged results yet. They are available after the next analysis."}},"required":["status","message"]}]},"UnitCodeHealthTrendResult":{"anyOf":[{"$ref":"#/components/schemas/CodeHealthTrend"},{"type":"object","properties":{"status":{"type":"string","enum":["pending_reanalysis"],"description":"Reported when the latest analysis has no packaged results for the unit yet.","example":"pending_reanalysis"},"message":{"type":"string","description":"Human-readable explanation for the returned status.","example":"Payments Team has no packaged results yet. They are available after the next analysis."}},"required":["status","message"]}]},"UnitFileInventoryResult":{"anyOf":[{"$ref":"#/components/schemas/HotspotFileInventory"},{"type":"object","properties":{"status":{"type":"string","enum":["pending_reanalysis"],"description":"Reported when the latest analysis has no packaged results for the unit yet.","example":"pending_reanalysis"},"message":{"type":"string","description":"Human-readable explanation for the returned status.","example":"Payments Team has no packaged results yet. They are available after the next analysis."}},"required":["status","message"]}]}}}}