Skip to main content
GET
Search the indexed codebase
The reference panel describes the current v3 operation. The notes below describe its v2 compatibility API. Follow the v3 request schema for current calls: v3 can move identifiers from the body or query into the URL. Keep the v2 method, path, and payload together when using the compatibility API.

v2 compatibility notes

GET /api/v2/factories/searchCodebase?query=&limit= returns up to limit chunks of the deployment’s indexed codebase whose text matches query, as CodebaseSearchHit objects. The match is a text search over chunk text. Each hit carries the file path, the matching chunk, and its chunkIndex and language (null when not recorded). The read is not paged. query is required and must be 1 to 500 characters. limit is an integer from 1 to 50 and defaults to 20. A missing, empty, or longer query, a limit outside that range, or a repeated parameter is 400 bad_request. Deployment-root read. The indexed codebase has no home org unit, so your role grants must hold factories:read at the deployment root. Holding it only below the root, or at a partner organization’s root, is refused with 403 and requiredPermission: "factories:read".

Authorizations

Authorization
string
header
required

An External App: the JWT it obtains from POST /oauth/token with OAuth2 client_credentials. Pass as Authorization: Bearer <jwt>. An app's static companion key also authenticates as the app, but is deprecated and is not protected by Idempotency-Key.

Query Parameters

query
string
required

Text to match in chunk text.

Required string length: 1 - 500
limit
integer
default:20

How many of the top items to answer, 1 to 50 (default 20); a larger value is a 400 too_big. The list is bounded: at most 50 items, the top limit indexed chunks whose text matches query. Every answer is the whole list, so meta.hasMore is false.

Required range: 1 <= x <= 50
cursor
string

A bounded list issues no cursor: meta.nextCursor is always null, and any cursor is 400.

Minimum string length: 1

Response

Matching chunks

data
object[]
required
meta
object
required

A list page's continuation. While hasMore is true, nextCursor is a string: pass it as cursor for the next page. hasMore: false ends the list; with truncated: true, more exist past what this list reads, and no cursor reaches them.