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.3.12

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/indexes

List all indexes.

Responses

  • 200: Successful Response

IndexListResponse

  • 500: Internal server error

  • 401: Unauthorized

  • 422: Invalid request

POST /api/v1/indexes

Create a new index and start async indexing.

Request Body

IndexCreateRequest

Responses

  • 202: Successful Response

IndexResponse

  • 500: Internal server error

  • 401: Unauthorized

  • 422: Invalid request

GET /api/v1/indexes/{index_id}

Get index details.

Parameters

NameTypeRequiredDescription
index_idintegerTrue

Responses

  • 200: Successful Response

IndexDetailResponse

  • 500: Internal server error

  • 401: Unauthorized

  • 422: Invalid request

  • 404: Index not found

DELETE /api/v1/indexes/{index_id}

Delete an index.

Parameters

NameTypeRequiredDescription
index_idintegerTrue

Responses

  • 204: Successful Response

  • 500: Internal server error

  • 401: Unauthorized

  • 422: Invalid request

  • 404: Index 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

Components

HTTPValidationError

FieldTypeDescription
detailarray

IndexAttributes

Index attributes for JSON:API responses.

FieldTypeDescription
created_atstring
updated_atstring
uristring

IndexCreateAttributes

Attributes for creating an index.

FieldTypeDescription
uristringURI of the source to index

IndexCreateData

Data for creating an index.

FieldTypeDescription
typestring
attributes

IndexCreateRequest

JSON:API request for creating an index.

FieldTypeDescription
data

IndexData

Index data for JSON:API responses.

FieldTypeDescription
typestring
idstring
attributes

IndexDetailResponse

JSON:API response for index details with included resources.

FieldTypeDescription
data

IndexListResponse

JSON:API response for index list.

FieldTypeDescription
dataarray

IndexResponse

JSON:API response for single index.

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

SnippetAttributes

Snippet attributes for JSON:API responses.

FieldTypeDescription
contentstring
created_atstring
updated_atstring
original_scoresarray
source_uristring
relative_pathstring
languagestring
authorsarray
summarystring

SnippetData

Snippet data for JSON:API responses.

FieldTypeDescription
typestring
idinteger
attributes

ValidationError

FieldTypeDescription
locarray
msgstring
typestring