curl --request GET \
--url https://api.replicas.dev/v1/workspaces/{workspaceId}/repo-files/search \
--header 'Authorization: Bearer <token>' \
--header 'Replicas-Org-Id: <replicas-org-id>'import requests
url = "https://api.replicas.dev/v1/workspaces/{workspaceId}/repo-files/search"
headers = {
"Replicas-Org-Id": "<replicas-org-id>",
"Authorization": "Bearer <token>"
}
response = requests.get(url, headers=headers)
print(response.text)const options = {
method: 'GET',
headers: {'Replicas-Org-Id': '<replicas-org-id>', Authorization: 'Bearer <token>'}
};
fetch('https://api.replicas.dev/v1/workspaces/{workspaceId}/repo-files/search', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.replicas.dev/v1/workspaces/{workspaceId}/repo-files/search",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Replicas-Org-Id: <replicas-org-id>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.replicas.dev/v1/workspaces/{workspaceId}/repo-files/search"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Replicas-Org-Id", "<replicas-org-id>")
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.replicas.dev/v1/workspaces/{workspaceId}/repo-files/search")
.header("Replicas-Org-Id", "<replicas-org-id>")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.replicas.dev/v1/workspaces/{workspaceId}/repo-files/search")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Replicas-Org-Id"] = '<replicas-org-id>'
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"files": [
{
"repoName": "<string>",
"path": "<string>",
"displayPath": "<string>",
"status": "changed",
"score": 123,
"indexedAt": "2023-11-07T05:31:56Z",
"stale": true
}
],
"nextCursor": "<string>",
"indexedAt": "2023-11-07T05:31:56Z",
"stale": true,
"refreshing": true,
"truncated": true,
"unsupported": true
}{
"error": "<string>",
"details": "<string>",
"code": "<string>"
}{
"error": "<string>",
"details": "<string>",
"code": "<string>"
}{
"error": "<string>",
"details": "<string>",
"code": "<string>"
}{
"error": "<string>"
}Search Workspace Files
Lists repository file paths without waking the workspace. Requires a logged-in user JWT and Replicas-Org-Id. Workspace indexes are cached for seven days; active workspaces serve cached results immediately and refresh indexes older than 30 seconds in the background. Without a saved index, inactive workspaces use GitHub/GitLab default-branch trees cached for five minutes. Fallbacks may omit workspace-only files. Failed refreshes or mixed engine page versions preserve the last complete index. Follow nextCursor until null; if indexedAt changes, discard accumulated pages and restart without refresh. Poll only while refreshing is true. File contents still require the engine.
curl --request GET \
--url https://api.replicas.dev/v1/workspaces/{workspaceId}/repo-files/search \
--header 'Authorization: Bearer <token>' \
--header 'Replicas-Org-Id: <replicas-org-id>'import requests
url = "https://api.replicas.dev/v1/workspaces/{workspaceId}/repo-files/search"
headers = {
"Replicas-Org-Id": "<replicas-org-id>",
"Authorization": "Bearer <token>"
}
response = requests.get(url, headers=headers)
print(response.text)const options = {
method: 'GET',
headers: {'Replicas-Org-Id': '<replicas-org-id>', Authorization: 'Bearer <token>'}
};
fetch('https://api.replicas.dev/v1/workspaces/{workspaceId}/repo-files/search', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.replicas.dev/v1/workspaces/{workspaceId}/repo-files/search",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Replicas-Org-Id: <replicas-org-id>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.replicas.dev/v1/workspaces/{workspaceId}/repo-files/search"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Replicas-Org-Id", "<replicas-org-id>")
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.replicas.dev/v1/workspaces/{workspaceId}/repo-files/search")
.header("Replicas-Org-Id", "<replicas-org-id>")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.replicas.dev/v1/workspaces/{workspaceId}/repo-files/search")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Replicas-Org-Id"] = '<replicas-org-id>'
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"files": [
{
"repoName": "<string>",
"path": "<string>",
"displayPath": "<string>",
"status": "changed",
"score": 123,
"indexedAt": "2023-11-07T05:31:56Z",
"stale": true
}
],
"nextCursor": "<string>",
"indexedAt": "2023-11-07T05:31:56Z",
"stale": true,
"refreshing": true,
"truncated": true,
"unsupported": true
}{
"error": "<string>",
"details": "<string>",
"code": "<string>"
}{
"error": "<string>",
"details": "<string>",
"code": "<string>"
}{
"error": "<string>",
"details": "<string>",
"code": "<string>"
}{
"error": "<string>"
}Authorizations
Logged-in user-session JWT authentication for first-party clients. Org-scoped requests also require the Replicas-Org-Id header. User JWTs cannot create workspaces with POST /v1/replica.
Headers
Organization UUID containing the workspace.
Path Parameters
Query Parameters
Filename or path search; empty lists all indexed files.
Restrict results to repository-relative paths starting with this prefix.
Page size. Out-of-range integers are clamped to 1–5,000.
1 <= x <= 5000Opaque nextCursor from the previous page. Keep q, prefix, and limit unchanged.
On the first page, true waits for an active engine refresh. Does not wake inactive workspaces. On failure, a saved index or repository fallback may still be returned as stale.
Response
Live, cached, or repository-fallback file paths.
Show child attributes
Show child attributes
Opaque cursor for the next page; null when pagination is complete.
Index version. Discard accumulated pages and restart without refresh if this value changes between pages.
Results are cached or from a repository fallback and may not reflect the current workspace. Does not by itself mean a refresh is pending.
A background workspace index refresh is pending. Poll only while true; inactive fallback results do not enable polling.
Index is incomplete due to provider limits, index caps, or unavailable repositories; independent of nextCursor.
Optional compatibility flag indicating repository file search is unsupported.