persona.threads (sync) / await persona.threads (async) wraps /api/v1/developer/threads.
Methods
Async: identical methods with
await.
create(input)
CreateThreadInput is just {"agentId": str} — the Agent this Thread’s conversation is with.
You don’t need to call this before chatting. chat.send_message()/chat.stream() create an
implicit deterministic Thread automatically (one conversation per Agent per user). Call
threads.create() only when you want an explicit, listable Thread up front — for example, to
give it a title or to persist it before the first message.
list(params=None)
Lists the asserted external user’s own Threads, most recently active first. ListThreadsParams
(all optional): page (default 1), limit (default 20).
agentId is populated as {"_id", "name", "avatar", "slug"} here — unlike
create()/get(), which return a bare id string. (Check which call produced the value before
assuming a shape.)
get(thread_id) and update(thread_id, input)
get() fetches a single Thread (bare agentId). update() is the general form —
UpdateThreadInput = {"title"?: str, "isArchived"?: bool}, both optional — send just the one you
want to change:
update_title(thread_id, title) is a convenience wrapper over update() for the common
title-only case.
get_messages(thread_id)
Fetches the full message history + graph state for a Thread — the same data chat.stream() would
resume from.
ThreadMessages: {"messages": list[Any], "state": dict[str, Any], "subagentTraces": dict[str, Any]}. messages holds raw LangChain-style message objects (role/content/tool_calls
vary by message type) and is intentionally typed as list[Any] rather than guessing at a shape
the SDK doesn’t own — inspect it at runtime if you need to render history yourself, or prefer
chat.stream()’s events for anything you’re building a live UI around.
delete(thread_id) and bulk_delete(ids)
delete() removes the Thread and its message history. bulk_delete(ids) is best-effort — partial
failures don’t raise or abort the rest of the batch; check failed for per-id reasons. Up to 100
ids per call.
Types
See Types — Thread types for the full field reference:Thread, ThreadAgentRef, CreateThreadInput, UpdateThreadInput, ListThreadsParams,
ThreadMessages.
Threaduses the raw_idshape.Thread["threadId"]is the deterministic AG-UI thread id used for streaming (x-thread-id) — distinct from_id.Thread["agentId"]: populated object onlist(), bare id oncreate()/get()(see above).