API · v1 · stable
CODEMETA OSDeveloper Center
FR
Ouvrir la console
Entité · support_live_sessions

Support Live Session Schema

ID du schéma
support_live_session
Collection
support_live_sessions
Autorisations
  • Liresupport_request_view
  • Créersupport_request_create
  • Modifiersupport_request_edit
  • Supprimersupport_request_delete

Champs

Support Live Session Schema

support_live_sessions4 autorisations

A paid live support session attached to a support request

requestIdstringobligatoire

The support request this session escalated from — MANDATORY (ADR 0938 decision 10). There is no direct entry into live support: the agent gets context and the already-run AI triage for free, and the customer does not pay for the minutes spent typing the problem description.

max. 100 caractères
statusstringobligatoire

Lifecycle: requested → queued → active → ended, and to `abandoned` from any state. ⚠ `requested` is a transient transition state that exists only between POST and dispatch — it must never be observable for more than fractions of a second and NO business logic may branch on it (ADR 0938 decision 11). The states that carry meaning are queued, active, ended and abandoned.

requestedqueuedactivepausedendedabandoned
Par défaut : "requested"lecture seule
requestedByUserIdstringfacultatif

The tenant user who asked for live support. Kept separately from the request’s `createdBy` because a colleague may escalate someone else’s request, and the consent below is that person’s, not the original reporter’s.

max. 100 caractèresPar défaut : nullnullable
agentUserIdstringfacultatif

The Codemeta agent who pulled this session. Null while queued — assignment is pull-only, never automatic (ADR 0938 decision 13).

max. 100 caractèresPar défaut : nulllecture seulenullable
queuedAtdatetimefacultatif

When the customer entered the queue. Sort key of the fallback FIFO rung.

Par défaut : nulllecture seulenullable
activatedAtdatetimefacultatif

When the agent joined. THE BILLING CLOCK STARTS HERE and nowhere else — waiting is always free, so a customer who queues for 20 minutes and gives up pays nothing (ADR 0938 decision 11).

Par défaut : nulllecture seulenullable
endedAtdatetimefacultatif

When the session stopped. NOT the billed span on its own — a session can be paused, so the billed time is the sum of its active segments (`billableMs`).

Par défaut : nulllecture seulenullable
billableMsnumberfacultatif

Billable time from CLOSED segments, in milliseconds. An agent may pause a running session — to look something up or consult a colleague — and the meter must stop while they do (decision Lukas, 2026-08-10). Absent or 0 on a session that was never paused, where the single segment is `activatedAt → endedAt`: no backfill needed.

≥ 0Par défaut : 0lecture seule
segmentStartedAtdatetimefacultatif

Start of the OPEN billing segment; null while paused. This — not `status` — is what the money is computed from, so a paused session cannot accrue cost even if a status write were ever missed.

Par défaut : nulllecture seulenullable
endedReasonstringfacultatif

Why it stopped. Load-bearing for billing disputes: `idle_timeout` means nobody closed the session and the clock was stopped for them, which is exactly the case a customer will ask about.

agent_endedcustomer_endedidle_timeoutqueue_timeoutabandonednull
Par défaut : nulllecture seulenullable
alarmedAtdatetimefacultatif

When the queue alarm fired for this entry (ADR 0938 decision 11, alarm threshold). Stored so the alarm is raised once rather than on every sweep, and so the pull model’s known weakness — “someone else will take it” — is measurable afterwards.

Par défaut : nulllecture seulenullable
billingStatestringfacultatif

ADR 0938 decision 5. `included` (contractually covered, never billable) and `waived` (would have been billable, deliberately forgiven) are deliberately distinct: collapsing them makes “how much support is covered?” and “how much are we giving away?” indistinguishable in hindsight. `held` means the price was missing — hold the charge, never bill zero.

pendingmeteredincludedwaivedheld
Par défaut : "pending"lecture seule
billedBlocksnumberfacultatif

Number of started blocks the rollup charged. Written once by the rollup; null while pending. Stored rather than recomputed so an invoice line stays reproducible even after the block size changes.

≥ 0Par défaut : nulllecture seulenullable
chargeSourceRefstringfacultatif

Idempotency key handed to `recordPlatformCharge()`. Present exactly when a charge was recorded, which makes a double-charge detectable rather than merely unlikely.

max. 200 caractèresPar défaut : nulllecture seulenullable

Endpoints standard

Cette ressource suit le contrat CRUD générique de la plateforme. Lisez les conventions pour la pagination, l'idempotence, le verrouillage optimiste et l'audit. Les endpoints principaux :

  • GET /api/v1/support_live_sessions — Liste, paginée et filtrable
  • GET /api/v1/support_live_sessions/<id> — Une entité
  • POST /api/v1/support_live_sessions — Créer
  • PATCH /api/v1/support_live_sessions/<id> — Mise à jour partielle
  • DELETE /api/v1/support_live_sessions/<id> — Suppression logique
  • GET /api/v1/support_live_sessions/<id>/timeline — Audit et activités

Recherche