Skip to content

Create (or reuse) a public share link for a Solution run

POST
/api/solutions/runs/{run_id}/share/
curl --request POST \
--url http://localhost:8000/api/solutions/runs/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0/share/ \
--header 'Authorization: Bearer <token>'

Issues a public, token-gated URL for the run’s report — anyone with the link sees a read-only copy, no auth required. Reuses the most recent active token rather than minting a fresh one on every call (the URL the coach sent yesterday keeps working). Each call (re-)stamps the share’s locale from ?lang= (clamped to en / ru / es, default en); the public report + its AI paragraph then render in that language regardless of the recipient’s browser locale. Read the shared report via GET /api/solutions/shared/<token>/.

run_id
required
string format: uuid
lang
string

Active UI language (en / ru / es) to freeze on the share. Defaults to en when omitted or unrecognised.

units
string

Active unit system (metric / imperial) to freeze on the share so the public report + PDF render as the coach sees them (#1042). Defaults to metric when omitted.

Media typeapplication/json

POST /api/solutions/runs/<id>/share/ — a public, token-gated link to the run’s read-only report. Mirrors the Sessions / Clients share response shape (issue #695).

object
token
required

Opaque, URL-safe share token. Treat as a secret — anyone with it can read the report.

string
url
required

Relative public path (/solutions/shared/<token>). Prefix with your web origin to share.

string
expires_at
required

ISO-8601 UTC expiry — SHARE_LINK_TTL_DAYS out (30 by default), re-stamped to a full window on every re-share, past which the public route returns 410. null only on links minted before the TTL landed (#1400).

string format: date-time
nullable
locale
required

Language frozen on this share (en / ru / es). The public report + its AI paragraph render in this locale regardless of the recipient’s browser settings. Re-sharing with a different ?lang= re-stamps it.

string
Examplegenerated
{
"token": "example",
"url": "example",
"expires_at": "2026-04-15T12:00:00Z",
"locale": "example"
}
Media typeapplication/json
object
detail
required

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).

string
Examplegenerated
{
"detail": "example"
}
Media typeapplication/json
object
detail
required

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).

string
Examplegenerated
{
"detail": "example"
}