Repositories API
The Repositories API allows you to manage indexed repositories.
List Repositories
Section titled “List Repositories”Get all indexed repositories.
GET /api/v1/reposQuery Parameters
Section titled “Query Parameters”| Parameter | Type | Description |
|---|---|---|
connection_id | integer | Filter by connection ID |
search | string | Search repositories by name (partial match) |
status | string | Filter by status (indexed, pending, etc.) |
limit | integer | Results per page (default: 15, max: 500) |
offset | integer | Pagination offset |
Response
Section titled “Response”{ "repos": [ { "id": 1, "name": "myorg/api", "clone_url": "https://github.com/myorg/api.git", "branches": ["main", "develop"], "status": "indexed", "last_indexed": "2024-01-15T10:30:00Z", "excluded": false } ], "total_count": 45, "limit": 15, "offset": 0, "has_more": true}Get Repository
Section titled “Get Repository”Get a specific repository by ID.
GET /api/v1/repos/by-id/{id}Parameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
id | integer | Repository ID |
Response
Section titled “Response”{ "id": 1, "name": "myorg/api", "clone_url": "https://github.com/myorg/api.git", "branches": ["main", "develop"], "status": "indexed", "last_indexed": "2024-01-15T10:30:00Z", "excluded": false}Add Repository
Section titled “Add Repository”Add a new repository for indexing.
POST /api/v1/reposRequest Body
Section titled “Request Body”{ "connection_id": 1, "name": "myorg/api", "clone_url": "https://github.com/myorg/api.git", "default_branch": "main", "branches": ["main", "develop"]}Response
Section titled “Response”Returns the created repository with status 201 Created.
Sync Repository
Section titled “Sync Repository”Trigger a re-index for a repository.
POST /api/v1/repos/by-id/{id}/syncResponse
Section titled “Response”{ "status": "queued", "job_id": "abc123", "message": "Sync job queued"}Conflict Response (409)
Section titled “Conflict Response (409)”If a sync is already in progress:
{ "status": "already_syncing", "message": "Repository sync already in progress"}## Delete Repository
Remove a repository from the index.
```httpDELETE /api/v1/repos/by-id/{id}Response
Section titled “Response”Returns 204 No Content on success.
Exclude Repository
Section titled “Exclude Repository”Exclude a repository from sync and indexing (soft delete).
POST /api/v1/repos/by-id/{id}/excludeResponse
Section titled “Response”{ "message": "Repository excluded from sync and indexing", "id": 1}Include Repository
Section titled “Include Repository”Include a previously excluded repository.
POST /api/v1/repos/by-id/{id}/includeResponse
Section titled “Response”{ "message": "Repository included - will be indexed on next sync", "id": 1}Set Poll Interval
Section titled “Set Poll Interval”Set a custom polling interval for a repository.
PUT /api/v1/repos/by-id/{id}/poll-intervalRequest Body
Section titled “Request Body”{ "interval_seconds": 3600}Use 0 to reset to the default interval.
Response
Section titled “Response”{ "status": "updated", "repo_id": 1, "interval_seconds": 3600}Repository Status Endpoint
Section titled “Repository Status Endpoint”Check if repos are in read-only mode.
GET /api/v1/repos/statusResponse
Section titled “Response”{ "readonly": false}Examples
Section titled “Examples”# List repositoriescurl "http://localhost:8080/api/v1/repos"
# Search repositoriescurl "http://localhost:8080/api/v1/repos?search=myorg"
# Filter by connectioncurl "http://localhost:8080/api/v1/repos?connection_id=1"
# Filter by statuscurl "http://localhost:8080/api/v1/repos?status=indexed"
# Paginationcurl "http://localhost:8080/api/v1/repos?limit=20&offset=0"
# Get specific repocurl "http://localhost:8080/api/v1/repos/by-id/1"
# Trigger synccurl -X POST "http://localhost:8080/api/v1/repos/by-id/1/sync"
# Exclude repocurl -X POST "http://localhost:8080/api/v1/repos/by-id/1/exclude"
# Include repocurl -X POST "http://localhost:8080/api/v1/repos/by-id/1/include"
# Set poll interval (1 hour)curl -X PUT "http://localhost:8080/api/v1/repos/by-id/1/poll-interval" \ -H "Content-Type: application/json" \ -d '{"interval_seconds": 3600}'
# Delete repocurl -X DELETE "http://localhost:8080/api/v1/repos/by-id/1"const API = 'http://localhost:8080/api/v1';
// List reposconst repos = await fetch(`${API}/repos`).then(r => r.json());
// Get specific repoconst repo = await fetch(`${API}/repos/by-id/1`).then(r => r.json());
// Trigger syncawait fetch(`${API}/repos/by-id/1/sync`, { method: 'POST' });
// Exclude repoawait fetch(`${API}/repos/by-id/1/exclude`, { method: 'POST' });
// Set poll intervalawait fetch(`${API}/repos/by-id/1/poll-interval`, { method: 'PUT', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ interval_seconds: 3600 })});import requests
API = 'http://localhost:8080/api/v1'
# List reposrepos = requests.get(f'{API}/repos').json()
# Get specific reporepo = requests.get(f'{API}/repos/by-id/1').json()
# Trigger syncrequests.post(f'{API}/repos/by-id/1/sync')
# Exclude reporequests.post(f'{API}/repos/by-id/1/exclude')
# Set poll intervalrequests.put(f'{API}/repos/by-id/1/poll-interval', json={'interval_seconds': 3600})Status Values
Section titled “Status Values”| Status | Description |
|---|---|
pending | Waiting to be indexed |
indexing | Building search index |
indexed | Ready for search |
error | Indexing failed |
Next Steps
Section titled “Next Steps”- Connections API - Connection management
- Jobs API - Job monitoring