---
title: "Search code"
method: POST
path: "/search"
tags: ["search"]
---

# Search code

`POST /search`

Hybrid search across code snippets and enrichments

## Request body

- DtoSearchRequest
  - `data` DtoSearchData
    - `attributes` DtoSearchAttributes
      - `code` string
      - `filters` DtoSearchFilters
        - `authors` string[]
        - `commit_sha` string[]
        - `end_date` string
        - `enrichment_subtypes` string[]
        - `enrichment_types` string[]
        - `file_patterns` string[]
        - `languages` string[]
        - `sources` string[]
        - `start_date` string
      - `keywords` string[]
      - `limit` integer
      - `text` string
    - `type` string

## Response `200`

OK

- DtoSearchResponse
  - `data` DtoSnippetData[]
    - `attributes` DtoSnippetAttributes
      - `content` DtoSnippetContentSchema
        - `end_line` integer
        - `language` string
        - `page` integer
        - `start_line` integer
        - `value` string
      - `created_at` string
      - `enrichments` DtoEnrichmentSchema[]
        - `content` string
        - `type` string
      - `original_scores` number[]
      - `updated_at` string
    - `id` string
    - `links` DtoSnippetLinks
      - `commit` string
      - `file` string
      - `repository` string
    - `type` string

## Other responses

- `400` — Bad Request
- `500` — Internal Server Error

## Changes

> 14 revisions in range; 1 could not be searched.

- **2026-04-06** `de2135f74990` — 1 info
  - added the optional property `data/items/attributes/content/page` to the response with the `200` status
- **2026-03-02** `e258f9541233` — 1 warning, 1 info
  - removed the optional property `data/items/attributes/derives_from` from the response with the `200` status
  - the endpoint scheme security `APIKeyAuth` was removed from the API
- **2026-02-27** `f32956e4ed89` — 2 info
  - added the optional property `data/items/attributes/content/end_line` to the response with the `200` status
  - added the optional property `data/items/attributes/content/start_line` to the response with the `200` status
- **2026-02-19** `41466db231c5` — 3 warning, 2 info
  - removed the optional property `data/items/attributes/content/end_line` from the response with the `200` status
  - removed the optional property `data/items/attributes/content/page` from the response with the `200` status
  - removed the optional property `data/items/attributes/content/start_line` from the response with the `200` status
  - the endpoint scheme security `APIKeyAuth` was added to the API
  - …1 more

[Change history](https://skmtc.dev/helixml/apis/kodit-api/changes/search/post.md)

---

[API](https://skmtc.dev/helixml/apis/kodit-api.md) · [All operations](https://skmtc.dev/helixml/apis/kodit-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/helixml/kodit-api/revisions/3f72fa58f3fb/schema)
