Skip to main content
POST
Export session transcript

Restrictions

Usage

  • A personal session can be exported only by its creator; a team session by any member of the same account. Share links do not grant export. Missing or deleted sessions return ResourceNotFound.
  • The response is application/x-ndjson — parse it line by line and write it to a file instead of buffering the whole body.
  • The first line is always a session_meta object. Following lines carry a type of user_message, system_reminder, agent_text, tool_call, subagent_dispatch, llm_call, final_answer, or session_fork.
  • With include_subagents=true, each subagent_dispatch line is followed by the child session’s own stream, starting with its own session_meta.
  • The request times out after 60 seconds; a very large session may not finish exporting within that window.
  • If export fails after streaming has started, the body ends with a {"type":"error","content":"..."} line instead of an error envelope — check the last line to detect truncation.

Authorizations

app_key
string
query
required

APP Key created in the Flashduty console under My → APP Key. Send it as the app_key query parameter or in the Fd-App-Key request header. Its effective access is the intersection of the key's permission scope and the creator's current role permissions. Keep it secret.

Body

application/json

Export the full event transcript of one session as a streaming NDJSON body.

session_id
string
required

Target session ID, from the list returned by POST /safari/session/list.

include_subagents
boolean

When true, each subagent_dispatch line is followed by the child session's full event stream, bracketed by its own session_meta. Defaults to false.

Response

Streaming NDJSON (application/x-ndjson). One JSON object per line, terminated by a newline. The first line is always a session_meta envelope; subsequent lines are session events.

Newline-delimited JSON stream. Parse line-by-line; do not buffer the whole body.