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.
/api/v2/files/searchYour Sim API key, personal or workspace-scoped. Generate one under Settings, then API Keys. Operations that reject workspace keys say so in their own description.
In: header
Query Parameters
Workspace to search.
1 <= length <= 128Regular expression, or exact text when mode is exact.
3 <= length <= 512How query is read.
"regex""exact" | "regex"Maximum matching lines to return.
501 <= value <= 200Folders 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.
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.
"true" | "1" | "yes" | "on" | "y" | "enabled" | "false" | "0" | "no" | "off" | "n" | "disabled"Response Body
application/json
application/json
application/json
application/json
application/json
application/json
application/json
application/json
application/json
curl -X GET "https://www.sim.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"
}
}