Skip to content

enhancement: session export API — download full session transcript as JSONL/Markdown #3114

Description

@OneStepAt4time

Description

There is no API endpoint to export a completed session's full transcript. Users must piece together transcript data from multiple API calls or read the JSONL file directly from the filesystem.

This is a common cc-connect feature and important for:

  • Audit/compliance (export session history)
  • Knowledge sharing (export a session as a readable doc)
  • Debugging (share full transcript with team)

Proposed API

GET /v1/sessions/:id/export?format=jsonl|markdown

JSONL format

Stream the raw JSONL transcript file.

Markdown format

Convert JSONL to readable Markdown:

  • User messages → ## User\n<content>
  • Assistant messages → ## Assistant\n<content>
  • Tool calls → collapsible <details> blocks

Acceptance Criteria

  • GET /v1/sessions/:id/export?format=jsonl returns raw JSONL with proper content-type
  • GET /v1/sessions/:id/export?format=markdown returns readable Markdown
  • 404 for non-existent session
  • 403 for tenant isolation (no cross-tenant export)
  • Respects session ownership/permissions
  • npm run gate passes

Environment

  • Aegis: v0.6.6-preview.1
  • Node: v22

Metadata

Metadata

Labels

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions