Skip to content

Repositories API

The Repositories API allows you to manage indexed repositories.

Get all indexed repositories.

GET /api/v1/repos
ParameterTypeDescription
connection_idintegerFilter by connection ID
searchstringSearch repositories by name (partial match)
statusstringFilter by status (indexed, pending, etc.)
limitintegerResults per page (default: 15, max: 500)
offsetintegerPagination offset
{
"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 a specific repository by ID.

GET /api/v1/repos/by-id/{id}
ParameterTypeDescription
idintegerRepository ID
{
"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 a new repository for indexing.

POST /api/v1/repos
{
"connection_id": 1,
"name": "myorg/api",
"clone_url": "https://github.com/myorg/api.git",
"default_branch": "main",
"branches": ["main", "develop"]
}

Returns the created repository with status 201 Created.

Trigger a re-index for a repository.

POST /api/v1/repos/by-id/{id}/sync
{
"status": "queued",
"job_id": "abc123",
"message": "Sync job queued"
}

If a sync is already in progress:

{
"status": "already_syncing",
"message": "Repository sync already in progress"
}
## Delete Repository
Remove a repository from the index.
```http
DELETE /api/v1/repos/by-id/{id}

Returns 204 No Content on success.

Exclude a repository from sync and indexing (soft delete).

POST /api/v1/repos/by-id/{id}/exclude
{
"message": "Repository excluded from sync and indexing",
"id": 1
}

Include a previously excluded repository.

POST /api/v1/repos/by-id/{id}/include
{
"message": "Repository included - will be indexed on next sync",
"id": 1
}

Set a custom polling interval for a repository.

PUT /api/v1/repos/by-id/{id}/poll-interval
{
"interval_seconds": 3600
}

Use 0 to reset to the default interval.

{
"status": "updated",
"repo_id": 1,
"interval_seconds": 3600
}

Check if repos are in read-only mode.

GET /api/v1/repos/status
{
"readonly": false
}
Terminal window
# List repositories
curl "http://localhost:8080/api/v1/repos"
# Search repositories
curl "http://localhost:8080/api/v1/repos?search=myorg"
# Filter by connection
curl "http://localhost:8080/api/v1/repos?connection_id=1"
# Filter by status
curl "http://localhost:8080/api/v1/repos?status=indexed"
# Pagination
curl "http://localhost:8080/api/v1/repos?limit=20&offset=0"
# Get specific repo
curl "http://localhost:8080/api/v1/repos/by-id/1"
# Trigger sync
curl -X POST "http://localhost:8080/api/v1/repos/by-id/1/sync"
# Exclude repo
curl -X POST "http://localhost:8080/api/v1/repos/by-id/1/exclude"
# Include repo
curl -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 repo
curl -X DELETE "http://localhost:8080/api/v1/repos/by-id/1"
StatusDescription
pendingWaiting to be indexed
indexingBuilding search index
indexedReady for search
errorIndexing failed