Skip to main content
GET
/
repositories
List repositories
curl --request GET \
  --url https://app.codethreat.com/api/v1/repositories \
  --header 'X-API-Key: <api-key>'
"<any>"

Repositories API

Manage repositories programmatically via API.

List Repositories

GET /v1/repositories
Response:
{
  "repositories": [
    {
      "repository_id": "repo_123",
      "name": "my-app",
      "vcs_provider": "github",
      "default_branch": "main",
      "last_scan_at": "2024-03-15T14:35:42Z",
      "security_score": 85
    }
  ],
  "pagination": {
    "page": 1,
    "total": 15
  }
}

Get Repository

GET /v1/repositories/:repository_id
Response:
{
  "repository_id": "repo_123",
  "name": "my-app",
  "vcs_provider": "github",
  "vcs_url": "https://github.com/org/my-app",
  "default_branch": "main",
  "security_score": 85,
  "total_violations": 27,
  "violations_by_severity": {
    "critical": 2,
    "high": 5,
    "medium": 12,
    "low": 8
  },
  "last_scan_at": "2024-03-15T14:35:42Z",
  "created_at": "2024-01-10T09:00:00Z"
}

Update Repository Settings

PATCH /v1/repositories/:repository_id
Request:
{
  "auto_scan_on_push": true,
  "auto_scan_on_pr": true
}

What’s Next?

Authorizations

X-API-Key
string
header
required

Query Parameters

page
integer
default:1
Required range: x >= 1
limit
integer
default:20
Required range: 1 <= x <= 100
provider
enum<string>
Available options:
github,
gitlab,
bitbucket,
azure_devops
status
enum<string>
Available options:
active,
inactive,
archived
sortBy
enum<string>
default:updatedAt
Available options:
name,
createdAt,
updatedAt,
lastScanAt
sortOrder
enum<string>
default:desc
Available options:
asc,
desc

Response

200 - application/json
success
boolean
data
any
pagination
object
meta
object