Download a session comparison as PDF (with chart snapshot)
const url = 'http://localhost:8000/api/sessions/compare/pdf/';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"ids":["5c836d7d-3301-49df-bfa0-9cff0550fd0e","29f151e9-3449-4e5b-8539-73ac377c76c5"],"overlay_png":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAA…"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url http://localhost:8000/api/sessions/compare/pdf/ \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "ids": [ "5c836d7d-3301-49df-bfa0-9cff0550fd0e", "29f151e9-3449-4e5b-8539-73ac377c76c5" ], "overlay_png": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAA…" }'Same report as the GET variant, but the body carries the session ids plus an optional overlay_png — the web client’s snapshot of its live overlay chart (ECharts getDataURL, base64 PNG data URL) — so the printed chart is pixel-identical to the screen. When overlay_png is omitted the server draws its own vector rendition. ?units= / ?lang= query params as on GET. Returns binary application/pdf.
400 on a malformed id list or undecodable overlay_png; 409 session_not_completed unless every session has finished analysis.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Query Parameters
Section titled “Query Parameters”en (default), ru or es.
metric (default) or imperial.
Request Bodyrequired
Section titled “Request Bodyrequired”Body of POST /api/sessions/compare/pdf/ (#1002) — the ordered
session set plus an optional client-side snapshot of the overlay
chart (the web page’s live ECharts canvas as a PNG data URL), so the
printed chart is pixel-identical to what the coach sees on screen.
object
2–4 session UUIDs in the card order to show on the public comparison page (e.g. before → after). All must belong to the caller’s team and have status == 'completed'.
Optional PNG snapshot of the overlay chart, as a base64 data URL (data:image/png;base64,...) or bare base64. When omitted (or undecodable) the server draws its own vector rendition of the overlay.
Examples
Before / after pair with chart snapshot
{ "ids": [ "5c836d7d-3301-49df-bfa0-9cff0550fd0e", "29f151e9-3449-4e5b-8539-73ac377c76c5" ], "overlay_png": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAA…"}Body of POST /api/sessions/compare/pdf/ (#1002) — the ordered
session set plus an optional client-side snapshot of the overlay
chart (the web page’s live ECharts canvas as a PNG data URL), so the
printed chart is pixel-identical to what the coach sees on screen.
object
2–4 session UUIDs in the card order to show on the public comparison page (e.g. before → after). All must belong to the caller’s team and have status == 'completed'.
Optional PNG snapshot of the overlay chart, as a base64 data URL (data:image/png;base64,...) or bare base64. When omitted (or undecodable) the server draws its own vector rendition of the overlay.
Examplegenerated
ids=2489E9AD-2EE2-8E00-8EC9-32D5F69181C0&overlay_png=exampleBody of POST /api/sessions/compare/pdf/ (#1002) — the ordered
session set plus an optional client-side snapshot of the overlay
chart (the web page’s live ECharts canvas as a PNG data URL), so the
printed chart is pixel-identical to what the coach sees on screen.
object
2–4 session UUIDs in the card order to show on the public comparison page (e.g. before → after). All must belong to the caller’s team and have status == 'completed'.
Optional PNG snapshot of the overlay chart, as a base64 data URL (data:image/png;base64,...) or bare base64. When omitted (or undecodable) the server draws its own vector rendition of the overlay.
Responses
Section titled “Responses”The rendered report as application/pdf. Sent with Content-Disposition: attachment; filename="aikynetix-<activity>-<yyyymmdd>.pdf".
Examplegenerated
binaryobject
Human-readable message, or a stable machine code for the cases a client branches on. The standard envelope for 400 (validation — a field-keyed object may appear instead), 401 (missing / invalid credentials), 403 (authenticated but not permitted), and 404 (absent — cross-team records are collapsed to 404 so the API never leaks the existence of another team’s data).
Examples
Fewer than 2 / more than 4 / duplicate session ids
{ "ids": [ "Pass 2-4 distinct session ids." ]}object
Human-readable message, or a stable machine code for the cases a client branches on. The standard envelope for 400 (validation — a field-keyed object may appear instead), 401 (missing / invalid credentials), 403 (authenticated but not permitted), and 404 (absent — cross-team records are collapsed to 404 so the API never leaks the existence of another team’s data).
Examplegenerated
{ "detail": "example"}object
Human-readable message, or a stable machine code for the cases a client branches on. The standard envelope for 400 (validation — a field-keyed object may appear instead), 401 (missing / invalid credentials), 403 (authenticated but not permitted), and 404 (absent — cross-team records are collapsed to 404 so the API never leaks the existence of another team’s data).
Examples
Absent, or owned by another team (collapsed to 404)
{ "detail": "session_not_found"}object
409 — the request conflicts with current state. detail is a stable code (e.g. reanalyze_in_flight, already_on_plan, email_in_use). Some 409s carry extra context fields alongside detail; those are documented on the specific endpoint that emits them.
Examples
PDF / Share rejected while the session is still pending or processing
{ "detail": "session_not_completed"}