Server API Reference

Server API Reference

This file is automatically generated from the Kodit server OpenAPI specification. You can view the live API documentation on the /docs endpoint of your Kodit server or look at the hosted version.

This is the REST API for the Kodit server. Please refer to the Kodit documentation for more information.

Current version: 0.5.1

Authentication

Security Schemes

NameTypeDescriptionSchemeBearer Format
Header (X-API-KEY)apiKeyAPI key for authentication (only if set in environmental variables)

APIs

GET /healthz

Return a health check for the kodit API.

Responses

  • 200: Successful Response

  • 500: Internal server error

GET /api/v1/queue

List all tasks in the queue.

Optionally filter by task type.

Parameters

NameTypeRequiredDescription
task_typeFalse

Responses

  • 200: Successful Response

TaskListResponse

  • 500: Internal server error

  • 401: Unauthorized

  • 422: Invalid request

GET /api/v1/queue/{task_id}

Get details of a specific task in the queue.

Parameters

NameTypeRequiredDescription
task_idstringTrue

Responses

  • 200: Successful Response

TaskResponse

  • 500: Internal server error

  • 401: Unauthorized

  • 422: Invalid request

  • 404: Task not found

POST /api/v1/search

Search code snippets with filters matching MCP tool.

Request Body

SearchRequest

Responses

  • 200: Successful Response

SearchResponse

  • 500: Internal server error

  • 422: Validation Error

HTTPValidationError

GET /api/v1/repositories/{repo_id}/commits

List all commits for a repository.

Parameters

NameTypeRequiredDescription
repo_idstringTrue

Responses

  • 200: Successful Response

CommitListResponse

  • 500: Internal server error

  • 401: Unauthorized

  • 422: Invalid request

GET /api/v1/repositories/{repo_id}/commits/{commit_sha}

Get a specific commit for a repository.

Parameters

NameTypeRequiredDescription
repo_idstringTrue
commit_shastringTrue

Responses

  • 200: Successful Response

CommitResponse

  • 500: Internal server error

  • 401: Unauthorized

  • 422: Invalid request

  • 404: Repository or commit not found

GET /api/v1/repositories/{repo_id}/commits/{commit_sha}/files

List all files in a specific commit.

Parameters

NameTypeRequiredDescription
repo_idstringTrue
commit_shastringTrue

Responses

  • 200: Successful Response

FileListResponse

  • 500: Internal server error

  • 401: Unauthorized

  • 422: Invalid request

GET /api/v1/repositories/{repo_id}/commits/{commit_sha}/files/{blob_sha}

Get a specific file from a commit.

Parameters

NameTypeRequiredDescription
repo_idstringTrue
commit_shastringTrue
blob_shastringTrue

Responses

  • 200: Successful Response

FileResponse

  • 500: Internal server error

  • 401: Unauthorized

  • 422: Invalid request

  • 404: Repository, commit or file not found

GET /api/v1/repositories/{repo_id}/commits/{commit_sha}/snippets

List all snippets in a specific commit.

Parameters

NameTypeRequiredDescription
repo_idstringTrue
commit_shastringTrue

Responses

  • 200: Successful Response

SnippetListResponse

  • 500: Internal server error

  • 401: Unauthorized

  • 422: Invalid request

  • 404: Repository or commit not found

GET /api/v1/repositories/{repo_id}/commits/{commit_sha}/embeddings

List all embeddings for snippets in a specific commit.

Parameters

NameTypeRequiredDescription
repo_idstringTrue
commit_shastringTrue
fullbooleanFalseIf true, return full vectors. If false, return first 5 values.

Responses

  • 200: Successful Response

EmbeddingListResponse

  • 500: Internal server error

  • 401: Unauthorized

  • 422: Invalid request

  • 404: Repository or commit not found

GET /api/v1/repositories/{repo_id}/commits/{commit_sha}/enrichments

List all enrichments for a specific commit.

Parameters

NameTypeRequiredDescription
repo_idstringTrue
commit_shastringTrue

Responses

  • 200: Successful Response

EnrichmentListResponse

  • 500: Internal server error

  • 401: Unauthorized

  • 422: Invalid request

  • 404: Repository or commit not found

DELETE /api/v1/repositories/{repo_id}/commits/{commit_sha}/enrichments

Delete all enrichments for a specific commit.

Parameters

NameTypeRequiredDescription
repo_idstringTrue
commit_shastringTrue

Responses

  • 204: Successful Response

  • 500: Internal server error

  • 401: Unauthorized

  • 422: Invalid request

  • 404: Commit not found

