Search File Content

Search indexed text in active workspace files and return matching lines with file IDs and line numbers. folderPaths limits both results and reported coverage. Missing matches are inconclusive if complete is false or indexStatus.skippedFiles or indexStatus.partialFiles is nonzero. truncated means additional matches exist beyond maxResults.

OAuth scope: api:read.

GET/api/v2/files/search
X-API-Key<token>

Sua API key do Studio, pessoal ou com escopo de workspace. Gere uma em Settings e depois API Keys. As operações que rejeitam API keys de workspace dizem isso na própria descrição.

Em: header

Parâmetros de query

workspaceId*string

Workspace to search.

Tamanho1 <= length <= 128
query*string

Regular expression, or exact text when mode is exact.

Tamanho3 <= length <= 512
mode?string

How query is read.

Padrão"regex"
Valor em"exact" | "regex"
maxResults?integer

Maximum matching lines to return.

Padrão50
Intervalo1 <= value <= 200
folderPaths?string

Folders the search is confined to, comma-separated. Absent searches the whole workspace. The scope also narrows indexStatus, so complete describes the folders searched rather than the workspace.

includeSubfolders?string

Whether the scope descends into nested folders. Absent means yes. The listed spellings are the whole accepted vocabulary and are case-sensitive; any other value is rejected.

Valor em"true" | "1" | "yes" | "on" | "y" | "enabled" | "false" | "0" | "no" | "off" | "n" | "disabled"

Corpo da resposta

application/json

application/json

application/json

application/json

application/json

application/json

application/json

application/json

application/json

curl -X GET "https://agent-studio.seeyu.ai/api/v2/files/search?workspaceId=string&query=string" \  -H "X-API-Key: YOUR_API_KEY"
{
  "data": {
    "results": [
      {
        "fileId": "wf_V1StGXR8z5jdHi6BmyT91",
        "lineNumber": 4,
        "text": "- based in NYC"
      }
    ],
    "count": 1,
    "truncated": false,
    "complete": true,
    "indexStatus": {
      "readyFiles": 12,
      "pendingFiles": 0,
      "failedFiles": 0,
      "skippedFiles": 0,
      "partialFiles": 0
    }
  }
}
{
  "error": {
    "code": "BAD_REQUEST",
    "message": "Invalid request"
  }
}
{
  "error": {
    "code": "UNAUTHORIZED",
    "message": "Authentication required"
  }
}
{
  "error": {
    "code": "FORBIDDEN",
    "message": "Insufficient workspace permissions",
    "details": {
      "code": "INSUFFICIENT_WORKSPACE_ROLE"
    }
  }
}
{
  "error": {
    "code": "NOT_FOUND",
    "message": "Not found"
  }
}
{
  "error": {
    "code": "LOCKED",
    "message": "The file or its search index is temporarily locked; retry the request"
  }
}
{
  "error": {
    "code": "RATE_LIMITED",
    "message": "API rate limit exceeded",
    "details": {
      "retryAfter": "2026-01-01T00:00:30.000Z"
    }
  }
}
{
  "error": {
    "code": "INTERNAL_ERROR",
    "message": "Internal server error"
  }
}
{
  "error": {
    "code": "SERVICE_UNAVAILABLE",
    "message": "Service temporarily unavailable"
  }
}