curl https://platform.u1.archetypeai.app/api/lens/sessions/metadata \
-H "Authorization: Bearer $ATAI_API_KEY"
curl "https://platform.u1.archetypeai.app/api/lens/sessions/metadata?session_id=lsn-250313c2177253cbaa7a73542edd90" \
-H "Authorization: Bearer $ATAI_API_KEY"
import requests
import os
api_key = os.environ.get("ATAI_API_KEY")
response = requests.get(
"https://platform.u1.archetypeai.app/api/lens/sessions/metadata",
headers={"Authorization": f"Bearer {api_key}"}
)
sessions = response.json()
if not sessions:
print("No active sessions")
else:
for session in sessions:
print(f"Session: {session['session_id']}")
print(f" Status: {session['session_status']}")
const response = await fetch('https://platform.u1.archetypeai.app/api/lens/sessions/metadata', {
headers: {
'Authorization': `Bearer ${process.env.ATAI_API_KEY}`
}
});
const sessions = await response.json();
if (sessions.length === 0) {
console.log('No active sessions');
} else {
sessions.forEach(session => {
console.log(`Session: ${session.session_id}`);
});
}
[
{
"session_id": "lsn-250313c2177253cbaa7a73542edd90",
"lens_id": "lns-fd669361822b07e2-237ab3ffd79199b1",
"last_update_timestamp": 1741843135.1848276,
"session_status": "SESSION_STATUS_RUNNING",
"session_runner": "lens_service:runner:lens-node-worker-node-abc123",
"session_endpoint": "wss://platform.u1.archetypeai.app/api/lens/sessions/lsn-250313c2177253cbaa7a73542edd90",
"session_index": 0,
"session_duration_sec": 2811.020206451416
}
]
[]
[]
{
"errors": [
{
"code": "unauthorized_request",
"message": "Unauthorized or invalid access.",
"suggestion": "Provide valid authentication credentials and ensure they have the required permissions.",
"error_uid": "err-xxxxxxxx"
}
]
}
{
"detail": [
{
"type": "int_parsing",
"loc": [
"query",
"shard_index"
],
"msg": "Input should be a valid integer, unable to parse string as an integer",
"input": "abc"
}
]
}
Lens API
Get Sessions Metadata
Get detailed metadata for all active lens sessions
GET
/
lens
/
sessions
/
metadata
curl https://platform.u1.archetypeai.app/api/lens/sessions/metadata \
-H "Authorization: Bearer $ATAI_API_KEY"
curl "https://platform.u1.archetypeai.app/api/lens/sessions/metadata?session_id=lsn-250313c2177253cbaa7a73542edd90" \
-H "Authorization: Bearer $ATAI_API_KEY"
import requests
import os
api_key = os.environ.get("ATAI_API_KEY")
response = requests.get(
"https://platform.u1.archetypeai.app/api/lens/sessions/metadata",
headers={"Authorization": f"Bearer {api_key}"}
)
sessions = response.json()
if not sessions:
print("No active sessions")
else:
for session in sessions:
print(f"Session: {session['session_id']}")
print(f" Status: {session['session_status']}")
const response = await fetch('https://platform.u1.archetypeai.app/api/lens/sessions/metadata', {
headers: {
'Authorization': `Bearer ${process.env.ATAI_API_KEY}`
}
});
const sessions = await response.json();
if (sessions.length === 0) {
console.log('No active sessions');
} else {
sessions.forEach(session => {
console.log(`Session: ${session.session_id}`);
});
}
[
{
"session_id": "lsn-250313c2177253cbaa7a73542edd90",
"lens_id": "lns-fd669361822b07e2-237ab3ffd79199b1",
"last_update_timestamp": 1741843135.1848276,
"session_status": "SESSION_STATUS_RUNNING",
"session_runner": "lens_service:runner:lens-node-worker-node-abc123",
"session_endpoint": "wss://platform.u1.archetypeai.app/api/lens/sessions/lsn-250313c2177253cbaa7a73542edd90",
"session_index": 0,
"session_duration_sec": 2811.020206451416
}
]
[]
[]
{
"errors": [
{
"code": "unauthorized_request",
"message": "Unauthorized or invalid access.",
"suggestion": "Provide valid authentication credentials and ensure they have the required permissions.",
"error_uid": "err-xxxxxxxx"
}
]
}
{
"detail": [
{
"type": "int_parsing",
"loc": [
"query",
"shard_index"
],
"msg": "Input should be a valid integer, unable to parse string as an integer",
"input": "abc"
}
]
}
Requires version 1.1.5 or later of the Archetype platform.
Overview
This endpoint returns detailed information about each active lens session in your organization.Request
Response
Returns an array of session objects, each containing:curl https://platform.u1.archetypeai.app/api/lens/sessions/metadata \
-H "Authorization: Bearer $ATAI_API_KEY"
curl "https://platform.u1.archetypeai.app/api/lens/sessions/metadata?session_id=lsn-250313c2177253cbaa7a73542edd90" \
-H "Authorization: Bearer $ATAI_API_KEY"
import requests
import os
api_key = os.environ.get("ATAI_API_KEY")
response = requests.get(
"https://platform.u1.archetypeai.app/api/lens/sessions/metadata",
headers={"Authorization": f"Bearer {api_key}"}
)
sessions = response.json()
if not sessions:
print("No active sessions")
else:
for session in sessions:
print(f"Session: {session['session_id']}")
print(f" Status: {session['session_status']}")
const response = await fetch('https://platform.u1.archetypeai.app/api/lens/sessions/metadata', {
headers: {
'Authorization': `Bearer ${process.env.ATAI_API_KEY}`
}
});
const sessions = await response.json();
if (sessions.length === 0) {
console.log('No active sessions');
} else {
sessions.forEach(session => {
console.log(`Session: ${session.session_id}`);
});
}
[
{
"session_id": "lsn-250313c2177253cbaa7a73542edd90",
"lens_id": "lns-fd669361822b07e2-237ab3ffd79199b1",
"last_update_timestamp": 1741843135.1848276,
"session_status": "SESSION_STATUS_RUNNING",
"session_runner": "lens_service:runner:lens-node-worker-node-abc123",
"session_endpoint": "wss://platform.u1.archetypeai.app/api/lens/sessions/lsn-250313c2177253cbaa7a73542edd90",
"session_index": 0,
"session_duration_sec": 2811.020206451416
}
]
[]
[]
{
"errors": [
{
"code": "unauthorized_request",
"message": "Unauthorized or invalid access.",
"suggestion": "Provide valid authentication credentials and ensure they have the required permissions.",
"error_uid": "err-xxxxxxxx"
}
]
}
{
"detail": [
{
"type": "int_parsing",
"loc": [
"query",
"shard_index"
],
"msg": "Input should be a valid integer, unable to parse string as an integer",
"input": "abc"
}
]
}
Was this page helpful?