Data Models
This page documents the JSON shapes returned by the REST API and emitted over WebSocket.
All fields use camelCase. Additional fields may appear in future versions; clients must ignore unknown properties.
Counter
Field | Type | Notes |
|---|---|---|
id | string (UUID v7) | Unique counter id (server generated) |
displayName | string | 5..40 chars (validation enforced server-side) |
type | enum CounterType | One of |
members | CounterMember[] | Current membership list |
data | object or null | Shape depends on |
CounterMember
Field | Type | Notes |
|---|---|---|
userId | string (UUID) | Identity of member |
displayName | string | User display name at time of retrieval |
isAdmin | boolean | Whether user has admin privileges for the counter |
Counter Data Models
UpDown (PublicV1UpDownCounterData)
Field | Type | Notes |
|---|---|---|
value | number (int64) | Current counter numeric value |
mode | enum UpDownCounterMode |
|
FromDate (PublicV1FromDateCounterData)
Field | Type | Notes |
|---|---|---|
date | string (ISO 8601 UTC) | Start date in UTC |
ToDate (PublicV1ToDateCounterData)
Field | Type | Notes |
|---|---|---|
date | string (ISO 8601 UTC) | End date in UTC |
Null Data
If a counter type is unrecognized (future type) or has no data, data may be null. Treat this as absence of a type-specific payload.
Enums
CounterType
Value | Meaning |
|---|---|
UpDown | Numeric counter with optional increment/decrement behavior |
FromDate | Tracks duration since a fixed start date |
ToDate | Tracks remaining time until a target date |
UpDownCounterMode
Value | Behavior |
|---|---|
OnlyUp | Value monotonically increases |
OnlyDown | Value monotonically decreases |
UpAndDown | Value may move in both directions |
Error Object
See Error Handling for full table.
WebSocket Events
WebSocket notifications follow JSON-RPC 2.0 (no id). Generic shape:
Fields:
jsonrpc: always "2.0"
method: event identifier (see list below)
params: event-specific payload
counterUpdated
Params:
counterId (UUID)
displayName (string, optional)
data (object|null)
counterDeleted
Params:
counterId (UUID)
counterMemberlistChanged
Params:
counterId (UUID)
Versioning & Forward Compatibility
Ignore unknown fields in any object.
Ignore unknown methods.
New enum values may appear; treat unknown enum values gracefully.
A future
dataVersionfield may be added.