---
metadata:
  - name: generator
    content: Diplodoc Platform v5.71.0
alternate:
  - https://sourcecraft.dev/portal/docs/en/sec-api-ref/Organization-Defect-Stats-Rest-Api/v1organizationsorgIddefect-groupsstatsby-repository-get.md?version=sourcecraft.dev
  - https://sourcecraft.dev/portal/docs/ru/sec-api-ref/Organization-Defect-Stats-Rest-Api/v1organizationsorgIddefect-groupsstatsby-repository-get.md?version=sourcecraft.dev
  - https://sourcecraft.dev/portal/docs/ru/sec-api-ref/Organization-Defect-Stats-Rest-Api/v1organizationsorgIddefect-groupsstatsby-repository-get.md?version=sourcecraft.dev
  - href: https://sourcecraft.dev/portal/docs/ru/sec-api-ref/Organization-Defect-Stats-Rest-Api/v1organizationsorgIddefect-groupsstatsby-repository-get.md?version=sourcecraft.dev
    type: text/markdown
    title: Markdown version
  - href: https://sourcecraft.dev/portal/docs/ru/llms.txt?revision=de8783063d4606471485fa652148cd48b46abee3&version=sourcecraft.dev
    rel: describedby
---
> **Documentation capabilities:** Search, read sources, and browse this documentation: [agent guide](https://sourcecraft.dev/portal/docs/docs-api/agent/overview?project=dev-sourcecraft&lang=ru&version=sourcecraft.dev).

> **Documentation Index:** Fetch the complete configuration index at https://sourcecraft.dev/portal/docs/ru/llms.txt?revision=de8783063d4606471485fa652148cd48b46abee3&version=sourcecraft.dev

<div class="openapi">

# Rank readable repositories with defects and return their per-engine counts

<!-- markdownlint-disable-file -->

pageSize and totalSize count repositories. Each page includes all their matching engine rows.

## Request

<div class="openapi__requests">

<div class="openapi__request__wrapper" style="--method: var(--dc-openapi-methods-get);margin-bottom: 12px">

<div class="openapi__request">

GET {.openapi__method}
```text translate=no
https://appsec.sourcecraft.tech/v1/organizations/{orgId}/defect-groups/stats/by-repository
```

</div>

</div>

</div>

### Path parameters

#|
|| **Name** | **Description** ||
||

_orgId_{.json-schema-reset .json-schema-property .json-schema-required}
{.table-cell}|
**Type**: string

_Pattern:_{.json-schema-reset .json-schema-assertion} `\S`

_Example:_{.json-schema-reset .json-schema-example} ``
{.table-cell}
||
|#{.json-schema-properties}

### Query parameters

#|
|| **Name** | **Description** ||
||

_engine_{.json-schema-reset .json-schema-property .json-schema-required}
{.table-cell}|
**Type**: string

Exact engine name. Omit to include all engines.

_Default:_{.json-schema-reset .json-schema-value} ``

_Example:_{.json-schema-reset .json-schema-example} `Trivy`
{.table-cell}
||
||

_pageSize_{.json-schema-reset .json-schema-property .json-schema-required}
{.table-cell}|
**Type**: integer

Page size, from 1 to 250. Default: 50.

_Default:_{.json-schema-reset .json-schema-value} `50`

_Min value:_{.json-schema-reset .json-schema-assertion} `1`

_Max value:_{.json-schema-reset .json-schema-assertion} `250`
{.table-cell}
||
||

_pageToken_{.json-schema-reset .json-schema-property .json-schema-required}
{.table-cell}|
**Type**: string

Omit for the first page. Use nextPageToken from the response for subsequent pages, keeping all other parameters unchanged. An empty nextPageToken means the last page.

_Default:_{.json-schema-reset .json-schema-value} ``

_Example:_{.json-schema-reset .json-schema-example} ``
{.table-cell}
||
||

_sortBy_{.json-schema-reset .json-schema-property .json-schema-required}
{.table-cell}|
**Type**: string

important (HIGH plus CRITICAL), total (all groups), or opened (OPEN groups)

_Default:_{.json-schema-reset .json-schema-value} `important`

_Example:_{.json-schema-reset .json-schema-example} ``
{.table-cell}
||
||

_sortOrder_{.json-schema-reset .json-schema-property .json-schema-required}
{.table-cell}|
**Type**: string

ASC or DESC (default). Repository ID breaks ties.

_Default:_{.json-schema-reset .json-schema-value} `DESC`

_Example:_{.json-schema-reset .json-schema-example} ``
{.table-cell}
||
||

_type_{.json-schema-reset .json-schema-property .json-schema-required}
{.table-cell}|
**Type**: string

Engine type, e.g. SCA. Omitted, blank or UNSPECIFIED includes all types.

_Default:_{.json-schema-reset .json-schema-value} ``

_Example:_{.json-schema-reset .json-schema-example} ``
{.table-cell}
||
|#{.json-schema-properties}

## Responses

<div class="openapi__response__code__200">

## 200 OK

OK

<div class="openapi-entity">

### Body

{% cut "application/json" %}

```json translate=no
{
  "data": [
    {
      "gitRepo": "example",
      "engineType": "example",
      "engineName": "example",
      "lastScanTime": 0,
      "severities": {},
      "statuses": {}
    }
  ],
  "nextPageToken": "example",
  "totalSize": 0,
  "listRevision": "example"
}
```

{% endcut %}

#|
|| **Name** | **Description** ||
||

_data_{.json-schema-reset .json-schema-property .json-schema-required}
{.table-cell}|
**Type**: [RepositoryDefectStats](#entity-RepositoryDefectStats)[]

{% cut "**Example**" %}{.json-schema-example}

```json translate=no
[
  {
    "gitRepo": "example",
    "engineType": "example",
    "engineName": "example",
    "lastScanTime": 0,
    "severities": {},
    "statuses": {}
  }
]
```

{% endcut %}
{.table-cell}
||
||

_nextPageToken_{.json-schema-reset .json-schema-property .json-schema-required}
{.table-cell}|
**Type**: string

_Example:_{.json-schema-reset .json-schema-example} `example`
{.table-cell}
||
||

_totalSize_{.json-schema-reset .json-schema-property .json-schema-required}
{.table-cell}|
**Type**: integer
{.table-cell}
||
||

_listRevision_{.json-schema-reset .json-schema-property}
{.table-cell}|
**Type**: string &#124; null

_Example:_{.json-schema-reset .json-schema-example} `example`
{.table-cell}
||
|#{.json-schema-properties}

</div>

<div class="openapi-entity">

### RepositoryDefectStats {#entity-RepositoryDefectStats}

#|
|| **Name** | **Description** ||
||

_engineName_{.json-schema-reset .json-schema-property .json-schema-required}
{.table-cell}|
**Type**: string

_Example:_{.json-schema-reset .json-schema-example} `example`
{.table-cell}
||
||

_engineType_{.json-schema-reset .json-schema-property .json-schema-required}
{.table-cell}|
**Type**: string

_Example:_{.json-schema-reset .json-schema-example} `example`
{.table-cell}
||
||

_gitRepo_{.json-schema-reset .json-schema-property .json-schema-required}
{.table-cell}|
**Type**: string

_Example:_{.json-schema-reset .json-schema-example} `example`
{.table-cell}
||
||

_lastScanTime_{.json-schema-reset .json-schema-property .json-schema-required}
{.table-cell}|
**Type**: integer
{.table-cell}
||
||

_severities_{.json-schema-reset .json-schema-property .json-schema-required}
{.table-cell}|
{% cut "**Type**: object" %}

#|
||

_[additional]_{.json-schema-reset .json-schema-additional-property}
{.table-cell}|
**Type**: integer
{.table-cell}
||
|#{.json-schema-properties}

{% endcut %}

{% cut "**Example**" %}{.json-schema-example}

```json translate=no
{}
```

{% endcut %}
{.table-cell}
||
||

_statuses_{.json-schema-reset .json-schema-property .json-schema-required}
{.table-cell}|
{% cut "**Type**: object" %}

#|
||

_[additional]_{.json-schema-reset .json-schema-additional-property}
{.table-cell}|
**Type**: integer
{.table-cell}
||
|#{.json-schema-properties}

{% endcut %}

{% cut "**Example**" %}{.json-schema-example}

```json translate=no
{}
```

{% endcut %}
{.table-cell}
||
|#{.json-schema-properties}

{% cut "**Example**" %}{.json-schema-example}

```json translate=no
{
  "gitRepo": "example",
  "engineType": "example",
  "engineName": "example",
  "lastScanTime": 0,
  "severities": {},
  "statuses": {}
}
```

{% endcut %}

</div>

</div>

</div>

[*Deprecated]: No longer supported, please use an alternative and newer version.