---
title: "Get a repository by ID"
method: GET
path: "/projects/{projectId}/repositories/{repositoryId}"
tags: ["Git repositories"]
---

# Get a repository by ID

`GET /projects/{projectId}/repositories/{repositoryId}`

## Request

- Base URL: `https://app.ketryx.com/api/v1`
- URL: `https://app.ketryx.com/api/v1/projects/{projectId}/repositories/{repositoryId}`
- Auth: HTTP bearer
- TypeScript: <https://skmtc.dev/ketryx/apis/ketryx-api/docs/projects/:projectId/repositories/:repositoryId/get.ts> (a function with typed inputs; its response is checked against the schema)

## Path parameters

- `projectId` string, required
- `repositoryId` string, required

## Query parameters

- `version` string

## Response `200`

Successful response

- object
  - `id` string, required: Ketryx ID of the repository
  - `createdAt` string, date-time, required: Repository creation date and time
  - `updatedAt` string, date-time, nullable, required: Repository last update date and time, or null if never updated
  - `url` string, required: URL of the repository
  - `mainBranch` string, nullable, required: Name of the main branch, or null if not set
  - `releaseRefPattern` string, nullable, required: Pattern for release references, or null if not set
  - `analyzedCommitSha` string, nullable, required: SHA of the last analyzed commit, or null if not analyzed
  - `dependencies` object[], required
    - `bom-ref` string: Unique SBOM reference for this component
    - `name` string, required: Component name
    - `group` string: Component group or namespace
    - `copyright` string: Component copyright statement
    - `description` string: Component description
    - `type` 'application' | 'framework' | 'library' | 'container' | 'platform' | 'operating-system' | 'device' | 'device-driver' | 'firmware' | 'file' | 'machine-learning-model' | 'data' | 'cryptographic-asset', required: Component type (Library, Application, Framework, etc.)
    - `version` string: Component version
    - `purl` string: Component Package URL
    - `licenses` union[], required: Array of component licenses
      - union
        - object
          - `license` object, required: License object
            - `name` string: License name
            - `id` string: License SPDX identifier
        - object
          - `expression` string, required: SPDX license expression
    - `supplier` object: Component supplier
      - `name` string: Supplier name
    - `author` string: Component author
    - `publisher` string: Component publisher
    - `externalReferences` object[]: List of external references
      - `type` string, required: Reference type
      - `url` string, required: Reference URL
      - `comment` string: Reference comment
    - `hashes` object[], required: Component checksums
      - `alg` string, required: Hash algorithm
      - `content` string, required: Hash content
  - `vulnerabilities` object[], required
    - `id` string: External vulnerability identifier (e.g. CVE-YYYY-NNNN)
    - `bom-ref` string: Internal SBOM reference for this vulnerability entry
    - `source` object: Source of the advisory (e.g. "ghsa" if GitHub)
      - `name` string
      - `url` string
    - `ratings` object[]: CVSS ratings array
      - `severity` string
      - `method` string
      - `score` number
      - `vector` string
      - `justification` string
    - `description` string: Short summary or title of the vulnerability
    - `detail` string: Full plaintext description of the vulnerability
    - `advisories` object[]: URLs to advisories or references
      - `url` string, required
    - `created` string: Date the vulnerability was first reported (ISO 8601)
    - `published` string: Date the vulnerability was published (ISO 8601)
    - `affects` object[]: List of affected components with versions
      - `ref` string, required: Component bom-ref
      - `versions` object[]

## Other responses

- `400`: Invalid input data
- `401`: Authorization not provided
- `403`: Insufficient access
- `404`: Not found
- `500`: Internal server error

---

[API](https://skmtc.dev/ketryx/apis/ketryx-api.md) - [All operations](https://skmtc.dev/ketryx/apis/ketryx-api/llms.txt) - [OpenAPI document](https://skmtc.dev/ketryx/apis/ketryx-api/revisions/a2a484dc35ca?raw)
