# Конечные точки REST API для проверки зависимостей

Используйте REST API для взаимодействия с изменениями зависимостей.

## Сведения о проверке зависимостей

Rest API можно использовать для просмотра изменений зависимостей и влияния на безопасность этих изменений, прежде чем добавлять их в среду. Вы можете просматривать различия в зависимостях между двумя фиксациями репозитория, включая данные об уязвимостях в любых обновлениях версий с известными уязвимостями. Дополнительные сведения о проверке зависимостей см. в разделе [Анализ зависимостей](/ru/enterprise-server@3.22/code-security/concepts/supply-chain-security/dependency-review).

> \[!NOTE]
> Most endpoints use `Authorization: Bearer <YOUR-TOKEN>` and `Accept: application/vnd.github+json` headers, plus `X-GitHub-Api-Version: 2026-03-10`. Curl examples below omit these standard headers for brevity.

## Get a diff of the dependencies between commits

```
GET /repos/{owner}/{repo}/dependency-graph/compare/{basehead}
```

Gets the diff of the dependency changes between two commits of a repository, based on the changes to the dependency manifests made in those commits.

### Parameters

#### Headers

* **`accept`** (string)
  Setting to `application/vnd.github+json` is recommended.

#### Path and query parameters

* **`owner`** (string) (required)
  The account owner of the repository. The name is not case sensitive.

* **`repo`** (string) (required)
  The name of the repository without the .git extension. The name is not case sensitive.

* **`basehead`** (string) (required)
  The base and head Git revisions to compare. The Git revisions will be resolved to commit SHAs. Named revisions will be resolved to their corresponding HEAD commits, and an appropriate merge base will be determined. This parameter expects the format {base}...{head}.

* **`name`** (string)
  The full path, relative to the repository root, of the dependency manifest file.

### HTTP response status codes

* **200** - OK

* **400** - Bad Request

* **403** - Response for a private repository when GitHub Advanced Security is not enabled, or if used against a fork

* **404** - Resource not found

* **500** - Internal Error

* **503** - Service unavailable

### Code examples

#### Example

**Request:**

```curl
curl -L \
  -X GET \
  http(s)://HOSTNAME/api/v3/repos/OWNER/REPO/dependency-graph/compare/BASEHEAD
```

**Response schema (Status: 200):**

Array of objects:

* `change_type`: required, string, enum: `added`, `removed`
* `manifest`: required, string
* `ecosystem`: required, string
* `name`: required, string
* `version`: required, string
* `package_url`: required, string or null
* `license`: required, string or null
* `source_repository_url`: required, string or null
* `vulnerabilities`: required, array of objects:
  * `severity`: required, string
  * `advisory_ghsa_id`: required, string
  * `advisory_summary`: required, string
  * `advisory_url`: required, string
* `scope`: required, string, enum: `unknown`, `runtime`, `development`