Skip to main content
POST
/
v1
/
agent
/
{agentId}
/
filesystem
/
operations
/
search
Search Files
curl --request POST \
  --url https://api.app.shinzo.ai/v1/agent/{agentId}/filesystem/operations/search \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "query": "<string>",
  "type": "<string>",
  "path": "<string>",
  "filePattern": "<string>",
  "caseSensitive": true,
  "maxResults": 123
}
'

Documentation Index

Fetch the complete documentation index at: https://docs.shinzo.ai/llms.txt

Use this file to discover all available pages before exploring further.

Authentication

Requires JWT token or Platform API key.
agentId
string
required
Agent UUID
query
string
required
Search pattern (glob for filenames, regex for content)
type
string
Search type: filename, content, or both
path
string
Base path to search from (defaults to workspace root)
filePattern
string
Glob pattern for file matching
caseSensitive
boolean
Enable case-sensitive matching
maxResults
number
Maximum results to return

Example Request

Search for files by name:
curl -X POST "https://api.app.shinzo.ai/v1/agent/agt_abc123/filesystem/operations/search" \
  -H "Authorization: Bearer <jwt_token>" \
  -H "Content-Type: application/json" \
  -d '{
    "pattern": "*.json",
    "path": "/workspace/config",
    "max_results": 50
  }'
Search file contents:
curl -X POST "https://api.app.shinzo.ai/v1/agent/agt_abc123/filesystem/operations/search" \
  -H "Authorization: Bearer <jwt_token>" \
  -H "Content-Type: application/json" \
  -d '{
    "pattern": "TODO",
    "content_search": true,
    "case_sensitive": false
  }'

Response

{
  "results": [
    {
      "path": "/workspace/config/settings.json",
      "type": "file",
      "size": 256
    },
    {
      "path": "/workspace/config/env.json",
      "type": "file",
      "size": 128
    }
  ],
  "total": 2
}
For content searches, results include match details:
{
  "results": [
    {
      "path": "/workspace/src/index.js",
      "type": "file",
      "size": 1024,
      "matches": [
        "// TODO: implement error handling"
      ]
    }
  ],
  "total": 1
}

Response Fields

FieldTypeDescription
resultsarrayList of matching files
results[].pathstringFile path
results[].typestringEntry type (file or directory)
results[].sizenumberFile size in bytes
results[].matchesarrayMatching content lines (content search only)
totalnumberTotal number of results

Status Codes

CodeDescription
200Search completed successfully
400Invalid request body or pattern
401Invalid authentication
403Access denied
404Agent not found