API v1
Agents
Agents Workspace

Workspace: Grep

Search for a regex pattern across files in the agent's workspace.

post/v1/agents/{agent_id}/workspace/grep

Request

  • Base URL
    https://api.xpander.ai (the document declares no server; this is the origin it was published from)
  • Auth
    API key in header x-api-key

Path parameters

agent_idstring required

Request body

patternstring required

Regex pattern to search for (Extended Regular Expressions).

pathstring

Directory or file path to search in, relative to workspace root. Directories are searched recursively.

includestring nullable

Glob pattern to filter which files to search (e.g. '*.py' to only search Python files).

context_linesinteger

Number of lines of context to show before and after each match.

Example request

{
  "pattern": "def main",
  "path": "src",
  "include": "*.py"
}

Response

Successful Response

total_matchesinteger

Total number of matching lines found

files_with_matchesinteger

Number of distinct files that contained at least one match

summarystring

Human-readable one-line summary of the search result

Changes

No recorded changes to this operation across all 6 revisions of this API.