{ "openapi": "3.0.0", "info": { "description": "Code understanding platform with hybrid search and LLM-powered enrichments", "title": "Kodit API", "contact": {}, "version": "1.0" }, "paths": { "/enrichments": { "get": { "security": [ { "APIKeyAuth": [] } ], "description": "List enrichments with optional filters", "tags": [ "enrichments" ], "summary": "List enrichments", "parameters": [ { "description": "Filter by enrichment type", "name": "enrichment_type", "in": "query", "schema": { "type": "string" } }, { "description": "Filter by enrichment subtype", "name": "enrichment_subtype", "in": "query", "schema": { "type": "string" } }, { "description": "Page number (default: 1)", "name": "page", "in": "query", "schema": { "type": "integer" } }, { "description": "Results per page (default: 20, max: 100)", "name": "page_size", "in": "query", "schema": { "type": "integer" } } ], "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/dto.EnrichmentJSONAPIListResponse" } } } }, "500": { "description": "Internal Server Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/middleware.JSONAPIErrorResponse" } } } } } } }, "/enrichments/{id}": { "get": { "security": [ { "APIKeyAuth": [] } ], "description": "Get an enrichment by ID", "tags": [ "enrichments" ], "summary": "Get enrichment", "parameters": [ { "description": "Enrichment ID", "name": "id", "in": "path", "required": true, "schema": { "type": "integer" } } ], "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/dto.EnrichmentJSONAPIResponse" } } } }, "404": { "description": "Not Found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/middleware.JSONAPIErrorResponse" } } } }, "500": { "description": "Internal Server Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/middleware.JSONAPIErrorResponse" } } } } } }, "delete": { "security": [ { "APIKeyAuth": [] } ], "description": "Delete an enrichment by ID", "tags": [ "enrichments" ], "summary": "Delete enrichment", "parameters": [ { "description": "Enrichment ID", "name": "id", "in": "path", "required": true, "schema": { "type": "integer" } } ], "responses": { "204": { "description": "No Content" }, "404": { "description": "Not Found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/middleware.JSONAPIErrorResponse" } } } }, "500": { "description": "Internal Server Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/middleware.JSONAPIErrorResponse" } } } } } }, "patch": { "security": [ { "APIKeyAuth": [] } ], "description": "Update an enrichment's content", "tags": [ "enrichments" ], "summary": "Update enrichment", "parameters": [ { "description": "Enrichment ID", "name": "id", "in": "path", "required": true, "schema": { "type": "integer" } } ], "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/dto.EnrichmentUpdateRequest" } } }, "description": "Update request", "required": true }, "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/dto.EnrichmentJSONAPIResponse" } } } }, "404": { "description": "Not Found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/middleware.JSONAPIErrorResponse" } } } }, "500": { "description": "Internal Server Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/middleware.JSONAPIErrorResponse" } } } } } } }, "/queue": { "get": { "security": [ { "APIKeyAuth": [] } ], "description": "List tasks in the queue", "tags": [ "queue" ], "summary": "List tasks", "parameters": [ { "description": "Page number (default: 1)", "name": "page", "in": "query", "schema": { "type": "integer" } }, { "description": "Results per page (default: 20, max: 100)", "name": "page_size", "in": "query", "schema": { "type": "integer" } }, { "description": "Filter by task type", "name": "task_type", "in": "query", "schema": { "type": "string" } } ], "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/dto.TaskListResponse" } } } }, "500": { "description": "Internal Server Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/middleware.JSONAPIErrorResponse" } } } } } } }, "/queue/{task_id}": { "get": { "security": [ { "APIKeyAuth": [] } ], "description": "Get a task by ID", "tags": [ "queue" ], "summary": "Get task", "parameters": [ { "description": "Task ID", "name": "task_id", "in": "path", "required": true, "schema": { "type": "integer" } } ], "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/dto.TaskResponse" } } } }, "404": { "description": "Not Found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/middleware.JSONAPIErrorResponse" } } } }, "500": { "description": "Internal Server Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/middleware.JSONAPIErrorResponse" } } } } } } }, "/repositories": { "get": { "security": [ { "APIKeyAuth": [] } ], "description": "Get all tracked Git repositories", "tags": [ "repositories" ], "summary": "List repositories", "parameters": [ { "description": "Page number (default: 1)", "name": "page", "in": "query", "schema": { "type": "integer" } }, { "description": "Results per page (default: 20, max: 100)", "name": "page_size", "in": "query", "schema": { "type": "integer" } } ], "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/dto.RepositoryListResponse" } } } }, "500": { "description": "Internal Server Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/middleware.JSONAPIErrorResponse" } } } } } }, "post": { "security": [ { "APIKeyAuth": [] } ], "description": "Add a new Git repository to track", "tags": [ "repositories" ], "summary": "Add repository", "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/dto.RepositoryCreateRequest" } } }, "description": "Repository request", "required": true }, "responses": { "200": { "description": "Repository already exists", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/dto.RepositoryResponse" } } } }, "201": { "description": "Repository created", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/dto.RepositoryResponse" } } } }, "400": { "description": "Bad Request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/middleware.JSONAPIErrorResponse" } } } }, "500": { "description": "Internal Server Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/middleware.JSONAPIErrorResponse" } } } } } } }, "/repositories/{id}": { "get": { "security": [ { "APIKeyAuth": [] } ], "description": "Get a repository by ID", "tags": [ "repositories" ], "summary": "Get repository", "parameters": [ { "description": "Repository ID", "name": "id", "in": "path", "required": true, "schema": { "type": "integer" } } ], "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/dto.RepositoryDetailsResponse" } } } }, "404": { "description": "Not Found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/middleware.JSONAPIErrorResponse" } } } }, "500": { "description": "Internal Server Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/middleware.JSONAPIErrorResponse" } } } } } }, "delete": { "security": [ { "APIKeyAuth": [] } ], "description": "Delete a repository by ID", "tags": [ "repositories" ], "summary": "Delete repository", "parameters": [ { "description": "Repository ID", "name": "id", "in": "path", "required": true, "schema": { "type": "integer" } } ], "responses": { "204": { "description": "No Content" }, "404": { "description": "Not Found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/middleware.JSONAPIErrorResponse" } } } }, "500": { "description": "Internal Server Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/middleware.JSONAPIErrorResponse" } } } } } } }, "/repositories/{id}/commits": { "get": { "security": [ { "APIKeyAuth": [] } ], "description": "List commits for a repository", "tags": [ "repositories" ], "summary": "List commits", "parameters": [ { "description": "Repository ID", "name": "id", "in": "path", "required": true, "schema": { "type": "integer" } }, { "description": "Page number (default: 1)", "name": "page", "in": "query", "schema": { "type": "integer" } }, { "description": "Results per page (default: 20, max: 100)", "name": "page_size", "in": "query", "schema": { "type": "integer" } } ], "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/dto.CommitJSONAPIListResponse" } } } }, "404": { "description": "Not Found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/middleware.JSONAPIErrorResponse" } } } }, "500": { "description": "Internal Server Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/middleware.JSONAPIErrorResponse" } } } } } } }, "/repositories/{id}/commits/{commit_sha}": { "get": { "security": [ { "APIKeyAuth": [] } ], "description": "Get a commit by SHA", "tags": [ "repositories" ], "summary": "Get commit", "parameters": [ { "description": "Repository ID", "name": "id", "in": "path", "required": true, "schema": { "type": "integer" } }, { "description": "Commit SHA", "name": "commit_sha", "in": "path", "required": true, "schema": { "type": "string" } } ], "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/dto.CommitJSONAPIResponse" } } } }, "404": { "description": "Not Found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/middleware.JSONAPIErrorResponse" } } } }, "500": { "description": "Internal Server Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/middleware.JSONAPIErrorResponse" } } } } } } }, "/repositories/{id}/commits/{commit_sha}/embeddings": { "get": { "security": [ { "APIKeyAuth": [] } ], "description": "This endpoint has been removed. Embeddings are an internal detail of snippets and enrichments.", "tags": [ "repositories" ], "summary": "List commit embeddings (deprecated)", "deprecated": true, "parameters": [ { "description": "Repository ID", "name": "id", "in": "path", "required": true, "schema": { "type": "integer" } }, { "description": "Commit SHA", "name": "commit_sha", "in": "path", "required": true, "schema": { "type": "string" } } ], "responses": { "410": { "description": "Gone", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/middleware.JSONAPIErrorResponse" } } } } } } }, "/repositories/{id}/commits/{commit_sha}/enrichments": { "get": { "security": [ { "APIKeyAuth": [] } ], "description": "List enrichments for a commit", "tags": [ "repositories" ], "summary": "List commit enrichments", "parameters": [ { "description": "Repository ID", "name": "id", "in": "path", "required": true, "schema": { "type": "integer" } }, { "description": "Commit SHA", "name": "commit_sha", "in": "path", "required": true, "schema": { "type": "string" } }, { "description": "Filter by enrichment type", "name": "enrichment_type", "in": "query", "schema": { "type": "string" } }, { "description": "Filter by enrichment subtype", "name": "enrichment_subtype", "in": "query", "schema": { "type": "string" } }, { "description": "Page number (default: 1)", "name": "page", "in": "query", "schema": { "type": "integer" } }, { "description": "Results per page (default: 20, max: 100)", "name": "page_size", "in": "query", "schema": { "type": "integer" } } ], "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/dto.EnrichmentJSONAPIListResponse" } } } }, "404": { "description": "Not Found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/middleware.JSONAPIErrorResponse" } } } }, "500": { "description": "Internal Server Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/middleware.JSONAPIErrorResponse" } } } } } }, "delete": { "security": [ { "APIKeyAuth": [] } ], "description": "Delete all enrichments for a commit", "tags": [ "repositories" ], "summary": "Delete commit enrichments", "parameters": [ { "description": "Repository ID", "name": "id", "in": "path", "required": true, "schema": { "type": "integer" } }, { "description": "Commit SHA", "name": "commit_sha", "in": "path", "required": true, "schema": { "type": "string" } } ], "responses": { "204": { "description": "No Content" }, "404": { "description": "Not Found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/middleware.JSONAPIErrorResponse" } } } }, "500": { "description": "Internal Server Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/middleware.JSONAPIErrorResponse" } } } } } } }, "/repositories/{id}/commits/{commit_sha}/enrichments/{enrichment_id}": { "get": { "security": [ { "APIKeyAuth": [] } ], "description": "Get an enrichment by ID within commit context", "tags": [ "repositories" ], "summary": "Get commit enrichment", "parameters": [ { "description": "Repository ID", "name": "id", "in": "path", "required": true, "schema": { "type": "integer" } }, { "description": "Commit SHA", "name": "commit_sha", "in": "path", "required": true, "schema": { "type": "string" } }, { "description": "Enrichment ID", "name": "enrichment_id", "in": "path", "required": true, "schema": { "type": "integer" } } ], "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/dto.EnrichmentJSONAPIResponse" } } } }, "404": { "description": "Not Found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/middleware.JSONAPIErrorResponse" } } } }, "500": { "description": "Internal Server Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/middleware.JSONAPIErrorResponse" } } } } } }, "delete": { "security": [ { "APIKeyAuth": [] } ], "description": "Delete a specific enrichment from a commit", "tags": [ "repositories" ], "summary": "Delete commit enrichment", "parameters": [ { "description": "Repository ID", "name": "id", "in": "path", "required": true, "schema": { "type": "integer" } }, { "description": "Commit SHA", "name": "commit_sha", "in": "path", "required": true, "schema": { "type": "string" } }, { "description": "Enrichment ID", "name": "enrichment_id", "in": "path", "required": true, "schema": { "type": "integer" } } ], "responses": { "204": { "description": "No Content" }, "404": { "description": "Not Found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/middleware.JSONAPIErrorResponse" } } } }, "500": { "description": "Internal Server Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/middleware.JSONAPIErrorResponse" } } } } } } }, "/repositories/{id}/commits/{commit_sha}/files": { "get": { "security": [ { "APIKeyAuth": [] } ], "description": "List files for a commit", "tags": [ "repositories" ], "summary": "List commit files", "parameters": [ { "description": "Repository ID", "name": "id", "in": "path", "required": true, "schema": { "type": "integer" } }, { "description": "Commit SHA", "name": "commit_sha", "in": "path", "required": true, "schema": { "type": "string" } }, { "description": "Page number (default: 1)", "name": "page", "in": "query", "schema": { "type": "integer" } }, { "description": "Results per page (default: 20, max: 100)", "name": "page_size", "in": "query", "schema": { "type": "integer" } } ], "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/dto.FileJSONAPIListResponse" } } } }, "404": { "description": "Not Found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/middleware.JSONAPIErrorResponse" } } } }, "500": { "description": "Internal Server Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/middleware.JSONAPIErrorResponse" } } } } } } }, "/repositories/{id}/commits/{commit_sha}/files/{blob_sha}": { "get": { "security": [ { "APIKeyAuth": [] } ], "description": "Get a file by blob SHA", "tags": [ "repositories" ], "summary": "Get commit file", "parameters": [ { "description": "Repository ID", "name": "id", "in": "path", "required": true, "schema": { "type": "integer" } }, { "description": "Commit SHA", "name": "commit_sha", "in": "path", "required": true, "schema": { "type": "string" } }, { "description": "Blob SHA", "name": "blob_sha", "in": "path", "required": true, "schema": { "type": "string" } } ], "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/dto.FileJSONAPIResponse" } } } }, "404": { "description": "Not Found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/middleware.JSONAPIErrorResponse" } } } }, "500": { "description": "Internal Server Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/middleware.JSONAPIErrorResponse" } } } } } } }, "/repositories/{id}/commits/{commit_sha}/rescan": { "post": { "security": [ { "APIKeyAuth": [] } ], "description": "Trigger a rescan of a specific commit", "tags": [ "repositories" ], "summary": "Rescan commit", "parameters": [ { "description": "Repository ID", "name": "id", "in": "path", "required": true, "schema": { "type": "integer" } }, { "description": "Commit SHA", "name": "commit_sha", "in": "path", "required": true, "schema": { "type": "string" } } ], "responses": { "202": { "description": "Accepted" }, "404": { "description": "Not Found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/middleware.JSONAPIErrorResponse" } } } }, "500": { "description": "Internal Server Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/middleware.JSONAPIErrorResponse" } } } } } } }, "/repositories/{id}/commits/{commit_sha}/snippets": { "get": { "security": [ { "APIKeyAuth": [] } ], "description": "List code snippets for a commit (backed by enrichments)", "tags": [ "repositories" ], "summary": "List commit snippets", "parameters": [ { "description": "Repository ID", "name": "id", "in": "path", "required": true, "schema": { "type": "integer" } }, { "description": "Commit SHA", "name": "commit_sha", "in": "path", "required": true, "schema": { "type": "string" } }, { "description": "Page number (default: 1)", "name": "page", "in": "query", "schema": { "type": "integer" } }, { "description": "Results per page (default: 20, max: 100)", "name": "page_size", "in": "query", "schema": { "type": "integer" } } ], "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/dto.SnippetListResponse" } } } }, "401": { "description": "Unauthorized", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/middleware.JSONAPIErrorResponse" } } } }, "404": { "description": "Not Found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/middleware.JSONAPIErrorResponse" } } } }, "500": { "description": "Internal Server Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/middleware.JSONAPIErrorResponse" } } } } } } }, "/repositories/{id}/enrichments": { "get": { "security": [ { "APIKeyAuth": [] } ], "description": "List recent enrichments across commits for a repository", "tags": [ "repositories" ], "summary": "List repository enrichments", "parameters": [ { "description": "Repository ID", "name": "id", "in": "path", "required": true, "schema": { "type": "integer" } }, { "description": "Filter by enrichment type", "name": "enrichment_type", "in": "query", "schema": { "type": "string" } }, { "description": "Max commits to check (default: 100)", "name": "max_commits_to_check", "in": "query", "schema": { "type": "integer" } }, { "description": "Page number (default: 1)", "name": "page", "in": "query", "schema": { "type": "integer" } }, { "description": "Results per page (default: 20, max: 100)", "name": "page_size", "in": "query", "schema": { "type": "integer" } } ], "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/dto.EnrichmentJSONAPIListResponse" } } } }, "404": { "description": "Not Found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/middleware.JSONAPIErrorResponse" } } } }, "500": { "description": "Internal Server Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/middleware.JSONAPIErrorResponse" } } } } } } }, "/repositories/{id}/status": { "get": { "security": [ { "APIKeyAuth": [] } ], "description": "Get indexing task status for a repository", "tags": [ "repositories" ], "summary": "Get repository status", "parameters": [ { "description": "Repository ID", "name": "id", "in": "path", "required": true, "schema": { "type": "integer" } } ], "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/dto.TaskStatusListResponse" } } } }, "404": { "description": "Not Found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/middleware.JSONAPIErrorResponse" } } } }, "500": { "description": "Internal Server Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/middleware.JSONAPIErrorResponse" } } } } } } }, "/repositories/{id}/status/summary": { "get": { "security": [ { "APIKeyAuth": [] } ], "description": "Get aggregated indexing status summary for a repository", "tags": [ "repositories" ], "summary": "Get repository status summary", "parameters": [ { "description": "Repository ID", "name": "id", "in": "path", "required": true, "schema": { "type": "integer" } } ], "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/dto.RepositoryStatusSummaryResponse" } } } }, "404": { "description": "Not Found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/middleware.JSONAPIErrorResponse" } } } }, "500": { "description": "Internal Server Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/middleware.JSONAPIErrorResponse" } } } } } } }, "/repositories/{id}/sync": { "post": { "security": [ { "APIKeyAuth": [] } ], "description": "Trigger a sync (git fetch + branch scan + commit indexing) for a repository", "tags": [ "repositories" ], "summary": "Sync repository", "parameters": [ { "description": "Repository ID", "name": "id", "in": "path", "required": true, "schema": { "type": "integer" } } ], "responses": { "202": { "description": "Accepted" }, "404": { "description": "Not Found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/middleware.JSONAPIErrorResponse" } } } }, "500": { "description": "Internal Server Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/middleware.JSONAPIErrorResponse" } } } } } } }, "/repositories/{id}/tags": { "get": { "security": [ { "APIKeyAuth": [] } ], "description": "List tags for a repository", "tags": [ "repositories" ], "summary": "List tags", "parameters": [ { "description": "Repository ID", "name": "id", "in": "path", "required": true, "schema": { "type": "integer" } }, { "description": "Page number (default: 1)", "name": "page", "in": "query", "schema": { "type": "integer" } }, { "description": "Results per page (default: 20, max: 100)", "name": "page_size", "in": "query", "schema": { "type": "integer" } } ], "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/dto.TagJSONAPIListResponse" } } } }, "404": { "description": "Not Found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/middleware.JSONAPIErrorResponse" } } } }, "500": { "description": "Internal Server Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/middleware.JSONAPIErrorResponse" } } } } } } }, "/repositories/{id}/tags/{tag_name}": { "get": { "security": [ { "APIKeyAuth": [] } ], "description": "Get a tag by name", "tags": [ "repositories" ], "summary": "Get tag", "parameters": [ { "description": "Repository ID", "name": "id", "in": "path", "required": true, "schema": { "type": "integer" } }, { "description": "Tag name", "name": "tag_name", "in": "path", "required": true, "schema": { "type": "string" } } ], "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/dto.TagJSONAPIResponse" } } } }, "404": { "description": "Not Found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/middleware.JSONAPIErrorResponse" } } } }, "500": { "description": "Internal Server Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/middleware.JSONAPIErrorResponse" } } } } } } }, "/repositories/{id}/tracking-config": { "get": { "security": [ { "APIKeyAuth": [] } ], "description": "Get current tracking configuration for a repository", "tags": [ "repositories" ], "summary": "Get tracking config", "parameters": [ { "description": "Repository ID", "name": "id", "in": "path", "required": true, "schema": { "type": "integer" } } ], "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/dto.TrackingConfigResponse" } } } }, "404": { "description": "Not Found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/middleware.JSONAPIErrorResponse" } } } }, "500": { "description": "Internal Server Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/middleware.JSONAPIErrorResponse" } } } } } }, "put": { "security": [ { "APIKeyAuth": [] } ], "description": "Update tracking configuration for a repository", "tags": [ "repositories" ], "summary": "Update tracking config", "parameters": [ { "description": "Repository ID", "name": "id", "in": "path", "required": true, "schema": { "type": "integer" } } ], "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/dto.TrackingConfigUpdateRequest" } } }, "description": "Tracking config", "required": true }, "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/dto.TrackingConfigResponse" } } } }, "404": { "description": "Not Found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/middleware.JSONAPIErrorResponse" } } } }, "500": { "description": "Internal Server Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/middleware.JSONAPIErrorResponse" } } } } } } }, "/search": { "post": { "security": [ { "APIKeyAuth": [] } ], "description": "Hybrid search across code snippets and enrichments", "tags": [ "search" ], "summary": "Search code", "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/dto.SearchRequest" } } }, "description": "Search request", "required": true }, "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/dto.SearchResponse" } } } }, "400": { "description": "Bad Request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/middleware.JSONAPIErrorResponse" } } } }, "500": { "description": "Internal Server Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/middleware.JSONAPIErrorResponse" } } } } } } } }, "servers": [ { "url": "//localhost:8080/api/v1" } ], "components": { "securitySchemes": { "APIKeyAuth": { "type": "apiKey", "name": "X-API-KEY", "in": "header" } }, "schemas": { "dto.CommitAttributes": { "type": "object", "properties": { "author": { "type": "string" }, "commit_sha": { "type": "string" }, "date": { "type": "string" }, "message": { "type": "string" }, "parent_commit_sha": { "type": "string" } } }, "dto.CommitData": { "type": "object", "properties": { "attributes": { "$ref": "#/components/schemas/dto.CommitAttributes" }, "id": { "type": "string" }, "type": { "type": "string" } } }, "dto.CommitJSONAPIListResponse": { "type": "object", "properties": { "data": { "type": "array", "items": { "$ref": "#/components/schemas/dto.CommitData" } }, "links": { "$ref": "#/components/schemas/jsonapi.Links" }, "meta": { "$ref": "#/components/schemas/jsonapi.Meta" } } }, "dto.CommitJSONAPIResponse": { "type": "object", "properties": { "data": { "$ref": "#/components/schemas/dto.CommitData" } } }, "dto.EnrichmentAttributes": { "type": "object", "properties": { "content": { "type": "string" }, "created_at": { "type": "string" }, "subtype": { "type": "string" }, "type": { "type": "string" }, "updated_at": { "type": "string" } } }, "dto.EnrichmentData": { "type": "object", "properties": { "attributes": { "$ref": "#/components/schemas/dto.EnrichmentAttributes" }, "id": { "type": "string" }, "type": { "type": "string" } } }, "dto.EnrichmentJSONAPIListResponse": { "type": "object", "properties": { "data": { "type": "array", "items": { "$ref": "#/components/schemas/dto.EnrichmentData" } }, "links": { "$ref": "#/components/schemas/jsonapi.Links" }, "meta": { "$ref": "#/components/schemas/jsonapi.Meta" } } }, "dto.EnrichmentJSONAPIResponse": { "type": "object", "properties": { "data": { "$ref": "#/components/schemas/dto.EnrichmentData" } } }, "dto.EnrichmentSchema": { "type": "object", "properties": { "content": { "type": "string" }, "type": { "type": "string" } } }, "dto.EnrichmentUpdateAttributes": { "type": "object", "properties": { "content": { "type": "string" } } }, "dto.EnrichmentUpdateData": { "type": "object", "properties": { "attributes": { "$ref": "#/components/schemas/dto.EnrichmentUpdateAttributes" }, "type": { "type": "string" } } }, "dto.EnrichmentUpdateRequest": { "type": "object", "properties": { "data": { "$ref": "#/components/schemas/dto.EnrichmentUpdateData" } } }, "dto.FileAttributes": { "type": "object", "properties": { "blob_sha": { "type": "string" }, "extension": { "type": "string" }, "mime_type": { "type": "string" }, "path": { "type": "string" }, "size": { "type": "integer" } } }, "dto.FileData": { "type": "object", "properties": { "attributes": { "$ref": "#/components/schemas/dto.FileAttributes" }, "id": { "type": "string" }, "type": { "type": "string" } } }, "dto.FileJSONAPIListResponse": { "type": "object", "properties": { "data": { "type": "array", "items": { "$ref": "#/components/schemas/dto.FileData" } }, "links": { "$ref": "#/components/schemas/jsonapi.Links" }, "meta": { "$ref": "#/components/schemas/jsonapi.Meta" } } }, "dto.FileJSONAPIResponse": { "type": "object", "properties": { "data": { "$ref": "#/components/schemas/dto.FileData" } } }, "dto.GitFileSchema": { "type": "object", "properties": { "blob_sha": { "type": "string" }, "mime_type": { "type": "string" }, "path": { "type": "string" }, "size": { "type": "integer" } } }, "dto.RepositoryAttributes": { "type": "object", "properties": { "cloned_path": { "type": "string" }, "created_at": { "type": "string" }, "last_scanned_at": { "type": "string" }, "num_branches": { "type": "integer" }, "num_commits": { "type": "integer" }, "num_tags": { "type": "integer" }, "remote_uri": { "type": "string" }, "tracking_branch": { "type": "string" }, "updated_at": { "type": "string" } } }, "dto.RepositoryBranchData": { "type": "object", "properties": { "commit_count": { "type": "integer" }, "is_default": { "type": "boolean" }, "name": { "type": "string" } } }, "dto.RepositoryCommitData": { "type": "object", "properties": { "author": { "type": "string" }, "message": { "type": "string" }, "sha": { "type": "string" }, "timestamp": { "type": "string" } } }, "dto.RepositoryCreateAttributes": { "type": "object", "properties": { "remote_uri": { "type": "string" } } }, "dto.RepositoryCreateData": { "type": "object", "properties": { "attributes": { "$ref": "#/components/schemas/dto.RepositoryCreateAttributes" }, "type": { "type": "string" } } }, "dto.RepositoryCreateRequest": { "type": "object", "properties": { "data": { "$ref": "#/components/schemas/dto.RepositoryCreateData" } } }, "dto.RepositoryData": { "type": "object", "properties": { "attributes": { "$ref": "#/components/schemas/dto.RepositoryAttributes" }, "id": { "type": "string" }, "type": { "type": "string" } } }, "dto.RepositoryDetailsResponse": { "type": "object", "properties": { "branches": { "type": "array", "items": { "$ref": "#/components/schemas/dto.RepositoryBranchData" } }, "data": { "$ref": "#/components/schemas/dto.RepositoryData" }, "recent_commits": { "type": "array", "items": { "$ref": "#/components/schemas/dto.RepositoryCommitData" } } } }, "dto.RepositoryListResponse": { "type": "object", "properties": { "data": { "type": "array", "items": { "$ref": "#/components/schemas/dto.RepositoryData" } }, "links": { "$ref": "#/components/schemas/jsonapi.Links" }, "meta": { "$ref": "#/components/schemas/jsonapi.Meta" } } }, "dto.RepositoryResponse": { "type": "object", "properties": { "data": { "$ref": "#/components/schemas/dto.RepositoryData" } } }, "dto.RepositoryStatusSummaryAttributes": { "type": "object", "properties": { "message": { "type": "string" }, "status": { "type": "string" }, "updated_at": { "type": "string" } } }, "dto.RepositoryStatusSummaryData": { "type": "object", "properties": { "attributes": { "$ref": "#/components/schemas/dto.RepositoryStatusSummaryAttributes" }, "id": { "type": "string" }, "type": { "type": "string" } } }, "dto.RepositoryStatusSummaryResponse": { "type": "object", "properties": { "data": { "$ref": "#/components/schemas/dto.RepositoryStatusSummaryData" } } }, "dto.SearchAttributes": { "type": "object", "properties": { "code": { "type": "string" }, "filters": { "$ref": "#/components/schemas/dto.SearchFilters" }, "keywords": { "type": "array", "items": { "type": "string" } }, "limit": { "type": "integer" }, "text": { "type": "string" } } }, "dto.SearchData": { "type": "object", "properties": { "attributes": { "$ref": "#/components/schemas/dto.SearchAttributes" }, "type": { "type": "string" } } }, "dto.SearchFilters": { "type": "object", "properties": { "authors": { "type": "array", "items": { "type": "string" } }, "commit_sha": { "type": "array", "items": { "type": "string" } }, "end_date": { "type": "string" }, "enrichment_subtypes": { "type": "array", "items": { "type": "string" } }, "enrichment_types": { "type": "array", "items": { "type": "string" } }, "file_patterns": { "type": "array", "items": { "type": "string" } }, "languages": { "type": "array", "items": { "type": "string" } }, "sources": { "type": "array", "items": { "type": "string" } }, "start_date": { "type": "string" } } }, "dto.SearchRequest": { "type": "object", "properties": { "data": { "$ref": "#/components/schemas/dto.SearchData" } } }, "dto.SearchResponse": { "type": "object", "properties": { "data": { "type": "array", "items": { "$ref": "#/components/schemas/dto.SnippetData" } } } }, "dto.SnippetAttributes": { "type": "object", "properties": { "content": { "$ref": "#/components/schemas/dto.SnippetContentSchema" }, "created_at": { "type": "string" }, "derives_from": { "type": "array", "items": { "$ref": "#/components/schemas/dto.GitFileSchema" } }, "enrichments": { "type": "array", "items": { "$ref": "#/components/schemas/dto.EnrichmentSchema" } }, "original_scores": { "type": "array", "items": { "type": "number" } }, "updated_at": { "type": "string" } } }, "dto.SnippetContentSchema": { "type": "object", "properties": { "language": { "type": "string" }, "value": { "type": "string" } } }, "dto.SnippetData": { "type": "object", "properties": { "attributes": { "$ref": "#/components/schemas/dto.SnippetAttributes" }, "id": { "type": "string" }, "links": { "$ref": "#/components/schemas/dto.SnippetLinks" }, "type": { "type": "string" } } }, "dto.SnippetLinks": { "type": "object", "properties": { "commit": { "type": "string" }, "file": { "type": "string" }, "repository": { "type": "string" } } }, "dto.SnippetListResponse": { "type": "object", "properties": { "data": { "type": "array", "items": { "$ref": "#/components/schemas/dto.SnippetData" } }, "links": { "$ref": "#/components/schemas/jsonapi.Links" }, "meta": { "$ref": "#/components/schemas/jsonapi.Meta" } } }, "dto.TagAttributes": { "type": "object", "properties": { "is_version_tag": { "type": "boolean" }, "name": { "type": "string" }, "target_commit_sha": { "type": "string" } } }, "dto.TagData": { "type": "object", "properties": { "attributes": { "$ref": "#/components/schemas/dto.TagAttributes" }, "id": { "type": "string" }, "type": { "type": "string" } } }, "dto.TagJSONAPIListResponse": { "type": "object", "properties": { "data": { "type": "array", "items": { "$ref": "#/components/schemas/dto.TagData" } }, "links": { "$ref": "#/components/schemas/jsonapi.Links" }, "meta": { "$ref": "#/components/schemas/jsonapi.Meta" } } }, "dto.TagJSONAPIResponse": { "type": "object", "properties": { "data": { "$ref": "#/components/schemas/dto.TagData" } } }, "dto.TaskAttributes": { "type": "object", "properties": { "created_at": { "type": "string" }, "payload": {}, "priority": { "type": "integer" }, "type": { "type": "string" }, "updated_at": { "type": "string" } } }, "dto.TaskData": { "type": "object", "properties": { "attributes": { "$ref": "#/components/schemas/dto.TaskAttributes" }, "id": { "type": "string" }, "type": { "type": "string" } } }, "dto.TaskListResponse": { "type": "object", "properties": { "data": { "type": "array", "items": { "$ref": "#/components/schemas/dto.TaskData" } }, "links": { "$ref": "#/components/schemas/jsonapi.Links" }, "meta": { "$ref": "#/components/schemas/jsonapi.Meta" } } }, "dto.TaskResponse": { "type": "object", "properties": { "data": { "$ref": "#/components/schemas/dto.TaskData" } } }, "dto.TaskStatusAttributes": { "type": "object", "properties": { "created_at": { "type": "string" }, "current": { "type": "integer" }, "error": { "type": "string" }, "message": { "type": "string" }, "progress": { "type": "number" }, "state": { "type": "string" }, "step": { "type": "string" }, "total": { "type": "integer" }, "updated_at": { "type": "string" } } }, "dto.TaskStatusData": { "type": "object", "properties": { "attributes": { "$ref": "#/components/schemas/dto.TaskStatusAttributes" }, "id": { "type": "string" }, "type": { "type": "string" } } }, "dto.TaskStatusListResponse": { "type": "object", "properties": { "data": { "type": "array", "items": { "$ref": "#/components/schemas/dto.TaskStatusData" } }, "links": { "$ref": "#/components/schemas/jsonapi.Links" }, "meta": { "$ref": "#/components/schemas/jsonapi.Meta" } } }, "dto.TrackingConfigAttributes": { "type": "object", "properties": { "mode": { "$ref": "#/components/schemas/dto.TrackingMode" }, "value": { "type": "string" } } }, "dto.TrackingConfigData": { "type": "object", "properties": { "attributes": { "$ref": "#/components/schemas/dto.TrackingConfigAttributes" }, "type": { "type": "string" } } }, "dto.TrackingConfigResponse": { "type": "object", "properties": { "data": { "$ref": "#/components/schemas/dto.TrackingConfigData" } } }, "dto.TrackingConfigUpdateAttributes": { "type": "object", "properties": { "mode": { "$ref": "#/components/schemas/dto.TrackingMode" }, "value": { "type": "string" } } }, "dto.TrackingConfigUpdateData": { "type": "object", "properties": { "attributes": { "$ref": "#/components/schemas/dto.TrackingConfigUpdateAttributes" }, "type": { "type": "string" } } }, "dto.TrackingConfigUpdateRequest": { "type": "object", "properties": { "data": { "$ref": "#/components/schemas/dto.TrackingConfigUpdateData" } } }, "dto.TrackingMode": { "type": "string", "enum": [ "branch", "tag" ], "x-enum-varnames": [ "TrackingModeBranch", "TrackingModeTag" ] }, "jsonapi.Links": { "type": "object", "properties": { "first": { "type": "string" }, "last": { "type": "string" }, "next": { "type": "string" }, "prev": { "type": "string" }, "self": { "type": "string" } } }, "jsonapi.Meta": { "type": "object", "additionalProperties": {} }, "middleware.JSONAPIError": { "type": "object", "properties": { "detail": { "type": "string" }, "id": { "type": "string" }, "status": { "type": "string" }, "title": { "type": "string" } } }, "middleware.JSONAPIErrorResponse": { "type": "object", "properties": { "errors": { "type": "array", "items": { "$ref": "#/components/schemas/middleware.JSONAPIError" } } } } } } }