Get a code search
One search in full: what it found for the team, the brief the agent was allowed to give the customer, the evidence, and every command it ran.
GET
/mode/searches/{id}Authorization
AuthorizationBearer token · headerrequired`MEDIAN_KEY` from Settings under API, or an MCP OAuth access token. A key acts as the organization; a token acts as the person who approved it.
Path parameters
idstringrequiredA code search id.
Responses
200The search.
searchCodeSearchShow propertiesHide properties
idstringquestionstringWhat the support agent asked Mode to find out.
statusstringAllowed:
runningdonefailedverdictstring | nullAllowed:
bugknowledgenothingunclearnullreposstring[]The codebases it read, as owner/repo.
conversationIdstring | nullsignalobject | nullThe bug it filed, when it confirmed one.
Show propertiesHide properties
idstringtitlestringfiledKnowledgebooleanWhether it filed a knowledge suggestion for review.
startedAtintegerfinishedAtinteger | nullsummarystring | nullWhat it found, for the team. May name files and functions.
briefstring | nullWhat the agent was allowed to tell the customer.
evidenceobject[]Show propertiesHide properties
Array of
objectpathstringstartLineintegerendLineintegernotestringstepsobject[]Show propertiesHide properties
Array of
objectcommandstringexitCodeintegeroutputstringThe start of what it printed.
errorstring | nullconversationSubjectstring | null401The bearer token is missing, revoked, or expired.
errorobjectShow propertiesHide properties
codestringmessagestring404Not one of yours, or not there at all.
errorobjectShow propertiesHide properties
codestringmessagestring429Too many requests. Wait the seconds in `Retry-After`. Limits depend on the plan. See [rate limits](/api/errors-and-limits#rate-limits).
errorobjectShow propertiesHide properties
codestringmessagestringRequest
curl -X GET "https://api.median.sh/v1/mode/searches/string" \
-H "Authorization: Bearer YOUR_TOKEN"const response = await fetch("https://api.median.sh/v1/mode/searches/string", {
method: "GET",
headers: {
"Authorization": "Bearer YOUR_TOKEN"
}
});Response
{
"search": {
"id": "string",
"question": "string",
"status": "running",
"verdict": "bug",
"repos": [
"string"
],
"conversationId": "string",
"signal": {
"id": "string",
"title": "string"
},
"filedKnowledge": true,
"startedAt": 0,
"finishedAt": 0
},
"summary": "string",
"brief": "string",
"evidence": [
{
"path": "string",
"startLine": 0,
"endLine": 0,
"note": "string"
}
],
"steps": [
{
"command": "string",
"exitCode": 0,
"output": "string"
}
],
"error": "string",
"conversationSubject": "string"
}{
"error": {
"code": "string",
"message": "string"
}
}{
"error": {
"code": "string",
"message": "string"
}
}{
"error": {
"code": "string",
"message": "string"
}
}