Skip to main content
The v3 SDK (@aui.io/aui-client@^3) is a ground-up rewrite of v2 (^1.2.x): tasks became threads, the single client split in two, and the agent now rides your key. This page is the exact before/after for every call and response — 10 methods mapped, 2 removed, 1 changed meaning.

What changed at a glance

Two substitutions do most of the work: every task_id becomes a thread_id, and every client.controllerApi.X moves onto one of two new clients.
Areav2v3
Core modelOne Task holds the whole conversationThread → Interaction → Message
ClientOne ApolloClientApolloMessagingClient + ApolloManagementClient
SurfaceEverything under controllerApi.*messaging, channels, threads, projects, agents, agentVersions
AuthOne networkApiKeyPublishable key (browser) + org API key (server)
AgentPassed per callEncoded in the key (REST); explicit on WebSocket
Environmentazure/gcp × v2/v3 URL matrixProduction default; optional baseUrl
TypingLoose — as unknown as TFully typed Apollo.* responses

Connecting & authentication

The single client was split by who may hold the credential. The messaging client is browser-safe; the management client is server-side only.
v2 — one client, one key
v3 — two scoped clients
The publishable key authenticates for you. It is exchanged for a short-lived bearer token automatically — you no longer set x-network-api-key headers anywhere, including on the WebSocket. The organization key is sent as x-organization-api-key and must never reach a browser.

What went away

The azure/gcp × v2/v3 URL matrix is gone — both clients default to production. Pass baseUrl only to target a different host. Per-call timeoutInSeconds and retries moved from the constructor into each method’s requestOptions (last argument); set a generous timeout on the aggregating list endpoints, which can be slow.

Method map

Below, messaging is an ApolloMessagingClient and management is an ApolloManagementClient. Messaging methods hang off the .messaging sub-resource.
v2 callv3 callClient
createTask()removed — threads auto-create
listUserTasks()threads.listThreads()Management
getTaskMessages()threads.getThreadMessages() · messaging.listMessages()Both
sendMessage()messaging.sendMessage()Messaging
startTextConversation()channels.initiateThread()Messaging
getAgentContext()meaning changedsee below
getDirectFollowupSuggestions()messaging.generateFollowupSuggestions()Messaging
getTraceInfo()threads.getThreadTrace() · getInteractionTrace()Both
getProductMetadata()removed — no replacement
apolloWsSession.connect()messaging.connect()Messaging

Method by method

Create Task — removed

There is no createTask. A thread is created the first time you talk to the agent without a thread_id — capture it from the response.
v2
v3

List User Tasks — threads · management

The user filter moved into filters, and pagination is now cursor-based (page[size] / page[after]) instead of page/size.
v2
v3

Get Task Messages — both clients

Same data, two entry points depending on which key you hold. Both return Apollo.Message[].
v2
v3

Send Message (REST) — signature changed

user_id is now required. task_id → optional thread_id. is_external_api and agent_id are gone (the agent rides the key). The reply is now nested under .message.
v2
v3

Start Text Conversation — channels · messaging

channel is now positional, fields are snake_case, and message splits by channel: SMS uses text; WhatsApp uses templates via agent_display_name.
v2
v3

Get Agent Context — meaning changed

Not a drop-in rename. v2 returned the agent’s content configuration for a task (params, entities, static_context). v3 getContext() returns what your key resolves to — it is an auth-scope helper. The old configuration now lives in the agent version, managed via management.agentVersions.*.
v2 — agent config for a task
v3 — key scope (different!)

Follow-up Suggestions — signature changed

No longer keyed by a task id — you pass a context object. Returns an object, not a bare string[]. (Threads and messages also carry followup_suggestions inline, so you often need no separate call.)
v2
v3

Get Trace Info — both clients

Split into a whole-thread trace and a single-interaction trace. interactionId is the successor to the old per-message id.
v2
v3

Get Product Metadata — removed

getProductMetadata({ link }) has no equivalent in the v3 public surface. Remove these calls.

WebSocket

The socket was rewritten: no manual auth headers, a typed received envelope, and a renamed send method.
v2v3
OpenapolloWsSession.connect({ headers })messaging.connect() — no headers
Readyon('open')await socket.waitForOpen()
SendsendUserMessage({ task_id, text })sendMessage({ type: 'message', agent_id, … })
Receivedchannel-shaped object{ type, data, seq }
v2
v3
WebSocket gotchas. agent_id is still required on the socket even though REST sendMessage dropped it. on() replaces a handler — register each event once. The submit method was renamed sendSubmitMessagesendMessage in v3.2.2; if you span patch versions, dispatch on whichever exists.

Response shapes

Responses are fully typed now — delete the v2-era as unknown as T casts. The Message object below is what you read from sendMessage, listMessages, getThreadMessages, and the WS terminal frame.
New in v3, no v2 equivalent: the Management APIs (projects, agents, agentVersions), SSE streaming via messaging.streamMessage(), messaging.rerun(), messaging.getWelcomeMessage(), and threads.updateThread().

Migration checklist

Work top to bottom.
  • Bump the dependency to @aui.io/aui-client@^3.
  • Replace new ApolloClient() with ApolloMessagingClient (browser) and/or ApolloManagementClient (server).
  • Swap the single networkApiKey for a publishable key and/or org API key — never ship the org key to a browser.
  • Delete the environment/URL matrix; rely on the production default (or set baseUrl to override).
  • Rename every task_idthread_id; stop calling createTask and capture thread_id from the first response.
  • Update sendMessage: add required user_id, drop is_external_api/agent_id, read the reply from res.message.
  • Move startTextConversationchannels.initiateThread(channel, { phone_number, text? }).
  • Re-point listUserTasksthreads.listThreads({ filters: { user_id } }) and read results (cursor pagination).
  • Replace getTraceInfo with getThreadTrace / getInteractionTrace.
  • Audit getAgentContextgetContext() is not the same thing.
  • Remove getProductMetadata calls (no replacement).
  • Rewrite the WebSocket: messaging.connect(), no auth headers, branch on env.type, send with sendMessage({ type: 'message', agent_id }).
  • Move per-call timeoutInSeconds into requestOptions; set a generous timeout on list endpoints.
  • Drop as unknown as casts — responses are typed.