> For clean Markdown of any page, append .md to the page URL. > For a complete documentation index, see https://docs.livingbrain.com/api-reference/workspace/prompt-index/llms.txt. > For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.livingbrain.com/_mcp/server. # Prompt index GET https://api.livingbrain.com/v1/brains/{brainId}/index Return a compact index of the brain's top pages, formatted for injection into an LLM prompt. This is the intended way to give an agent working context without sending the whole brain. Reference: https://docs.livingbrain.com/api-reference/workspace/prompt-index ## Authentication - `x-api-key` header (required) — Your Living Brain API key. Create one from the dashboard; keys are scoped to an organization and carry the role of the member they were issued to. ## Request ### Path parameters - `brainId` (string, required) — Brain id ### Query parameters - `limit` (integer, optional) ## Response ### 200 - `list of BrainIndexEntryDto` ## Errors ### 400 Bad Request Error Validation failed (e.g. empty title/body, slug already in use) - `statusCode` (integer, required) — HTTP status code - `timestamp` (string, required) — ISO timestamp of the failure - `path` (string, required) — Request path (query string stripped) - `message` (string, required) — Human-readable error message - `body` (ErrorResDtoBody, optional) — Original framework exception response when available, e.g. `{ statusCode, message, error }` with per-field validation messages ### 401 Unauthorized Error Unauthorized - `statusCode` (integer, required) — HTTP status code - `timestamp` (string, required) — ISO timestamp of the failure - `path` (string, required) — Request path (query string stripped) - `message` (string, required) — Human-readable error message - `body` (ErrorResDtoBody, optional) — Original framework exception response when available, e.g. `{ statusCode, message, error }` with per-field validation messages ### 404 Not Found Error Brain, page, change, or connection not found - `statusCode` (integer, required) — HTTP status code - `timestamp` (string, required) — ISO timestamp of the failure - `path` (string, required) — Request path (query string stripped) - `message` (string, required) — Human-readable error message - `body` (ErrorResDtoBody, optional) — Original framework exception response when available, e.g. `{ statusCode, message, error }` with per-field validation messages ## Types ### BrainIndexEntryDto - `slug` (string, required) — URL-safe identifier, unique within the brain. - `title` (string, required) — Human-readable title. - `summary` (string, required) — Summary truncated to 160 chars - `pageType` (enum, required) — What kind of knowledge this page holds. - Allowed values: `source`, `topic`, `entity`, `project`, `decision`, `brief` - `pinned` (boolean, required) — Pinned entries are placed first in the prompt index. - `status` (enum, required) — Lifecycle state. Deprecated and archived items are hidden from listings by default. - Allowed values: `active`, `deprecated`, `stale`, `contested`, `archived` ### ErrorResDtoBody Original framework exception response when available, e.g. `{ statusCode, message, error }` with per-field validation messages ## Examples **Response** ```json [ { "slug": "string", "title": "string", "summary": "string", "pageType": "source", "pinned": true, "status": "active" } ] ``` **SDK Code** ```python import requests url = "https://api.livingbrain.com/v1/brains/brainId/index" headers = {"x-api-key": ""} response = requests.get(url, headers=headers) print(response.json()) ``` ```javascript const url = 'https://api.livingbrain.com/v1/brains/brainId/index'; const options = {method: 'GET', headers: {'x-api-key': ''}}; try { const response = await fetch(url, options); const data = await response.json(); console.log(data); } catch (error) { console.error(error); } ``` ```go package main import ( "fmt" "net/http" "io" ) func main() { url := "https://api.livingbrain.com/v1/brains/brainId/index" req, _ := http.NewRequest("GET", url, nil) req.Header.Add("x-api-key", "") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := io.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body)) } ``` ```ruby require 'uri' require 'net/http' url = URI("https://api.livingbrain.com/v1/brains/brainId/index") http = Net::HTTP.new(url.host, url.port) http.use_ssl = true request = Net::HTTP::Get.new(url) request["x-api-key"] = '' response = http.request(request) puts response.read_body ``` ```java import com.mashape.unirest.http.HttpResponse; import com.mashape.unirest.http.Unirest; HttpResponse response = Unirest.get("https://api.livingbrain.com/v1/brains/brainId/index") .header("x-api-key", "") .asString(); ``` ```php request('GET', 'https://api.livingbrain.com/v1/brains/brainId/index', [ 'headers' => [ 'x-api-key' => '', ], ]); echo $response->getBody(); ``` ```csharp using RestSharp; var client = new RestClient("https://api.livingbrain.com/v1/brains/brainId/index"); var request = new RestRequest(Method.GET); request.AddHeader("x-api-key", ""); IRestResponse response = client.Execute(request); ``` ```swift import Foundation let headers = ["x-api-key": ""] let request = NSMutableURLRequest(url: NSURL(string: "https://api.livingbrain.com/v1/brains/brainId/index")! as URL, cachePolicy: .useProtocolCachePolicy, timeoutInterval: 10.0) request.httpMethod = "GET" request.allHTTPHeaderFields = headers let session = URLSession.shared let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in if (error != nil) { print(error as Any) } else { let httpResponse = response as? HTTPURLResponse print(httpResponse) } }) dataTask.resume() ```