Request Body
Branch name, tag, or commit SHA to grep in (defaults to repository’s default branch)
Regex pattern to search for
Whether grep should be case sensitive (default: true)
Array of specific paths to grep within
Glob patterns for files to include in grep
Glob patterns for files to exclude from grep
File extensions to filter by (e.g., [“.js”, “.py”])
Number of lines to include before each match
Number of lines to include after each match
Maximum total lines to return (default: 2000, max: 2000)
Maximum matches per file (default: 200)
Pagination cursor from previous response
Maximum number of matches to return (default: 200)
JWT Requirements
- The JWT must include the repository in the
repoclaim - Requires
git:readscope
Response
Response Headers
X-Cache: Indicates cache status (HITorMISS)
Notes
- Supports full regex patterns in the grep query
- File filtering supports glob patterns (e.g.,
**/*.js,src/**/*.ts) - Pagination uses cursor-based navigation for consistent results
- Large files or binary files may be automatically excluded from grep results
Error Responses
Invalid regex pattern, missing required fields, or invalid pagination cursor
Missing authorization header
Invalid JWT or missing
git:read scopeRepository or reference doesn’t exist
Git command failures or database errors
Repository sync in progress or storage unavailable
Request timeout