API · v1 · estable
CODEMETA OSDeveloper Center
ES
Abrir la consola
Entidad · support_live_sessions

Support Live Session Schema

ID del esquema
support_live_session
Colección
support_live_sessions
Permisos
  • Leersupport_request_view
  • Crearsupport_request_create
  • Modificarsupport_request_edit
  • Eliminarsupport_request_delete

Campos

Support Live Session Schema

support_live_sessions4 permisos

A paid live support session attached to a support request

requestIdstringobligatorio

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.

máx. 100 caracteres
statusstringobligatorio

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
Valor por defecto: "requested"solo lectura
requestedByUserIdstringopcional

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.

máx. 100 caracteresValor por defecto: nulladmite null
agentUserIdstringopcional

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

máx. 100 caracteresValor por defecto: nullsolo lecturaadmite null
queuedAtdatetimeopcional

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

Valor por defecto: nullsolo lecturaadmite null
activatedAtdatetimeopcional

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

Valor por defecto: nullsolo lecturaadmite null
endedAtdatetimeopcional

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

Valor por defecto: nullsolo lecturaadmite null
billableMsnumberopcional

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.

≥ 0Valor por defecto: 0solo lectura
segmentStartedAtdatetimeopcional

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.

Valor por defecto: nullsolo lecturaadmite null
endedReasonstringopcional

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
Valor por defecto: nullsolo lecturaadmite null
alarmedAtdatetimeopcional

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.

Valor por defecto: nullsolo lecturaadmite null
billingStatestringopcional

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
Valor por defecto: "pending"solo lectura
billedBlocksnumberopcional

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.

≥ 0Valor por defecto: nullsolo lecturaadmite null
chargeSourceRefstringopcional

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

máx. 200 caracteresValor por defecto: nullsolo lecturaadmite null

Endpoints estándar

Este recurso sigue el contrato CRUD genérico de la plataforma. Lea las convenciones sobre paginación, idempotencia, bloqueo optimista y auditoría. Los endpoints principales:

  • GET /api/v1/support_live_sessions — Lista, paginada y filtrable
  • GET /api/v1/support_live_sessions/<id> — Una entidad
  • POST /api/v1/support_live_sessions — Crear
  • PATCH /api/v1/support_live_sessions/<id> — Actualización parcial
  • DELETE /api/v1/support_live_sessions/<id> — Eliminación lógica
  • GET /api/v1/support_live_sessions/<id>/timeline — Auditoría y actividades

Búsqueda