Skip to main content
POST
Search files
Searches file contents with a regular expression. The search respects .gitignore and skips node_modules unless you scope path into it. Scope it with path (e.g. apps/agent-console), filter files with glob (e.g. *.tsx), and pass context (0 to 10, default 2) for surrounding lines. Results stop at 500 lines; truncated tells you there were more.

Authorizations

Authorization
string
header
required

Enter your Zite API key. Format: Bearer <api_key>

Path Parameters

sessionId
string
required

The build session ID from Open a session.

Body

application/json
pattern
string
required

Regular expression to search for.

Example:

"createEndpoint"

context
integer
default:2

Lines of surrounding context to include per match.

Required range: 0 <= x <= 10
Example:

2

path
string

Directory or file to search, relative to the workspace root.

Example:

"apps/agent-console"

glob
string

Only search files matching this glob.

Example:

"*.ts"

Response

Search results

results
string

Matching lines prefixed with file:line, with context lines.

matchCount
integer

Number of lines in results.

truncated
boolean

True when there were more lines than were returned. Narrow with path or glob.