Skip to content

Repositories

Access GitHub repositories available to the authenticated user. These are the raw repositories from GitHub — use Repository Configs to manage scan configurations.

Base path: /api/repositories

Authentication: Bearer token required on all routes

List Repositories

GET /api/repositories/

List all GitHub repositories available to the authenticated user (from linked GitHub accounts or GitHub App installations).

Response

json
{
  "success": true,
  "data": [
    {
      "id": 123456,
      "name": "my-terraform-repo",
      "full_name": "org/my-terraform-repo",
      "owner": {
        "login": "org"
      },
      "private": true,
      "default_branch": "main"
    }
  ]
}

Example

bash
curl -H "Authorization: Bearer TOKEN" \
  https://api.controlinfra.com/api/repositories/

Get Repository Branches

GET /api/repositories/:owner/:repo/branches

List branches for a specific GitHub repository.

Path Parameters

ParameterTypeDescription
ownerstringRepository owner (user or org)
repostringRepository name

Response

json
{
  "success": true,
  "data": [
    {
      "name": "main",
      "protected": true
    },
    {
      "name": "feature-branch",
      "protected": false
    }
  ]
}

Example

bash
curl -H "Authorization: Bearer TOKEN" \
  https://api.controlinfra.com/api/repositories/myorg/terraform-infra/branches