DELETE /api/v1/repositories/{repo_id}/commits/{commit_sha}/enrichments/{enrichment_id}

Delete a specific enrichment for a commit.

Parameters

NameTypeRequiredDescription
repo_idstringTrue
commit_shastringTrue
enrichment_idintegerTrue

Responses

  • 204: Successful Response

  • 500: Internal server error

  • 401: Unauthorized

  • 422: Invalid request

  • 404: Enrichment not found

GET /api/v1/repositories

List all cloned repositories.

Responses

  • 200: Successful Response

RepositoryListResponse

  • 500: Internal server error

  • 401: Unauthorized

  • 422: Invalid request

POST /api/v1/repositories

Clone a new repository and perform initial mapping.

Request Body

RepositoryCreateRequest

Responses

  • 201: Successful Response

RepositoryResponse

  • 500: Internal server error

  • 401: Unauthorized

  • 422: Invalid request

GET /api/v1/repositories/{repo_id}

Get repository details including branches and recent commits.

Parameters

NameTypeRequiredDescription
repo_idstringTrue

Responses

  • 200: Successful Response

RepositoryDetailsResponse

  • 500: Internal server error

  • 401: Unauthorized

  • 422: Invalid request

  • 404: Repository not found

DELETE /api/v1/repositories/{repo_id}

Delete a repository and all its associated data.

Parameters

NameTypeRequiredDescription
repo_idstringTrue

Responses

  • 204: Successful Response

  • 500: Internal server error

  • 401: Unauthorized

  • 422: Invalid request

  • 404: Repository not found

GET /api/v1/repositories/{repo_id}/status

Get the status of tasks for an index.

Parameters

NameTypeRequiredDescription
repo_idintegerTrue

Responses

  • 200: Successful Response

TaskStatusListResponse

  • 500: Internal server error

  • 401: Unauthorized

  • 422: Invalid request

  • 404: Index not found

GET /api/v1/repositories/{repo_id}/tags

List all tags for a repository.

Parameters

NameTypeRequiredDescription
repo_idstringTrue

Responses

  • 200: Successful Response

TagListResponse

  • 500: Internal server error

  • 401: Unauthorized

  • 422: Invalid request

  • 404: Repository not found

GET /api/v1/repositories/{repo_id}/tags/{tag_id}

Get a specific tag for a repository.

Parameters

NameTypeRequiredDescription
repo_idstringTrue
tag_idstringTrue

Responses

  • 200: Successful Response

TagResponse

  • 500: Internal server error

  • 401: Unauthorized

  • 422: Invalid request

  • 404: Repository or tag not found

Components

CommitAttributes

Commit attributes following JSON-API spec.

FieldTypeDescription
commit_shastring
datestring
messagestring
parent_commit_shastring
authorstring

CommitData

Commit data following JSON-API spec.

FieldTypeDescription
typestring
idstring
attributes

CommitListResponse

Commit list response following JSON-API spec.

FieldTypeDescription
dataarray

CommitResponse

Single commit response following JSON-API spec.

FieldTypeDescription
data

EmbeddingAttributes

Embedding attributes following JSON-API spec.

FieldTypeDescription
snippet_shastring
embedding_typestring
embeddingarray

EmbeddingData

Embedding data following JSON-API spec.

FieldTypeDescription
typestring
idstring
attributes

EmbeddingListResponse

Embedding list response following JSON-API spec.

FieldTypeDescription
dataarray

EnrichmentAttributes

Enrichment attributes following JSON-API spec.

FieldTypeDescription
typestring
subtype
contentstring
created_at
updated_at

EnrichmentData

Enrichment data following JSON-API spec.

FieldTypeDescription
typestring
idstring
attributes

EnrichmentListResponse

Enrichment list response following JSON-API spec.

FieldTypeDescription
dataarray

EnrichmentSchema

Enrichment schema following JSON-API spec.

FieldTypeDescription
typestring
contentstring

FileAttributes

File attributes following JSON-API spec.

FieldTypeDescription
blob_shastring
pathstring
mime_typestring
sizeinteger
extensionstring

FileData

File data following JSON-API spec.

FieldTypeDescription
typestring
idstring
attributes

FileListResponse

File list response following JSON-API spec.

FieldTypeDescription
dataarray

FileResponse

Single file response following JSON-API spec.

FieldTypeDescription
data

GitFileSchema

Git file schema following JSON-API spec.

FieldTypeDescription
blob_shastring
pathstring
mime_typestring
sizeinteger

