API Overview
Rephole provides a simple REST API for code ingestion and semantic search.
Base URL
http://localhost:3000
Endpoints Summary
| Method | Endpoint | Description |
|---|---|---|
GET | /health | Health check |
POST | /ingestions/repository | Ingest a repository |
GET | /jobs/job/:jobId | Get job status |
POST | /queries/search/:repoId | Semantic code search (full files) |
POST | /queries/search/:repoId/chunk | Search raw code chunks |
GET | /jobs/failed | List failed jobs |
POST | /jobs/retry/:jobId | Retry a failed job |
POST | /jobs/retry/all | Retry all failed jobs |
Authentication
Currently, Rephole does not require authentication. For production deployments, we recommend placing it behind a reverse proxy with authentication.
Request Format
All POST endpoints accept JSON:
curl -X POST http://localhost:3000/endpoint \
-H "Content-Type: application/json" \
-d '{"key": "value"}'
Response Format
All responses are JSON:
{
"status": "ok",
"data": { }
}
Error Responses
| Status Code | Description |
|---|---|
400 | Bad Request - Invalid parameters |
404 | Not Found - Resource doesn't exist |
500 | Internal Server Error |
Rate Limiting
No rate limiting is enforced by default. For production, configure rate limiting at the reverse proxy level.
Quick Examples
Health Check
curl http://localhost:3000/health
Ingest Repository
curl -X POST http://localhost:3000/ingestions/repository \
-H "Content-Type: application/json" \
-d '{
"repoUrl": "https://github.com/user/repo.git",
"meta": {"team": "backend"}
}'
Search Code
# Note: repoId is required in the URL path
curl -X POST http://localhost:3000/queries/search/repo \
-H "Content-Type: application/json" \
-d '{"prompt": "How does authentication work?", "k": 5}'