Get Git Repositories

Xray REST APIs

Products
JFrog Xray
Content Type
REST API

Description: Retrieve a list of all git repositories that have been scanned.

Note: This API endpoint allows you to fetch comprehensive information about git repositories based on the scans that have been performed. You can apply various filters to refine the results.

Since: Xray 3.122

Security: Requires a user with READ permissions.

Usage: GET /xray/api/v1/git/repositories

Produces: application/json

Query Parameters

Name

Type

Required/Optional

Description

page

integer

optional

Page number for pagination. Default: 1

limit

integer

optional

Number of results per page. Default: 50

order_by

string

optional

Sort field: Id, name, or last_scanned_date

direction

string

optional

Sort direction: asc or desc

Response Codes

Name

Description

200

OK

400

Bad request: invalid parameters

401

Unauthorized

403

Forbidden

500

Internal error

Response Body

Name

Type

Description

page

integer

Current page number

limit

integer

Items returned per page

total_count

integer

Total number of repositories available

repositories

array[repository]

Repositories returned

repository

Name

Type

Description

id

int

Unique identifier

url

string

Repository URL

name

string

Repository name

git_project

string

Owning project name

git_provider

string

GitHub, GitLab, Bitbucket, Azure, or unknown

last_scanned_date

string

ISO 8601 timestamp of the last scan (e.g. 2024-08-10T10:13:48Z)

last_scanned_commit

string

Hash of the last scanned commit

scanned_branches

array[string]

Branches that were scanned

Successful Response Example

{
  "page": 1,
  "limit": 10,
  "total_count": 1,
  "repositories": [
    {
      "id": 12,
      "url": "https://git.jfrog.info/projects/XSC/repos/xsc-service",
      "name": "xsc-service",
      "git_project": "XSC",
      "git_provider": "github",
      "last_scanned_date": "2024-08-10T10:13:48Z",
      "last_scanned_commit": "8ba779e5",
      "scanned_branches": [
        "main"
      ]
    }
  ]
}