API · v1 · stabiel
CODEMETA OSDeveloper Center
NL
Console openen
Entity · support_live_sessions

Support Live Session Schema

Schema-ID
support_live_session
Collection
support_live_sessions
Permissions
  • Lezensupport_request_view
  • Aanmakensupport_request_create
  • Wijzigensupport_request_edit
  • Verwijderensupport_request_delete

Velden

Support Live Session Schema

support_live_sessions4 permissions

A paid live support session attached to a support request

requestIdstringvereist

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 tekens
statusstringvereist

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
Default: "requested"read-only
requestedByUserIdstringoptioneel

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 tekensDefault: nullnullable
agentUserIdstringoptioneel

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

max. 100 tekensDefault: nullread-onlynullable
queuedAtdatetimeoptioneel

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

Default: nullread-onlynullable
activatedAtdatetimeoptioneel

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

Default: nullread-onlynullable
endedAtdatetimeoptioneel

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

Default: nullread-onlynullable
billableMsnumberoptioneel

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.

≥ 0Default: 0read-only
segmentStartedAtdatetimeoptioneel

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.

Default: nullread-onlynullable
endedReasonstringoptioneel

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
Default: nullread-onlynullable
alarmedAtdatetimeoptioneel

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.

Default: nullread-onlynullable
billingStatestringoptioneel

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
Default: "pending"read-only
billedBlocksnumberoptioneel

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.

≥ 0Default: nullread-onlynullable
chargeSourceRefstringoptioneel

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

max. 200 tekensDefault: nullread-onlynullable

Standaard-endpoints

Deze resource volgt het generieke CRUD-contract van het platform. Lees de conventies voor paginering, idempotentie, optimistic locking en audit. De belangrijkste endpoints:

  • GET /api/v1/support_live_sessions — Lijst, gepagineerd + filterbaar
  • GET /api/v1/support_live_sessions/<id> — Enkele entity
  • POST /api/v1/support_live_sessions — Aanmaken
  • PATCH /api/v1/support_live_sessions/<id> — Gedeeltelijke update
  • DELETE /api/v1/support_live_sessions/<id> — Soft-delete
  • GET /api/v1/support_live_sessions/<id>/timeline — Audit + activiteiten

Zoeken