Export a session
GET /v1/sessions/{sessionId}/export
The whole session as one JSON attachment (SessionExport), for its owner and for those it is shared with. Reads only what is recorded; never starts the sandbox. Not a format to resume the session from.
Authorizations
Parameters
Path Parameters
Responses
200
Success
A session in one file, for support or another agent to read. Not a format to resume the session from.
object
The version of this contract the objects follow.
Milliseconds since the epoch, as a string.
object
Milliseconds since the epoch, as a string.
Milliseconds since the epoch, as a string.
Run state. Open: idle | working | stopping.
object
Fork boundary: at inherits history through entryId; before inherits history before it. Open: at | before.
object
Sent to Bkper AI as it is. Without one, its default for the model applies.
Current conversation.
object
This conversation only; inherited history is not counted again.
object
USD estimate from catalog prices; Bkper AI accounting is authoritative.
object
Present when set. Without it the agent runs with Bkper’s base only.
Whether the owner shares this session with its audience, read-only.
The Book the session was started in: its first input’s bookContext. Fixed once set; absent when that input had none.
Present when the session is someone else’s, shared with the caller: the caller can read and continue it, never change it.
object
The owner’s display name, as Bkper verified it.
Present when the session was copied from another person’s shared session, to continue it as the caller’s own. The original is unchanged; the copy carries its history, not its files or instructions. Such a session has no parent.
object
Where the copy ends: through entryId, or before it. Open: at | before.
object
The original’s owner, as Bkper verified them when copied.
Every entry in full, never clipped, oldest first: history inherited from a fork or copied from a shared session included.
Immutable transcript entry. Clients ignore unknown fields and render unknown types generically.
object
Milliseconds since the epoch, as a string.
Entry type. Open: user | assistant | tool_result | compaction.
object
Up to 16 string attributes of the message, such as its sender, channel or thread, at most 16000 characters in total. Names start with a letter, then up to 63 letters, digits, _, . or -. Advisory data for the agent, frozen with the input: never identity, permission or instructions.
object
User: text and attached file parts; assistant: text, thinking and tool_call blocks; tool_result: text parts, and a file part from publish. A tool_call has callId, name and arguments as the agent sent them, and a summary when the agent named the step in a few plain words for people.
Typed part; text is { type: “text”, text }. Open.
object
Assistant outcome. Open: completed | incomplete.
Why incomplete. Open: cancelled | inference_failed | interrupted.
Sanitized failure. Never contains provider, AI or credential text.
object
Assistant: milliseconds from createdAt until the response ended; tool_result: milliseconds the tool ran. Absent when not measured.
object
Compaction trigger. Open: manual | threshold | overflow.
Large strings were shortened; GET the entry for its full content.
The files the session holds, without their contents, oldest first: attached to its own inputs or published by it, and those its history shows, inherited fork history included. Files of messages copied from another person’s session stay theirs: only the entries’ file parts name them.
An immutable private copy of a file, kept for 30 days. Only its owner can read or download it, and, through the session routes, those a session that holds it is shared with.
object
Uploaded by the user, or published by the agent. Open: upload | publish.
The session that published it. Absent on uploads, which belong to the user.
Published: the allowlisted type for its name. Uploaded: as declared by the uploader, unverified. Downloads always use the allowlisted type for the name; anything else is application/octet-stream.
Bytes.
Hex SHA-256 of the content.
Milliseconds since the epoch, as a string.
When the stored copy is deleted, 30 days after creation. Then downloads are 410 file_gone.
The session’s own inputs, oldest first.
object
The Idempotency-Key.
Milliseconds since the epoch, as a string.
What ran it, when recorded: absent for inputs from before versions were recorded.
object
The Agent’s deployed version.
The bkper CLI version in the sandbox.
400
Rejected; never contains credentials or upstream payloads.
object
object
Stable code, e.g. not_found, idempotency_conflict, session_working, usage_limit_exceeded. Open.
Category, e.g. invalid_request_error, authentication_error, usage_limit_error. Open.
Host_in_use: the host another service holds.
Host_in_use: the id of the service that holds the host.
401
Rejected; never contains credentials or upstream payloads.
object
object
Stable code, e.g. not_found, idempotency_conflict, session_working, usage_limit_exceeded. Open.
Category, e.g. invalid_request_error, authentication_error, usage_limit_error. Open.
Host_in_use: the host another service holds.
Host_in_use: the id of the service that holds the host.
403
Rejected; never contains credentials or upstream payloads.
object
object
Stable code, e.g. not_found, idempotency_conflict, session_working, usage_limit_exceeded. Open.
Category, e.g. invalid_request_error, authentication_error, usage_limit_error. Open.
Host_in_use: the host another service holds.
Host_in_use: the id of the service that holds the host.
404
Rejected; never contains credentials or upstream payloads.
object
object
Stable code, e.g. not_found, idempotency_conflict, session_working, usage_limit_exceeded. Open.
Category, e.g. invalid_request_error, authentication_error, usage_limit_error. Open.
Host_in_use: the host another service holds.
Host_in_use: the id of the service that holds the host.
409
Rejected; never contains credentials or upstream payloads.
object
object
Stable code, e.g. not_found, idempotency_conflict, session_working, usage_limit_exceeded. Open.
Category, e.g. invalid_request_error, authentication_error, usage_limit_error. Open.
Host_in_use: the host another service holds.
Host_in_use: the id of the service that holds the host.
410
Rejected; never contains credentials or upstream payloads.
object
object
Stable code, e.g. not_found, idempotency_conflict, session_working, usage_limit_exceeded. Open.
Category, e.g. invalid_request_error, authentication_error, usage_limit_error. Open.
Host_in_use: the host another service holds.
Host_in_use: the id of the service that holds the host.
411
Rejected; never contains credentials or upstream payloads.
object
object
Stable code, e.g. not_found, idempotency_conflict, session_working, usage_limit_exceeded. Open.
Category, e.g. invalid_request_error, authentication_error, usage_limit_error. Open.
Host_in_use: the host another service holds.
Host_in_use: the id of the service that holds the host.
413
Rejected; never contains credentials or upstream payloads.
object
object
Stable code, e.g. not_found, idempotency_conflict, session_working, usage_limit_exceeded. Open.
Category, e.g. invalid_request_error, authentication_error, usage_limit_error. Open.
Host_in_use: the host another service holds.
Host_in_use: the id of the service that holds the host.
503
Rejected; never contains credentials or upstream payloads.
object
object
Stable code, e.g. not_found, idempotency_conflict, session_working, usage_limit_exceeded. Open.
Category, e.g. invalid_request_error, authentication_error, usage_limit_error. Open.
Host_in_use: the host another service holds.
Host_in_use: the id of the service that holds the host.