Skip to main content
GET
/
api
/
v1
/
repos
List Repositories
curl --request GET \
  --url https://api.example.com/api/v1/repos
{
  "repositories": [
    {
      "id": 123,
      "name": "<string>",
      "full_name": "<string>",
      "description": {},
      "private": true,
      "html_url": "<string>",
      "updated_at": "<string>",
      "is_connected": true,
      "installation_id": {}
    }
  ]
}

Overview

This endpoint fetches all GitHub repositories the user has access to and annotates them with their connection status to Nectr AI. The response includes repositories where the user is an owner, collaborator, or organization member.

Authentication

Requires a valid JWT token in the Authorization header.
Authorization: Bearer <token>

Request

curl -X GET "https://api.nectr.ai/api/v1/repos" \
  -H "Authorization: Bearer YOUR_JWT_TOKEN"

Response

Returns an array of repository objects with connection metadata.
repositories
array
Array of repository objects
id
integer
GitHub repository ID
name
string
Repository name (without owner)
full_name
string
Full repository name in owner/repo format
description
string | null
Repository description from GitHub
private
boolean
Whether the repository is private
html_url
string
GitHub URL to the repository
updated_at
string
ISO 8601 timestamp of last repository update
is_connected
boolean
Whether this repository is connected to Nectr AI
installation_id
integer | null
Database ID of the installation record if connected, otherwise null

Example Response

[
  {
    "id": 123456789,
    "name": "my-backend",
    "full_name": "acme/my-backend",
    "description": "Production API backend",
    "private": true,
    "html_url": "https://github.com/acme/my-backend",
    "updated_at": "2026-03-10T14:32:10Z",
    "is_connected": true,
    "installation_id": 42
  },
  {
    "id": 987654321,
    "name": "frontend-app",
    "full_name": "acme/frontend-app",
    "description": null,
    "private": false,
    "html_url": "https://github.com/acme/frontend-app",
    "updated_at": "2026-03-08T09:15:22Z",
    "is_connected": false,
    "installation_id": null
  }
]

Error Responses

401 Unauthorized
JWT token is invalid, expired, or missing
{
  "detail": "Unauthorized"
}
401 Session Expired
GitHub OAuth token cannot be decrypted (SECRET_KEY changed)
{
  "detail": "Session expired — please log out and sign in again to reconnect your GitHub account."
}
502 Bad Gateway
Failed to fetch repositories from GitHub API
{
  "detail": "Failed to fetch repositories from GitHub"
}

Implementation Details

GitHub API Pagination

The endpoint automatically handles GitHub API pagination, fetching up to 100 repositories per page until all accessible repositories are retrieved.

Repository Filtering

Repositories are fetched with the following GitHub API parameters:
  • affiliation: owner,collaborator,organization_member
  • sort: updated (most recently updated first)
  • per_page: 100

Connection Status

The is_connected field is determined by checking for an active Installation record in the database where:
  • user_id matches the current user
  • repo_full_name matches the repository
  • is_active is true

Build docs developers (and LLMs) love