HTTPValidationError

FieldTypeDescription
detailarray

RepositoryAttributes

Repository attributes following JSON-API spec.

FieldTypeDescription
remote_uristring
created_at
updated_at
last_scanned_at
cloned_path
tracking_branch
num_commitsinteger
num_branchesinteger
num_tagsinteger

RepositoryBranchData

Repository branch data.

FieldTypeDescription
namestring
is_defaultboolean
commit_countinteger

RepositoryCommitData

Repository commit data for repository details.

FieldTypeDescription
shastring
messagestring
authorstring
timestampstring

RepositoryCreateAttributes

Repository creation attributes.

FieldTypeDescription
remote_uristring

RepositoryCreateData

Repository creation data.

FieldTypeDescription
typestring
attributes

RepositoryCreateRequest

Repository creation request.

FieldTypeDescription
data

RepositoryData

Repository data following JSON-API spec.

FieldTypeDescription
typestring
idstring
attributes

RepositoryDetailsResponse

Repository details response with branches and commits.

FieldTypeDescription
data
branchesarray
recent_commitsarray

RepositoryListResponse

Repository list response following JSON-API spec.

FieldTypeDescription
dataarray

RepositoryResponse

Single repository response following JSON-API spec.

FieldTypeDescription
data

SearchAttributes

Search attributes for JSON:API requests.

FieldTypeDescription
keywordsSearch keywords
codeCode search query
textText search query
limitMaximum number of results to return
filtersSearch filters

SearchData

Search data for JSON:API requests.

FieldTypeDescription
typestring
attributes

SearchFilters

Search filters for JSON:API requests.

FieldTypeDescription
languagesProgramming languages to filter by
authorsAuthors to filter by
start_dateFilter snippets created after this date
end_dateFilter snippets created before this date
sourcesSource repositories to filter by
file_patternsFile path patterns to filter by

SearchRequest

JSON:API request for searching snippets.

FieldTypeDescription
data

SearchResponse

JSON:API response for search results.

FieldTypeDescription
dataarray

SnippetContentSchema

Snippet content schema following JSON-API spec.

FieldTypeDescription
valuestring
languagestring

SnippetListResponse

Snippet list response following JSON-API spec.

FieldTypeDescription
dataarray

TagAttributes

Tag attributes following JSON-API spec.

FieldTypeDescription
namestring
target_commit_shastring
is_version_tagboolean

TagData

Tag data following JSON-API spec.

FieldTypeDescription
typestring
idstring
attributes

TagListResponse

Tag list response following JSON-API spec.

FieldTypeDescription
dataarray

TagResponse

Single tag response following JSON-API spec.

FieldTypeDescription
data

TaskAttributes

Task attributes for JSON:API responses.

FieldTypeDescription
typestring
priorityinteger
payloadobject
created_at
updated_at

TaskData

Task data for JSON:API responses.

FieldTypeDescription
typestring
idstring
attributes

TaskListResponse

JSON:API response for task list.

FieldTypeDescription
dataarray

TaskOperation

Task operation.

TaskResponse

JSON:API response for single task.

FieldTypeDescription
data

TaskStatusAttributes

Task status attributes for JSON:API responses.

FieldTypeDescription
stepstringName of the task/operation
statestringCurrent state of the task
progressnumberProgress percentage (0-100)
totalintegerTotal number of items to process
currentintegerCurrent number of items processed
created_atTask start time
updated_atLast update time
errorstringError message
messagestringMessage

TaskStatusData

Task status data for JSON:API responses.

FieldTypeDescription
typestring
idstring
attributes

TaskStatusListResponse

JSON:API response for task status list.

FieldTypeDescription
dataarray

ValidationError

FieldTypeDescription
locarray
msgstring
typestring

kodit__infrastructure__api__v1__schemas__search__SnippetAttributes

Snippet attributes for JSON:API responses.

FieldTypeDescription
created_at
updated_at
derives_fromarray
content
enrichmentsarray
original_scoresarray

kodit__infrastructure__api__v1__schemas__search__SnippetData

Snippet data for JSON:API responses.

FieldTypeDescription
typestring
idstring
attributes

kodit__infrastructure__api__v1__schemas__snippet__SnippetAttributes

Snippet attributes following JSON-API spec.

FieldTypeDescription
created_at
updated_at
derives_fromarray
content
enrichmentsarray

kodit__infrastructure__api__v1__schemas__snippet__SnippetData

Snippet data following JSON-API spec.

FieldTypeDescription
typestring
idstring
attributes