Skip to content

Publishing records

Record model

A record is the full state of one event object: participant, team, group, course, control. Not a diff, but the whole object.

  • Source ID — a stable identifier from your program (1–64 characters). The server finds the record by it, so any field may change (name, bib, group, club).
  • Revision — a number. The server replaces a record if the revision is greater than the stored one and skips an older one. Revision 0 means “no revision”: the last one received wins.
  • Tombstone — a record with deleted: true deletes the object.
  • Race (race_id) is required for all kinds except race and standings.

Record kinds: race, group, course, control, participant, team, standing, position. All fields are in records.proto.

Sport-specific fields

All optional; without them viewers see the generic protocol. Durations are milliseconds, moments are RFC 3339.

Sport or format What to send
All participant: gender (M/F), age_group; the server computes gender and age places
All participant.athlete_id — a Ruunso athlete from the event entry; accepted only if the athlete is entered in the event of this competition, otherwise ignored; the result joins the athlete history when the profile has an owner
Running gun_start and chip_start (gross and net time); control: km; laps[] — lap times (race.format = LAPS)
Trail control: kind = AID_STATION, km, climb_m, cutoff; participant.cutoff_missed — the checkpoint where the athlete was removed; participant.itra_pi, utmb_index {general, k20, k50, k100, m100}, itra_id, utmb_id — indices and profiles; position {at, lat, lon, accuracy_m} with the participant’s id — the latest GPS position (only one is kept, the greater at wins, no revision needed; not shown to viewers yet)
Skiing race.style (classic/free); mass start — bonus_ms; pursuit — start_time with the start gap; sprint — heat {stage, stage_no, heat_no, place, qualified Q/LL; empty — computed by the server once the heats are finished}; advancing rule — race.sprint_heat_quota (how many first per heat) and race.sprint_lucky_losers (how many lucky losers by time): both 0 — 2 and 2, quota 3 without lucky losers — 3 and 0
Relay race.format = RELAY; a team record; participant: team_id and leg; a leg after a handover starts with its own start_time
Triathlon race.format = MULTISPORT; splits are segment ends (kind = TRANSITION, km); penalty_ms
Rogaining, score-O race.format = SCORE; group: scoring = POINTS, time_limit_ms, late_penalty_per_min; participant: points (or controls_taken[] with values), penalty_points; control: code and points — the number and value are shown from the record; a control outside the group course is marked
Swimming participant: lane, heat {heat_no} — the swim heat (no stage; the server ranks the heat by time when place is not set); splits every 50/100 m (control.km); open water — MASS_START with splits; relay — RELAY
GTO group.scoring = POINTS; participant: events[] {discipline, result, points} — the total is the sum of points (or points), badge (gold/silver/bronze) — the badge from the source, the server does not recompute standards
MTB, road cycling MTB XCO — race.format = LAPS, laps[]; enduro — MULTISPORT, splits are special stage ends (summed); road — mass start or time trial (INDIVIDUAL) with splits; multi-day — standing records (several classifications become tabs); average speed comes from the course length

Push

A batch of 1…N records. A rejected record does not fail the batch.

Terminal window
curl -H 'Content-Type: application/json' -H "Authorization: Bearer $KEY" \
-d '{"records":[
{"id":"g1","race_id":"1","group":{"name":"М21"}},
{"id":"p1","race_id":"1","revision":1,
"participant":{"bib":"1","name":"Иван Иванов","group_id":"g1","status":"PARTICIPANT_STATUS_OK","result_ms":"1830000"}}
]}' \
https://api.ruunso.com/ruunso.live.v1.IngestService/Push

Response:

{"accepted": 2, "stale": 0, "rejected": [], "resync_required": false}

accepted — applied, stale — the server has a newer revision or the record did not change, rejected — rejected records (record_invalid, out_of_scope). resync_required: true means the organizer cleared the event data — send the full state again.

Python

import requests
resp = requests.post(
"https://api.ruunso.com/ruunso.live.v1.IngestService/Push",
headers={"Authorization": f"Bearer {key}"},
json={"records": [{"id": "p1", "race_id": "1", "revision": 2,
"participant": {"bib": "1", "name": "Иван Иванов"}}]},
)
print(resp.json())

JavaScript

const resp = await fetch("https://api.ruunso.com/ruunso.live.v1.IngestService/Push", {
method: "POST",
headers: { "Content-Type": "application/json", Authorization: `Bearer ${key}` },
body: JSON.stringify({
records: [{ id: "p1", race_id: "1", revision: 2, participant: { bib: "1", name: "Иван Иванов" } }],
}),
});
console.log(await resp.json());

Go (gRPC)

Generate the client from the .proto files (buf generate) and use connect-go; the same client speaks gRPC, Connect and JSON.

client := livev1connect.NewIngestServiceClient(
connect.NewClient(connecthttp.NewTransport(http.DefaultClient, "https://api.ruunso.com", connecthttp.WithGRPC())),
)
ctx, info := connect.NewClientContext(ctx)
info.RequestHeader().Set("Authorization", "Bearer "+key)
res, err := client.Push(ctx, &livev1.PushRequest{Records: records})

Errors and limits

Code When
key_invalid, key_expired, key_revoked key is wrong, expired, revoked (401)
ingest_stopped the organizer stopped ingest
too_many_records batch exceeds the limit
rate_limited batches too frequent; retry later

Default limits: 1000 records and 2 MB per batch, 64 KB per record, 20 batches per second per key (burst 40). Keep a send queue and never block timing while waiting for the network.