Before you begin
Before you start, make sure you have:- Bearer credential and shell variables:
ATLAN_GATEWAY_URLandATLAN_TOKENset in your shell. See Connect to Agent Registry. - Agent ID: The
AGENT_IDof a registered agent. See Register an agent if you do not have one. - Workspace ID: The
WORKSPACE_IDthe agent belongs to.
AGENT_ID is set before continuing:
Record your session
These calls create the session record, add its transcript, and confirm both are stored. Run them in order: the session must exist before you can append messages to it.1
Create your session record
A session record holds the metadata for one agent run: which agent ran, in
which workspace, when it ran, and how it ended. Use the original execution
time for Copy the session
source_created_at, not the current time. The Registry uses this
field to represent when the run actually happened.id from the response. You need it for every call
in this guide.2
Append your transcript
Messages are the actual conversation the agent had.
sequence_number fixes
the order and is zero-based. Send the user turn first, then the assistant
reply.3
Read your session back
A successful create response confirms the Registry accepted the request. A
read back by ID confirms the session and its messages are stored and
accessible to your credential.Confirm the session shows the correct agent, workspace, and status.
Confirm the messages list shows both turns in the right order. If either
read returns an error, see
Errors and retries before
continuing.
4
Save your session ID
Export the session ID so it is ready without a lookup later: