Skip to content

The whole thread as one JSON file, to share with a developer​

GET
/api/threads/{threadId}/export

Everything the orchestrator holds about the thread, as a versioned ThreadExport document: the thread, its full job ledger (the gate, the attempt, the pushed commit, what each source said), the agent binding and the complete event log. Every card and line of the chat is derived from that log. Authorised exactly like getThread (thread.read): a thread the caller may not read is a 404 indistinguishable from one that does not exist.

The response is an attachment (Content-Disposition: attachment; filename="thread-<id>.json") and is never cached. It contains what the people and the agents wrote in the thread (messages, artifacts, findings, CI summaries) and the owner's e-mail address (thread.owner, and the actor of the owner's messages); it holds no credential the orchestrator uses (no bearer token, webhook secret or database URL is ever in the log). Read it before sharing it: a person can paste anything into a chat.

Client recipe: Export Markdown. The same document is the input of the Markdown file of thread-markdown-v1.md: a client writes it from this response, with no other request, so that every client writes the same file. Only what this export holds is written, and not a step's input or output. A share link has no export route, so a reader of a link cannot make that file (a gap the page names).

Authorizations​

bearerToken

A JWT signed by the configured issuer (RS256, RS384, ES256 or EdDSA), with the configured audience. Read when auth.mode is jwt or jwt_or_proxy_header. A missing or refused token gets 401 with WWW-Authenticate: Bearer; an issuer whose keys cannot be fetched gets 503.

Type
HTTP (bearer)
or
dpopToken

A JWT as bearerToken, bound to the key of the client (cnf.jkt, RFC 7638), sent as Authorization: DPoP <token> with one DPoP header holding a proof signed by that key (RFC 9449, ADR 0054). Read only when auth.dpop is configured. A bad proof gets 401 with WWW-Authenticate: DPoP error="invalid_dpop_proof", algs="ES256 EdDSA", a bad or unbound token error="invalid_token".

Type
HTTP (DPoP)
or
proxyIdentity

Set by oauth2-proxy after OIDC login; requests without it get 401. Read when auth.mode is proxy_header (the default) or jwt_or_proxy_header without a bearer token.

Type
API Key (header: X-Auth-Request-Email)

Parameters​

Header Parameters

X-Web-Revision

The build of the web that asks, as the web sends it (NEXT_PUBLIC_BUILD_REVISION, the commit its image was built from): written into the file as versions.web.revision (ADR 0053). 1 to 64 characters of letters, digits and ._+-; anything else, or no header, is written as unknown. It authorises nothing and is the caller's word.

Type
string
Max Length
64
Pattern
"^[A-Za-z0-9._+-]{1,64}$"

Responses​

The thread export

JSON
{
  
"format": "another-agentic-system/thread-export",
  
"version": 1,
  
"exportedAt": "2026-01-15T10:00:00Z",
  
"thread": {
  
  
"id": "00000000-0000-4000-8000-000000000003",
  
  
"owner": "user@example.com",
  
  
"title": "Say hello",
  
  
"target": {
  
  
  
"agentId": "chat"
  
  
},
  
  
"state": "done",
  
  
"createdAt": "2026-01-15T09:30:00Z",
  
  
"updatedAt": "2026-01-15T09:30:05Z",
  
  
"lastSeq": 4
  
},
  
"job": {
  
  
"number": 1,
  
  
"attempt": 1,
  
  
"maxAttempts": 1
  
},
  
"versions": {
  
  
"orchestrator": {
  
  
  
"version": "0.1.0",
  
  
  
"revision": "0000000"
  
  
},
  
  
"agents": [
  
  
  
{
  
  
  
  
"agent": "chat",
  
  
  
  
"name": "chat",
  
  
  
  
"version": "0.0.0"
  
  
  
}
  
  
],
  
  
"web": {
  
  
  
"revision": "0000000"
  
  
}
  
},
  
"binding": {
  
  
"agentId": "chat",
  
  
"contextId": "ctx-0001",
  
  
"taskId": "task-0001",
  
  
"taskState": "completed",
  
  
"revision": null
  
},
  
"events": [
  
  
{
  
  
  
"seq": 1,
  
  
  
"threadId": "00000000-0000-4000-8000-000000000003",
  
  
  
"at": "2026-01-15T09:30:00Z",
  
  
  
"kind": "user_message",
  
  
  
"actor": {
  
  
  
  
"type": "user",
  
  
  
  
"name": "user@example.com"
  
  
  
},
  
  
  
"data": {
  
  
  
  
"text": "hi",
  
  
  
  
"messageId": "msg-0001"
  
  
  
}
  
  
},
  
  
{
  
  
  
"seq": 2,
  
  
  
"threadId": "00000000-0000-4000-8000-000000000003",
  
  
  
"at": "2026-01-15T09:30:02Z",
  
  
  
"kind": "agent_status",
  
  
  
"actor": {
  
  
  
  
"type": "agent",
  
  
  
  
"name": "chat"
  
  
  
},
  
  
  
"data": {
  
  
  
  
"status": "working"
  
  
  
}
  
  
},
  
  
{
  
  
  
"seq": 3,
  
  
  
"threadId": "00000000-0000-4000-8000-000000000003",
  
  
  
"at": "2026-01-15T09:30:05Z",
  
  
  
"kind": "agent_message",
  
  
  
"actor": {
  
  
  
  
"type": "agent",
  
  
  
  
"name": "chat"
  
  
  
},
  
  
  
"data": {
  
  
  
  
"text": "Hello! How can I help?",
  
  
  
  
"final": true
  
  
  
}
  
  
}
  
],
  
"eventsTruncated": false
}

Samples​

Powered by VitePress OpenAPI