Skip to main content

API Overview

The Repotoire REST API provides programmatic access to all platform features, including repository analysis, findings management, and AI-powered fixes.

Base URL

EnvironmentURL
Productionhttps://api.repotoire.io
Local Developmenthttp://localhost:8000

Interactive Documentation

  • Swagger UI: /docs - Interactive API explorer
  • ReDoc: /redoc - Clean API reference
  • OpenAPI Spec: /openapi.json - Raw specification

Authentication

All API requests require authentication via one of two methods:

Bearer Token (Clerk JWT)

For web and mobile applications using Clerk authentication:

curl https://api.repotoire.io/api/v1/analysis/trigger \
  -H "Authorization: Bearer <your-clerk-jwt-token>" \
  -H "Content-Type: application/json" \
  -d '{"repository_id": "550e8400-e29b-41d4-a716-446655440000"}'

API Key

For CI/CD pipelines and server-to-server communication:

curl https://api.repotoire.io/api/v1/analysis/trigger \
  -H "X-API-Key: <your-api-key>" \
  -H "Content-Type: application/json" \
  -d '{"repository_id": "550e8400-e29b-41d4-a716-446655440000"}'

Generate API keys in Settings > API Keys in the web dashboard.

Rate Limits

TierAnalyses/HourAPI Calls/Min
Free260
Pro20300
EnterpriseUnlimited1000

Rate limit headers are included in all responses:

X-RateLimit-Limit: 300
X-RateLimit-Remaining: 299
X-RateLimit-Reset: 1705329600

Response Format

Success Response

{
  "id": "550e8400-e29b-41d4-a716-446655440000",
  "status": "completed",
  "health_score": 78,
  ...
}

Error Response

All errors follow a consistent format:

{
  "error": "not_found",
  "detail": "Repository not found",
  "error_code": "NOT_FOUND"
}

Common Error Codes

HTTP StatusError CodeDescription
400VALIDATION_ERRORInvalid request parameters
401UNAUTHORIZEDMissing or invalid authentication
403FORBIDDENInsufficient permissions
404NOT_FOUNDResource does not exist
409CONFLICTResource conflict (e.g., analysis in progress)
429RATE_LIMIT_EXCEEDEDToo many requests
500INTERNAL_ERRORUnexpected server error

API Endpoints

Analysis

MethodEndpointDescription
POST/api/v1/analysis/triggerTrigger repository analysis
GET/api/v1/analysis/{id}/statusGet analysis status
GET/api/v1/analysis/{id}/progressStream progress (SSE)
GET/api/v1/analysis/historyGet analysis history
GET/api/v1/analysis/concurrencyCheck concurrency limits

Findings

MethodEndpointDescription
GET/api/v1/findingsList findings (paginated)
GET/api/v1/findings/summaryGet severity summary
GET/api/v1/findings/by-detectorGroup by detector
GET/api/v1/findings/{id}Get finding details

Fixes

MethodEndpointDescription
GET/api/v1/fixesList fix proposals
GET/api/v1/fixes/{id}Get fix details
POST/api/v1/fixes/{id}/approveApprove a fix
POST/api/v1/fixes/{id}/rejectReject a fix
POST/api/v1/fixes/{id}/applyApply fix to codebase
POST/api/v1/fixes/{id}/previewPreview in sandbox

Code Search (RAG)

MethodEndpointDescription
POST/api/v1/code/searchSemantic code search
POST/api/v1/code/askAsk questions with AI
GET/api/v1/code/embeddings/statusCheck embedding coverage

Billing

MethodEndpointDescription
GET/api/v1/billing/subscriptionGet subscription details
POST/api/v1/billing/checkoutCreate checkout session
POST/api/v1/billing/portalAccess customer portal
GET/api/v1/billing/plansGet available plans

Webhooks

MethodEndpointDescription
GET/api/v1/customer-webhooksList webhooks
POST/api/v1/customer-webhooksCreate webhook
PATCH/api/v1/customer-webhooks/{id}Update webhook
DELETE/api/v1/customer-webhooks/{id}Delete webhook
POST/api/v1/customer-webhooks/{id}/testTest webhook

GitHub

MethodEndpointDescription
GET/api/v1/github/installationsList GitHub installations
GET/api/v1/github/installations/{id}/reposList repos for installation
POST/api/v1/github/installations/{id}/reposEnable/disable repos
PATCH/api/v1/github/repos/{id}/quality-gatesConfigure quality gates

SDKs & Tools

Python

import requests

api_key = "your-api-key"
base_url = "https://api.repotoire.io"

response = requests.post(
    f"{base_url}/api/v1/analysis/trigger",
    headers={"X-API-Key": api_key},
    json={"repository_id": "550e8400-e29b-41d4-a716-446655440000"}
)
print(response.json())

JavaScript

const response = await fetch('https://api.repotoire.io/api/v1/analysis/trigger', {
  method: 'POST',
  headers: {
    'X-API-Key': 'your-api-key',
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
    repository_id: '550e8400-e29b-41d4-a716-446655440000'
  })
});

const data = await response.json();
console.log(data);

curl

curl -X POST https://api.repotoire.io/api/v1/analysis/trigger \
  -H "X-API-Key: your-api-key" \
  -H "Content-Type: application/json" \
  -d '{"repository_id": "550e8400-e29b-41d4-a716-446655440000"}'