Skip to main content
GET
/
api
/
assistants
/
threads
/
{agentId}
Retrieve session threads
curl --request GET \
  --url https://agent-service-511985928315.us-east4.run.app/api/assistants/threads/{agentId} \
  --header 'Authorization: Bearer <token>' \
  --header 'X-Envole-User-Id: <api-key>'
import requests

url = "https://agent-service-511985928315.us-east4.run.app/api/assistants/threads/{agentId}"

headers = {
"Authorization": "Bearer <token>",
"X-Envole-User-Id": "<api-key>"
}

response = requests.get(url, headers=headers)

print(response.text)
const options = {
method: 'GET',
headers: {Authorization: 'Bearer <token>', 'X-Envole-User-Id': '<api-key>'}
};

fetch('https://agent-service-511985928315.us-east4.run.app/api/assistants/threads/{agentId}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));
<?php

$curl = curl_init();

curl_setopt_array($curl, [
CURLOPT_URL => "https://agent-service-511985928315.us-east4.run.app/api/assistants/threads/{agentId}",
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>",
"X-Envole-User-Id: <api-key>"
],
]);

$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://agent-service-511985928315.us-east4.run.app/api/assistants/threads/{agentId}"

req, _ := http.NewRequest("GET", url, nil)

req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("X-Envole-User-Id", "<api-key>")

res, _ := http.DefaultClient.Do(req)

defer res.Body.Close()
body, _ := io.ReadAll(res.Body)

fmt.Println(string(body))

}
HttpResponse<String> response = Unirest.get("https://agent-service-511985928315.us-east4.run.app/api/assistants/threads/{agentId}")
.header("Authorization", "Bearer <token>")
.header("X-Envole-User-Id", "<api-key>")
.asString();
require 'uri'
require 'net/http'

url = URI("https://agent-service-511985928315.us-east4.run.app/api/assistants/threads/{agentId}")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
request["X-Envole-User-Id"] = '<api-key>'

response = http.request(request)
puts response.read_body
[
  {
    "id": "thread_456",
    "threadName": "Project Ideas",
    "agentId": "agent_abc",
    "agentName": "Demo Agent",
    "agentHandle": "demo-agent",
    "rootAgentBuildId": "build_123",
    "lastMessageTime": "2024-01-01T12:00:00Z",
    "sessionType": "LIVE"
  }
]
Fetch session threads for a specific agent.

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

X-Envole-User-Id
string
header
required

External user identifier; not necessarily registered with Envole

Path Parameters

agentId
string
required

Query Parameters

active
boolean

Response

A list of session threads.

id
string
threadName
string
agentId
string
agentName
string
agentHandle
string
rootAgentBuildId
string
lastMessageTime
string<date-time>
sessionType
enum<string>
Available options:
LIVE,
TESTING