App öffnen
Moonborn — API · chat

List active+ended sessions for a persona within the caller workspace

GET/v1/personas/{id}/chat/sessionsscope · Bearer (API key or session JWT)
Path parameters
FieldTypeDescription
idreqstringPersona id (e.g. `psn_*`).
Query parameters
FieldTypeDescription
cursorstringOpaque pagination cursor; omit for the first page.
limitnumberPage size (1-100; default 20).

Responses

200OK
Body
FieldTypeDescription
itemsreqobject[]
nextCursorreqstring
401Unauthenticated
Body
FieldTypeDescription
errorreqobject
error.codereqstring
error.messagereqstring
404Persona not found
Body
FieldTypeDescription
errorreqobject
error.codereqstring
error.messagereqstring

Examples

cURL
curl -X GET https://api.moonborn.co/v1/personas/<id>/chat/sessions \
  -H "Authorization: Bearer $MOONBORN_API_KEY"
TypeScript
import Moonborn from '@moonborn/sdk';

const client = new Moonborn({ apiKey: process.env.MOONBORN_API_KEY });

const result = await client.chat.listChatSessionsForPersona({
  id: '<id>',
});
Python
import os
from moonborn import Moonborn

client = Moonborn(api_key=os.environ["MOONBORN_API_KEY"])

result = client.chat.list_chat_sessions_for_persona(
    id="<id>",
)