> For clean Markdown of any page, append .md to the page URL. > For a complete documentation index, see https://ref.scoutos.com/api-sdk/endpoints/agents/interact-sync-with-session/llms.txt. > For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://ref.scoutos.com/_mcp/server. # Interact in a session (sync) POST https://api.scoutos.com/world/{agent_id}/{session_id}/_interact_sync Content-Type: application/json Reference: https://ref.scoutos.com/api-sdk/endpoints/agents/interact-sync-with-session ## Authentication - `Authorization` header (bearer token, required) — Bearer authentication of the form `Bearer `, where token is your auth token. ## Request ### Path parameters - `agent_id` (string, required) - `session_id` (string, required, nullable) ### Body (application/json) This endpoint expects a src__app_http__routes__world__interact__InteractionRequest. - `messages` (list of IncomingMessage, required) — List of incoming user messages and drive file references. - `metadata` (map from string to any, optional) — Optional metadata (e.g., salesforce_session) - `variables` (map from string to any, optional) — Optional interaction-local variables for tool input interpolation. Keys are variable names; values may be any JSON. - `callback_url` (string, optional, nullable) — Optional callback URL. If provided, the interaction runs asynchronously and the response returns 202 with session_id + events_url. - `revision_id` (string, optional, nullable) - `tags` (list of string, optional, nullable) — Optional tags for categorizing this interaction in observability history. Max 20 tags, each up to 32 lowercase alphanumeric characters plus ':', '_', '-'. ## Response ### 200 Successful Response - `any` ## Errors ### 422 Unprocessable Entity Error Validation Error - `detail` (list of ValidationError, optional) ## Types ### IncomingMessage - `content` (IncomingMessageContent, required) — The content of the incoming message. May be plain text, a single 'drive_file' reference, or a list mixing the two. ### ValidationError - `loc` (list of ValidationErrorLocItems, required) - `msg` (string, required) - `type` (string, required) ### IncomingMessageContent The content of the incoming message. May be plain text, a single 'drive_file' reference, or a list mixing the two. ### ValidationErrorLocItems ### DriveFileMessage - `type` ("drive_file", required) — The type of entity: 'drive_file' - `path` (string, required) — Drive file path for 'drive_file' entities (e.g., '/Reports/Q1.pdf') ## Examples **Request** ```json { "messages": [ { "content": { "text": "Hello, can you provide the current weather update for New York City?" } } ] } ``` **SDK Code** ```python import requests url = "https://api.scoutos.com/world/agent_id/string/_interact_sync" payload = { "messages": [{ "content": { "text": "Hello, can you provide the current weather update for New York City?" } }] } headers = { "Authorization": "Bearer ", "Content-Type": "application/json" } response = requests.post(url, json=payload, headers=headers) print(response.json()) ``` ```typescript import { ScoutClient } from "scoutos"; const client = new ScoutClient({ apiKey: "YOUR_API_KEY" }); await client.agents.interactSyncWithSession("agent_id", "session_id", { messages: [{ content: "content" }] }); ``` ```go package main import ( "fmt" "strings" "net/http" "io" ) func main() { url := "https://api.scoutos.com/world/agent_id/string/_interact_sync" payload := strings.NewReader("{\n \"messages\": [\n {\n \"content\": {\n \"text\": \"Hello, can you provide the current weather update for New York City?\"\n }\n }\n ]\n}") req, _ := http.NewRequest("POST", url, payload) req.Header.Add("Authorization", "Bearer ") req.Header.Add("Content-Type", "application/json") 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.scoutos.com/world/agent_id/string/_interact_sync") http = Net::HTTP.new(url.host, url.port) http.use_ssl = true request = Net::HTTP::Post.new(url) request["Authorization"] = 'Bearer ' request["Content-Type"] = 'application/json' request.body = "{\n \"messages\": [\n {\n \"content\": {\n \"text\": \"Hello, can you provide the current weather update for New York City?\"\n }\n }\n ]\n}" response = http.request(request) puts response.read_body ``` ```java import com.mashape.unirest.http.HttpResponse; import com.mashape.unirest.http.Unirest; HttpResponse response = Unirest.post("https://api.scoutos.com/world/agent_id/string/_interact_sync") .header("Authorization", "Bearer ") .header("Content-Type", "application/json") .body("{\n \"messages\": [\n {\n \"content\": {\n \"text\": \"Hello, can you provide the current weather update for New York City?\"\n }\n }\n ]\n}") .asString(); ``` ```php request('POST', 'https://api.scoutos.com/world/agent_id/string/_interact_sync', [ 'body' => '{ "messages": [ { "content": { "text": "Hello, can you provide the current weather update for New York City?" } } ] }', 'headers' => [ 'Authorization' => 'Bearer ', 'Content-Type' => 'application/json', ], ]); echo $response->getBody(); ``` ```csharp using RestSharp; var client = new RestClient("https://api.scoutos.com/world/agent_id/string/_interact_sync"); var request = new RestRequest(Method.POST); request.AddHeader("Authorization", "Bearer "); request.AddHeader("Content-Type", "application/json"); request.AddParameter("application/json", "{\n \"messages\": [\n {\n \"content\": {\n \"text\": \"Hello, can you provide the current weather update for New York City?\"\n }\n }\n ]\n}", ParameterType.RequestBody); IRestResponse response = client.Execute(request); ``` ```swift import Foundation let headers = [ "Authorization": "Bearer ", "Content-Type": "application/json" ] let parameters = ["messages": [["content": ["text": "Hello, can you provide the current weather update for New York City?"]]]] as [String : Any] let postData = JSONSerialization.data(withJSONObject: parameters, options: []) let request = NSMutableURLRequest(url: NSURL(string: "https://api.scoutos.com/world/agent_id/string/_interact_sync")! as URL, cachePolicy: .useProtocolCachePolicy, timeoutInterval: 10.0) request.httpMethod = "POST" request.allHTTPHeaderFields = headers request.httpBody = postData as Data 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() ```