JavaScript
import Mobilerun from '@mobilerun/sdk';
const client = new Mobilerun({
apiKey: process.env['MOBILERUN_CLOUD_API_KEY'], // This is the default and can be omitted
});
const conversations = await client.assistant.conversations.list();
console.log(conversations.sessions);import os
from mobilerun_sdk import Mobilerun
client = Mobilerun(
api_key=os.environ.get("MOBILERUN_CLOUD_API_KEY"), # This is the default and can be omitted
)
conversations = client.assistant.conversations.list()
print(conversations.sessions)curl --request GET \
--url https://api.mobilerun.ai/v1/assistant/chat/sessions \
--header 'Authorization: Bearer <token>'<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.mobilerun.ai/v1/assistant/chat/sessions",
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>"
],
]);
$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.mobilerun.ai/v1/assistant/chat/sessions"
req, _ := http.NewRequest("GET", url, nil)
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.mobilerun.ai/v1/assistant/chat/sessions")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.mobilerun.ai/v1/assistant/chat/sessions")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"sessions": [
{
"agent": "<string>",
"basePromptTokens": 123,
"contextExhaustedAt": "<string>",
"costCents": 123,
"costUsd": 123,
"createdAt": "<string>",
"description": "<string>",
"episode": 2,
"id": "<string>",
"kind": "chat",
"lastActiveAt": "<string>",
"peakPromptTokens": 123,
"pinned": true,
"promptStatus": "ready",
"sourceExecutionId": null,
"status": "<string>",
"title": "<string>",
"turnActive": true,
"turnStartedAt": "<string>",
"workflowId": null,
"createdBy": "<string>"
}
]
}Chat
List the user's named chat or agent-workflow sessions
Default (kind absent or chat): active named chat sessions, pinned first then most recent activity — workflowId must be absent, or the request 400s. mine=true (only valid with kind=chat) narrows to sessions the caller created. kind=agent_workflow: workflow-linked sessions for one workflow (workflowId required, or the request 400s), no status filter, newest episode first.
GET
/
assistant
/
chat
/
sessions
JavaScript
import Mobilerun from '@mobilerun/sdk';
const client = new Mobilerun({
apiKey: process.env['MOBILERUN_CLOUD_API_KEY'], // This is the default and can be omitted
});
const conversations = await client.assistant.conversations.list();
console.log(conversations.sessions);import os
from mobilerun_sdk import Mobilerun
client = Mobilerun(
api_key=os.environ.get("MOBILERUN_CLOUD_API_KEY"), # This is the default and can be omitted
)
conversations = client.assistant.conversations.list()
print(conversations.sessions)curl --request GET \
--url https://api.mobilerun.ai/v1/assistant/chat/sessions \
--header 'Authorization: Bearer <token>'<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.mobilerun.ai/v1/assistant/chat/sessions",
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>"
],
]);
$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.mobilerun.ai/v1/assistant/chat/sessions"
req, _ := http.NewRequest("GET", url, nil)
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.mobilerun.ai/v1/assistant/chat/sessions")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.mobilerun.ai/v1/assistant/chat/sessions")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"sessions": [
{
"agent": "<string>",
"basePromptTokens": 123,
"contextExhaustedAt": "<string>",
"costCents": 123,
"costUsd": 123,
"createdAt": "<string>",
"description": "<string>",
"episode": 2,
"id": "<string>",
"kind": "chat",
"lastActiveAt": "<string>",
"peakPromptTokens": 123,
"pinned": true,
"promptStatus": "ready",
"sourceExecutionId": null,
"status": "<string>",
"title": "<string>",
"turnActive": true,
"turnStartedAt": "<string>",
"workflowId": null,
"createdBy": "<string>"
}
]
}Authorizations
Bearer token via Authorization header
Query Parameters
Available options:
chat, agent_workflow Minimum string length:
1Available options:
true, false Response
Sessions for the requested kind
- Option 1
- Option 2
Show child attributes
Show child attributes
Was this page helpful?
⌘I