---
title: "Create a snapshot of dependencies for a repository"
method: POST
path: "/repos/{owner}/{repo}/dependency-graph/snapshots"
tags: ["dependency-graph"]
---

# Create a snapshot of dependencies for a repository

`POST /repos/{owner}/{repo}/dependency-graph/snapshots`

Create a new snapshot of a repository's dependencies.

The authenticated user must have access to the repository.

OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint.

## Path parameters

- `owner` string, required
- `repo` string, required

## Request body

- Snapshot — Create a new snapshot of a repository's dependencies.
  - `version` integer, required — The version of the repository snapshot submission.
  - `job` object, required
    - `id` string, required — The external ID of the job.
    - `correlator` string, required — Correlator provides a key that is used to group snapshots submitted over time. Only the "latest" submitted snapshot for a given combination of `job.correlator` and `detector.name` will be considered when calculating a repository's current dependencies. Correlator should be as unique as it takes to distinguish all detection runs for a given "wave" of CI workflow you run. If you're using GitHub Actions, a good default value for this could be the environment variables GITHUB_WORKFLOW and GITHUB_JOB concatenated together. If you're using a build matrix, then you'll also need to add additional key(s) to distinguish between each submission inside a matrix variation.
    - `html_url` string — The url for the job.
  - `sha` string, required — The commit SHA associated with this dependency snapshot. Maximum length: 40 characters.
  - `ref` string, required — The repository branch that triggered this snapshot.
  - `detector` object, required — A description of the detector used.
    - `name` string, required — The name of the detector used.
    - `version` string, required — The version of the detector used.
    - `url` string, required — The url of the detector used.
  - `metadata` Metadata — User-defined metadata to store domain-specific information limited to 8 keys with scalar values.
  - `manifests` object — A collection of package manifests, which are a collection of related dependencies declared in a file or representing a logical group of dependencies.
  - `scanned` string, date-time, required — The time at which the snapshot was scanned.

## Response `201`

Response

- object
  - `id` integer, required — ID of the created snapshot.
  - `created_at` string, required — The time at which the snapshot was created.
  - `result` string, required — Either "SUCCESS", "ACCEPTED", or "INVALID". "SUCCESS" indicates that the snapshot was successfully created and the repository's dependencies were updated. "ACCEPTED" indicates that the snapshot was successfully created, but the repository's dependencies were not updated. "INVALID" indicates that the snapshot was malformed.
  - `message` string, required — A message providing further details about the result, such as why the dependencies were not updated.

---

[API](https://skmtc.net/github/apis/rest-api.md) · [All operations](https://skmtc.net/github/apis/rest-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/github/rest-api/versions/80850db290cd/schema)
