Skip to main content
GET
List Repositories

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.

Request

Response

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

Example Response

Error Responses

JWT token is invalid, expired, or missing
GitHub OAuth token cannot be decrypted (SECRET_KEY changed)
Failed to fetch repositories from GitHub API

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