> For clean Markdown of any page, append .md to the page URL. > For a complete documentation index, see https://docs.whizcozy.com/api-reference/whiz-board-api/file-ai/get-file-ai-chat-messages-api-v-1-firms-firm-slug-ai-chat-sessions-session-id-messages-get/llms.txt. > For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.whizcozy.com/_mcp/server. # Get File Ai Chat Messages GET https://prod-whizboard-be-680473615767.asia-southeast1.run.app/api/v1/firms/{firm_slug}/ai/chat/sessions/{session_id}/messages Reference: https://docs.whizcozy.com/api-reference/whiz-board-api/file-ai/get-file-ai-chat-messages-api-v-1-firms-firm-slug-ai-chat-sessions-session-id-messages-get ## Authentication - `Authorization` header (required) — API Key authentication via header ## Request ### Path parameters - `session_id` (integer, required) - `firm_slug` (string, required) ## Response ### 200 Successful Response - `data` (FileAIChatMessageListResponse, required) - `status` (string, optional, default: success) ## Errors ### 422 Unprocessable Entity Error Validation Error - `detail` (list of ValidationError, optional) ## Types ### FileAIChatMessageListResponse - `session` (FileAIChatSessionResponse, required) - `messages` (list of FileAIChatMessageResponse, required) ### ValidationError - `loc` (list of ValidationErrorLocItems, required) - `msg` (string, required) - `type` (string, required) - `input` (any, optional) - `ctx` (ValidationErrorCtx, optional) ### FileAIChatSessionResponse - `id` (integer, required) - `created_at` (datetime, required) - `updated_at` (datetime, required) - `title` (string, optional, nullable) - `latest_message` (FileAIChatMessageResponse, optional, nullable) ### FileAIChatMessageResponse - `id` (integer, required) - `session_id` (integer, required) - `role` (enum, required) - Allowed values: `user`, `assistant` - `content` (string, required) - `created_at` (datetime, required) - `selected_file_ids` (list of integer, optional) - `attachments` (list of FileAIChatAttachmentRef, optional) - `tool_calls` (list of FileAIChatToolEvent, optional) - `media` (list of FileAIChatMediaItem, optional) - `reasoning` (string, optional, nullable) ### ValidationErrorLocItems ### ValidationErrorCtx ### FileAIChatAttachmentRef - `file_id` (integer, required) - `filename` (string, required) - `download_url` (string, required) - `mime_type` (string, optional, nullable) - `source` (enum, optional, default: my_files) - Allowed values: `my_files`, `chat_upload` ### FileAIChatToolEvent - `name` (string, required) - `status` (enum, required) - Allowed values: `started`, `completed` - `args` (map from string to any, optional, nullable) - `result` (string, optional, nullable) - `media` (list of FileAIChatMediaItem, optional) - `warnings` (list of string, optional) - `notes` (list of string, optional) ### FileAIChatMediaItem - `kind` (enum, required) - Allowed values: `image`, `video`, `audio`, `document`, `data`, `file` - `url` (string, required) - `file_id` (integer, optional, nullable) - `mime_type` (string, optional, default: application/octet-stream) - `filename` (string, optional, nullable) - `description` (string, optional, nullable) ## Examples **Response** ```json { "data": { "session": { "id": 1, "created_at": "2024-01-15T09:30:00Z", "updated_at": "2024-01-15T09:30:00Z", "title": "string", "latest_message": { "id": 1, "session_id": 1, "role": "user", "content": "string", "created_at": "2024-01-15T09:30:00Z", "selected_file_ids": [ 1 ], "attachments": [ { "file_id": 1, "filename": "string", "download_url": "string", "mime_type": "string", "source": "my_files" } ], "tool_calls": [ { "name": "string", "status": "started", "args": {}, "result": "string", "media": [ { "kind": "image", "url": "string", "file_id": 1, "mime_type": "application/octet-stream", "filename": "string", "description": "string" } ], "warnings": [ "string" ], "notes": [ "string" ] } ], "media": [ { "kind": "image", "url": "string", "file_id": 1, "mime_type": "application/octet-stream", "filename": "string", "description": "string" } ], "reasoning": "string" } }, "messages": [ { "id": 1, "session_id": 1, "role": "user", "content": "string", "created_at": "2024-01-15T09:30:00Z", "selected_file_ids": [ 1 ], "attachments": [ { "file_id": 1, "filename": "string", "download_url": "string", "mime_type": "string", "source": "my_files" } ], "tool_calls": [ { "name": "string", "status": "started", "args": {}, "result": "string", "media": [ { "kind": "image", "url": "string", "file_id": 1, "mime_type": "application/octet-stream", "filename": "string", "description": "string" } ], "warnings": [ "string" ], "notes": [ "string" ] } ], "media": [ { "kind": "image", "url": "string", "file_id": 1, "mime_type": "application/octet-stream", "filename": "string", "description": "string" } ], "reasoning": "string" } ] }, "status": "success" } ``` **SDK Code** ```python import requests url = "https://prod-whizboard-be-680473615767.asia-southeast1.run.app/api/v1/firms/firm_slug/ai/chat/sessions/1/messages" headers = {"Authorization": ""} response = requests.get(url, headers=headers) print(response.json()) ``` ```javascript const url = 'https://prod-whizboard-be-680473615767.asia-southeast1.run.app/api/v1/firms/firm_slug/ai/chat/sessions/1/messages'; const options = {method: 'GET', headers: {Authorization: ''}}; 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://prod-whizboard-be-680473615767.asia-southeast1.run.app/api/v1/firms/firm_slug/ai/chat/sessions/1/messages" req, _ := http.NewRequest("GET", url, nil) req.Header.Add("Authorization", "") 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://prod-whizboard-be-680473615767.asia-southeast1.run.app/api/v1/firms/firm_slug/ai/chat/sessions/1/messages") http = Net::HTTP.new(url.host, url.port) http.use_ssl = true request = Net::HTTP::Get.new(url) request["Authorization"] = '' 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://prod-whizboard-be-680473615767.asia-southeast1.run.app/api/v1/firms/firm_slug/ai/chat/sessions/1/messages") .header("Authorization", "") .asString(); ``` ```php request('GET', 'https://prod-whizboard-be-680473615767.asia-southeast1.run.app/api/v1/firms/firm_slug/ai/chat/sessions/1/messages', [ 'headers' => [ 'Authorization' => '', ], ]); echo $response->getBody(); ``` ```csharp using RestSharp; var client = new RestClient("https://prod-whizboard-be-680473615767.asia-southeast1.run.app/api/v1/firms/firm_slug/ai/chat/sessions/1/messages"); var request = new RestRequest(Method.GET); request.AddHeader("Authorization", ""); IRestResponse response = client.Execute(request); ``` ```swift import Foundation let headers = ["Authorization": ""] let request = NSMutableURLRequest(url: NSURL(string: "https://prod-whizboard-be-680473615767.asia-southeast1.run.app/api/v1/firms/firm_slug/ai/chat/sessions/1/messages")! 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() ```