Repositories API
List Repositories
Copy
GET /api/v1/repositories
Copy
{
"repositories": [
{
"id": "repo_abc123",
"name": "acme-api",
"url": "https://github.com/acme/api",
"branch": "main",
"status": "synced",
"last_synced_at": "2024-01-15T10:30:00Z",
"last_commit": "abc1234",
"files_indexed": 245,
"chunks_indexed": 1523
}
]
}
Connect Repository
Copy
POST /api/v1/repositories
Copy
{
"url": "https://github.com/acme/api",
"branch": "main",
"access_token": "ghp_xxx",
"include_patterns": ["app/**/*.rb", "lib/**/*.rb"],
"exclude_patterns": ["vendor/**"]
}
Get Repository
Copy
GET /api/v1/repositories/:id
Copy
{
"id": "repo_abc123",
"name": "acme-api",
"url": "https://github.com/acme/api",
"branch": "main",
"status": "synced",
"last_synced_at": "2024-01-15T10:30:00Z",
"last_commit": "abc1234",
"stats": {
"files_indexed": 245,
"chunks_indexed": 1523,
"wiki_pages": 47,
"diagrams": 12
},
"settings": {
"auto_sync": true,
"include_patterns": ["app/**/*.rb"],
"exclude_patterns": ["vendor/**"]
}
}
Update Repository
Copy
PUT /api/v1/repositories/:id
Copy
{
"branch": "develop",
"auto_sync": false,
"include_patterns": ["app/**/*.rb", "lib/**/*.rb", "spec/**/*.rb"]
}
Delete Repository
Copy
DELETE /api/v1/repositories/:id
Sync Repository
Copy
POST /api/v1/repositories/:id/sync
Copy
{
"sync_id": "sync_xyz789",
"status": "started",
"started_at": "2024-01-15T10:30:00Z"
}
Get Sync Status
Copy
GET /api/v1/repositories/:id/syncs/:sync_id
Copy
{
"sync_id": "sync_xyz789",
"status": "completed",
"started_at": "2024-01-15T10:30:00Z",
"completed_at": "2024-01-15T10:32:00Z",
"stats": {
"files_processed": 245,
"chunks_created": 1523,
"pages_generated": 47
}
}