Data Models
This page documents the JSON shapes returned by the v2 REST API and emitted over the v2 WebSocket.
All fields use camelCase. Additional fields may appear in future versions; clients must ignore unknown properties.
v2 Counter
Flat response shape used by all v2 REST endpoints and WebSocket events.
Field | Type | Notes |
|---|---|---|
id | string (UUID v7) | Unique counter id (server generated) |
name | string | 5..40 chars (validation enforced server-side) |
type | enum CounterType | One of |
value | number | Numeric value. For |
startDate | string (date) | Only present for |
endDate | string (date) | Only present for |
created | string (ISO 8601 UTC) | Counter creation timestamp |
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 |
Error Object
See Error Handling for full table.
v2 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)name(string)type(CounterType)value(number, timezone-resolved)
counterDeleted
counterMemberlistChanged
Versioning & Forward Compatibility
Ignore unknown fields in any object.
Ignore unknown methods.
New enum values may appear; treat unknown enum values gracefully.
v1 Data Models (Deprecated)
The v1 API uses a nested counter shape with displayName, members[], and a type-specific data object. In v2 this is replaced by the flat shape above.