{"openapi":"3.1.0","info":{"title":"Pub Runners partner API","version":"1","description":"Club records and timing for apps outside pub-runners.com. Ask the club for a key, then press **Authorize** and paste it to try requests here.\n\nEach key has abilities: `{resource}.read` for every resource, `runs.write`, `results.write` and `news.write`, plus `runners.private`, `timing.write` and `timing.finalise`. Patterns such as `*.read` grant every match. The default key has `*.read` and `timing.write`.\n\nLimit: 120 requests a minute per key. Every write is logged against its key. Errors are JSON with a `message`; validation errors (422) also have `errors` keyed by field.\n\nPages on pub-runners.com signed in as a host (such as the /timer app) can call the Timing endpoints with their session cookie instead of a key; POSTs then need the `X-XSRF-TOKEN` header. Participants check themselves in through the Participants endpoints with tonight's join code.\n\nThe full guide, with the timing walkthrough: [https://pr30.demo.pub-runners.com/developers/partner-api](https://pr30.demo.pub-runners.com/developers/partner-api). More guides: [https://pr30.demo.pub-runners.com/developers](https://pr30.demo.pub-runners.com/developers)."},"servers":[{"url":"https://pr30.demo.pub-runners.com/api/v1"}],"security":[{"key":[]}],"tags":[{"name":"Locations","description":"All locations."},{"name":"Seasons","description":"All seasons, newest first."},{"name":"Runs","description":"Published runs, newest first."},{"name":"Results","description":"Results of published runs, newest run first, then by position."},{"name":"Runners","description":"Listed runners, by last name."},{"name":"Attendance types","description":"All attendance types, in display order."},{"name":"Badges","description":"All badges, in display order."},{"name":"Awards","description":"Badges awarded to listed runners, newest first."},{"name":"News","description":"Published posts, newest first."},{"name":"Timing","description":"Time a run from your own app. Results stay drafts until a club host publishes them."},{"name":"Participants","description":"People checking themselves in on their own phones with tonight's join code. No key or account."}],"paths":{"/locations":{"get":{"tags":["Locations"],"summary":"List locations","description":"All locations. Needs `locations.read`.","operationId":"listLocations","parameters":[{"$ref":"#/components/parameters/page"},{"$ref":"#/components/parameters/per_page"},{"name":"active","in":"query","description":"Only active (or inactive) locations.","schema":{"type":"boolean"}}],"responses":{"200":{"description":"One page of records.","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Location"}},"current_page":{"type":"integer"},"per_page":{"type":"integer"},"total":{"type":"integer"},"last_page":{"type":"integer"},"next_page_url":{"type":["string","null"],"format":"uri"},"prev_page_url":{"type":["string","null"],"format":"uri"}},"required":["data","current_page","per_page","total","last_page","next_page_url","prev_page_url"]}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/TooManyRequests"}}}},"/locations/{id}":{"parameters":[{"$ref":"#/components/parameters/id"}],"get":{"tags":["Locations"],"summary":"Get location","description":"Needs `locations.read`.","operationId":"getLocation","responses":{"200":{"description":"The record.","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Location"}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/TooManyRequests"}}}},"/seasons":{"get":{"tags":["Seasons"],"summary":"List seasons","description":"All seasons, newest first. Needs `seasons.read`.","operationId":"listSeasons","parameters":[{"$ref":"#/components/parameters/page"},{"$ref":"#/components/parameters/per_page"},{"name":"location_id","in":"query","description":"Seasons at this location.","schema":{"type":"integer"}}],"responses":{"200":{"description":"One page of records.","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Season"}},"current_page":{"type":"integer"},"per_page":{"type":"integer"},"total":{"type":"integer"},"last_page":{"type":"integer"},"next_page_url":{"type":["string","null"],"format":"uri"},"prev_page_url":{"type":["string","null"],"format":"uri"}},"required":["data","current_page","per_page","total","last_page","next_page_url","prev_page_url"]}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/TooManyRequests"}}}},"/seasons/{id}":{"parameters":[{"$ref":"#/components/parameters/id"}],"get":{"tags":["Seasons"],"summary":"Get season","description":"Needs `seasons.read`.","operationId":"getSeason","responses":{"200":{"description":"The record.","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Season"}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/TooManyRequests"}}}},"/runs":{"get":{"tags":["Runs"],"summary":"List runs","description":"Published runs, newest first. Keys with `runs.write` see every run. Needs `runs.read`.","operationId":"listRuns","parameters":[{"$ref":"#/components/parameters/page"},{"$ref":"#/components/parameters/per_page"},{"name":"from","in":"query","description":"On or after this date.","schema":{"type":"string","format":"date"}},{"name":"to","in":"query","description":"On or before this date.","schema":{"type":"string","format":"date"}},{"name":"season_id","in":"query","description":"Runs in this season.","schema":{"type":"integer"}},{"name":"location_id","in":"query","description":"Runs at this location.","schema":{"type":"integer"}},{"name":"status","in":"query","description":"Runs with this status.","schema":{"type":"string","enum":["scheduled","live","finalised","published"]}}],"responses":{"200":{"description":"One page of records.","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Run"}},"current_page":{"type":"integer"},"per_page":{"type":"integer"},"total":{"type":"integer"},"last_page":{"type":"integer"},"next_page_url":{"type":["string","null"],"format":"uri"},"prev_page_url":{"type":["string","null"],"format":"uri"}},"required":["data","current_page","per_page","total","last_page","next_page_url","prev_page_url"]}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/TooManyRequests"}}},"post":{"tags":["Runs"],"summary":"Create run","description":"Needs `runs.write`.","operationId":"createRun","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RunInput"}}}},"responses":{"201":{"description":"Created.","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Run"}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/TooManyRequests"}}}},"/runs/{id}":{"parameters":[{"$ref":"#/components/parameters/id"}],"get":{"tags":["Runs"],"summary":"Get run","description":"Needs `runs.read`.","operationId":"getRun","responses":{"200":{"description":"The record.","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Run"}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/TooManyRequests"}}},"patch":{"tags":["Runs"],"summary":"Update run","description":"Changes only the fields you send. Needs `runs.write`.","operationId":"updateRun","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RunInput"}}}},"responses":{"200":{"description":"The record.","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Run"}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/TooManyRequests"}}},"delete":{"tags":["Runs"],"summary":"Delete run","description":"Refused with 409 while the run has results. Needs `runs.write`.","operationId":"deleteRun","responses":{"204":{"description":"Deleted."},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"429":{"$ref":"#/components/responses/TooManyRequests"}}}},"/results":{"get":{"tags":["Results"],"summary":"List results","description":"Results of published runs, newest run first, then by position. Keys with `results.write` see drafts too. Hidden runners have a null `runner_id` and `runner_name` unless the key has `runners.private`. Needs `results.read`.","operationId":"listResults","parameters":[{"$ref":"#/components/parameters/page"},{"$ref":"#/components/parameters/per_page"},{"name":"from","in":"query","description":"Runs on or after this date.","schema":{"type":"string","format":"date"}},{"name":"to","in":"query","description":"Runs on or before this date.","schema":{"type":"string","format":"date"}},{"name":"run_id","in":"query","description":"Results of this run.","schema":{"type":"integer"}},{"name":"runner_id","in":"query","description":"Results of this runner.","schema":{"type":"integer"}}],"responses":{"200":{"description":"One page of records.","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Result"}},"current_page":{"type":"integer"},"per_page":{"type":"integer"},"total":{"type":"integer"},"last_page":{"type":"integer"},"next_page_url":{"type":["string","null"],"format":"uri"},"prev_page_url":{"type":["string","null"],"format":"uri"}},"required":["data","current_page","per_page","total","last_page","next_page_url","prev_page_url"]}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/TooManyRequests"}}},"post":{"tags":["Results"],"summary":"Create result","description":"Needs `results.write`.","operationId":"createResult","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ResultInput"}}}},"responses":{"201":{"description":"Created.","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Result"}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/TooManyRequests"}}}},"/results/{id}":{"parameters":[{"$ref":"#/components/parameters/id"}],"get":{"tags":["Results"],"summary":"Get result","description":"Needs `results.read`.","operationId":"getResult","responses":{"200":{"description":"The record.","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Result"}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/TooManyRequests"}}},"patch":{"tags":["Results"],"summary":"Update result","description":"Changes only the fields you send. Needs `results.write`.","operationId":"updateResult","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ResultInput"}}}},"responses":{"200":{"description":"The record.","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Result"}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/TooManyRequests"}}},"delete":{"tags":["Results"],"summary":"Delete result","description":"Deletes the record. Needs `results.write`.","operationId":"deleteResult","responses":{"204":{"description":"Deleted."},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"429":{"$ref":"#/components/responses/TooManyRequests"}}}},"/runners":{"get":{"tags":["Runners"],"summary":"List runners","description":"Listed runners, by last name. With `runners.private`: everyone, including hidden and merged runners, with private fields. Needs `runners.read`.","operationId":"listRunners","parameters":[{"$ref":"#/components/parameters/page"},{"$ref":"#/components/parameters/per_page"},{"name":"q","in":"query","description":"Every word must start a first or last name: `adam ca` finds Adam Cason.","schema":{"type":"string"}},{"name":"public_id","in":"query","description":"The runner with this public ID (the number in their profile link).","schema":{"type":"integer"}}],"responses":{"200":{"description":"One page of records.","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Runner"}},"current_page":{"type":"integer"},"per_page":{"type":"integer"},"total":{"type":"integer"},"last_page":{"type":"integer"},"next_page_url":{"type":["string","null"],"format":"uri"},"prev_page_url":{"type":["string","null"],"format":"uri"}},"required":["data","current_page","per_page","total","last_page","next_page_url","prev_page_url"]}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/TooManyRequests"}}}},"/runners/{id}":{"parameters":[{"$ref":"#/components/parameters/id"}],"get":{"tags":["Runners"],"summary":"Get runner","description":"Needs `runners.read`.","operationId":"getRunner","responses":{"200":{"description":"The record.","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Runner"}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/TooManyRequests"}}}},"/attendance-types":{"get":{"tags":["Attendance types"],"summary":"List attendance-types","description":"All attendance types, in display order. Needs `attendance-types.read`.","operationId":"listAttendanceTypes","parameters":[{"$ref":"#/components/parameters/page"},{"$ref":"#/components/parameters/per_page"}],"responses":{"200":{"description":"One page of records.","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/AttendanceType"}},"current_page":{"type":"integer"},"per_page":{"type":"integer"},"total":{"type":"integer"},"last_page":{"type":"integer"},"next_page_url":{"type":["string","null"],"format":"uri"},"prev_page_url":{"type":["string","null"],"format":"uri"}},"required":["data","current_page","per_page","total","last_page","next_page_url","prev_page_url"]}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/TooManyRequests"}}}},"/attendance-types/{id}":{"parameters":[{"$ref":"#/components/parameters/id"}],"get":{"tags":["Attendance types"],"summary":"Get attendance type","description":"Needs `attendance-types.read`.","operationId":"getAttendanceType","responses":{"200":{"description":"The record.","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/AttendanceType"}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/TooManyRequests"}}}},"/badges":{"get":{"tags":["Badges"],"summary":"List badges","description":"All badges, in display order. Needs `badges.read`.","operationId":"listBadges","parameters":[{"$ref":"#/components/parameters/page"},{"$ref":"#/components/parameters/per_page"}],"responses":{"200":{"description":"One page of records.","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Badge"}},"current_page":{"type":"integer"},"per_page":{"type":"integer"},"total":{"type":"integer"},"last_page":{"type":"integer"},"next_page_url":{"type":["string","null"],"format":"uri"},"prev_page_url":{"type":["string","null"],"format":"uri"}},"required":["data","current_page","per_page","total","last_page","next_page_url","prev_page_url"]}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/TooManyRequests"}}}},"/badges/{id}":{"parameters":[{"$ref":"#/components/parameters/id"}],"get":{"tags":["Badges"],"summary":"Get badge","description":"Needs `badges.read`.","operationId":"getBadge","responses":{"200":{"description":"The record.","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Badge"}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/TooManyRequests"}}}},"/awards":{"get":{"tags":["Awards"],"summary":"List awards","description":"Badges awarded to listed runners, newest first. With `runners.private`: all awards. Needs `awards.read`.","operationId":"listAwards","parameters":[{"$ref":"#/components/parameters/page"},{"$ref":"#/components/parameters/per_page"},{"name":"from","in":"query","description":"Awarded on or after this date.","schema":{"type":"string","format":"date"}},{"name":"to","in":"query","description":"Awarded on or before this date.","schema":{"type":"string","format":"date"}},{"name":"runner_id","in":"query","description":"Awards to this runner.","schema":{"type":"integer"}},{"name":"badge_id","in":"query","description":"Awards of this badge.","schema":{"type":"integer"}}],"responses":{"200":{"description":"One page of records.","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Award"}},"current_page":{"type":"integer"},"per_page":{"type":"integer"},"total":{"type":"integer"},"last_page":{"type":"integer"},"next_page_url":{"type":["string","null"],"format":"uri"},"prev_page_url":{"type":["string","null"],"format":"uri"}},"required":["data","current_page","per_page","total","last_page","next_page_url","prev_page_url"]}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/TooManyRequests"}}}},"/awards/{id}":{"parameters":[{"$ref":"#/components/parameters/id"}],"get":{"tags":["Awards"],"summary":"Get award","description":"Needs `awards.read`.","operationId":"getAward","responses":{"200":{"description":"The record.","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Award"}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/TooManyRequests"}}}},"/news":{"get":{"tags":["News"],"summary":"List news","description":"Published posts, newest first. Keys with `news.write` see drafts and scheduled posts too. Needs `news.read`.","operationId":"listNews","parameters":[{"$ref":"#/components/parameters/page"},{"$ref":"#/components/parameters/per_page"},{"name":"from","in":"query","description":"Published on or after this date.","schema":{"type":"string","format":"date"}},{"name":"to","in":"query","description":"Published on or before this date.","schema":{"type":"string","format":"date"}}],"responses":{"200":{"description":"One page of records.","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/NewsPost"}},"current_page":{"type":"integer"},"per_page":{"type":"integer"},"total":{"type":"integer"},"last_page":{"type":"integer"},"next_page_url":{"type":["string","null"],"format":"uri"},"prev_page_url":{"type":["string","null"],"format":"uri"}},"required":["data","current_page","per_page","total","last_page","next_page_url","prev_page_url"]}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/TooManyRequests"}}},"post":{"tags":["News"],"summary":"Create news post","description":"Needs `news.write`.","operationId":"createNewsPost","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/NewsPostInput"}}}},"responses":{"201":{"description":"Created.","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/NewsPost"}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/TooManyRequests"}}}},"/news/{id}":{"parameters":[{"$ref":"#/components/parameters/id"}],"get":{"tags":["News"],"summary":"Get news post","description":"Needs `news.read`.","operationId":"getNewsPost","responses":{"200":{"description":"The record.","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/NewsPost"}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/TooManyRequests"}}},"patch":{"tags":["News"],"summary":"Update news post","description":"Changes only the fields you send. Needs `news.write`.","operationId":"updateNewsPost","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/NewsPostInput"}}}},"responses":{"200":{"description":"The record.","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/NewsPost"}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/TooManyRequests"}}},"delete":{"tags":["News"],"summary":"Delete news post","description":"Deletes the record. Needs `news.write`.","operationId":"deleteNewsPost","responses":{"204":{"description":"Deleted."},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"429":{"$ref":"#/components/responses/TooManyRequests"}}}},"/timing/runs":{"get":{"tags":["Timing"],"summary":"List runs open for timing","description":"Scheduled or live runs dated yesterday to tomorrow. Needs `timing.write`, or a host session.","operationId":"listTimingRuns","responses":{"200":{"description":"Open runs.","content":{"application/json":{"schema":{"type":"object","properties":{"runs":{"type":"array","items":{"$ref":"#/components/schemas/TimingRun"}}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/TooManyRequests"}},"security":[{"key":[]},{"session":[]}]}},"/timing/runs/tonight":{"post":{"tags":["Timing"],"summary":"Open tonight's run","description":"Returns tonight's run, creating it in the latest season if no one has yet. 409 if it is already finalised or there is no season. Needs `timing.write`, or a host session.","operationId":"openTonight","responses":{"200":{"description":"Tonight's run, already open.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TimingRun"}}}},"201":{"description":"Tonight's run, just created.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TimingRun"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"409":{"$ref":"#/components/responses/Conflict"},"429":{"$ref":"#/components/responses/TooManyRequests"}},"security":[{"key":[]},{"session":[]}]}},"/timing/runs/{run}/roster":{"parameters":[{"$ref":"#/components/parameters/run"}],"get":{"tags":["Timing"],"summary":"Who can be checked in","description":"Runners, people seen in the last 8 weeks first, with a predicted time for sorting, and the attendance types. Keys see listed runners; host sessions also see hidden ones. Needs `timing.write`, or a host session.","operationId":"getRoster","responses":{"200":{"description":"The roster.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Roster"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/TooManyRequests"}},"security":[{"key":[]},{"session":[]}]}},"/timing/runs/{run}/events":{"parameters":[{"$ref":"#/components/parameters/run"}],"get":{"tags":["Timing"],"summary":"Your events for a run","description":"Your own events, in order, so a second device can catch up. A host session gets all of the club's events for the run. Needs `timing.write`, or a host session.","operationId":"listTimingEvents","parameters":[{"name":"after","in":"query","description":"Only events after this event `id`.","schema":{"type":"integer","default":0}}],"responses":{"200":{"description":"Your events.","content":{"application/json":{"schema":{"type":"object","properties":{"events":{"type":"array","items":{"$ref":"#/components/schemas/StoredTimingEvent"}},"server_time":{"type":"string","format":"date-time"}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/TooManyRequests"}},"security":[{"key":[]},{"session":[]}]},"post":{"tags":["Timing"],"summary":"Send timing events","description":"Up to 500 events. Resending an event (same `uuid`) is safe. If any event is invalid, none are stored. 409 if another app is already timing the run. Needs `timing.write`, or a host session.","operationId":"sendTimingEvents","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["events"],"properties":{"events":{"type":"array","maxItems":500,"items":{"$ref":"#/components/schemas/TimingEvent"}}}},"example":{"events":[{"uuid":"0b9a4a4e-6f0e-4c39-9d47-3f1f7e0d2a11","type":"checkin","payload":{"runner_id":4},"client_at":"2026-11-10T07:40:00.000Z","device_id":"phone-1"},{"uuid":"1b4e28ba-2fa1-4d2e-883f-0016d3cca427","type":"gun","payload":{},"client_at":"2026-11-10T07:45:00.000Z","device_id":"phone-1"},{"uuid":"5d3c2b1a-9e8f-4a7b-8c6d-5e4f3a2b1c0d","type":"finish","payload":{"runners":[{"runner_id":4}]},"client_at":"2026-11-10T08:11:23.250Z","device_id":"phone-1"}]}}}},"responses":{"200":{"description":"Which events were stored.","content":{"application/json":{"schema":{"type":"object","properties":{"accepted":{"type":"array","items":{"type":"string","format":"uuid"}},"rejected":{"type":"array","description":"UUIDs already used by another app or for another run. Make new ones.","items":{"type":"string","format":"uuid"}},"server_time":{"type":"string","format":"date-time"}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/TooManyRequests"}},"security":[{"key":[]},{"session":[]}]}},"/timing/runs/{run}/finalise":{"parameters":[{"$ref":"#/components/parameters/run"}],"post":{"tags":["Timing"],"summary":"Build draft results","description":"Turns your events into draft results; a host still publishes them. 422 with names in `unresolved` if someone checked in with no finish or attendance: send `force` to record them as ran with no time. Needs `timing.finalise`, or a host session.","operationId":"finaliseRun","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"force":{"type":"boolean","default":false}}}}}},"responses":{"200":{"description":"Draft results built.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FinaliseResult"}}}},"422":{"description":"Not finalised: see `unresolved`, or `message`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FinaliseResult"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"429":{"$ref":"#/components/responses/TooManyRequests"}},"security":[{"key":[]},{"session":[]}]}},"/timing/runs/{run}/state":{"parameters":[{"$ref":"#/components/parameters/run"}],"get":{"tags":["Timing"],"summary":"The run as it stands","description":"Everyone checked in, started, finished or back, with times, from every event in the run (yours, the club's and participants'). Send the last `ETag` as `If-None-Match` to poll: an unchanged run answers 304 with no body. Keys see hidden runners' names as null. Needs `timing.write`, or a host session.","operationId":"getRunState","responses":{"200":{"description":"The run.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RunState"}}}},"304":{"description":"Nothing has changed since that ETag."},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/TooManyRequests"}},"security":[{"key":[]},{"session":[]}]}},"/timing/join-code":{"get":{"tags":["Timing"],"summary":"The join code","description":"The code participants type (or scan) to join tonight's run. One code for the club, `1901` to start with, kept from week to week until a host changes it. Needs `timing.write`, or a host session.","operationId":"getJoinCode","responses":{"200":{"description":"The code.","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","example":"1901"}},"required":["code"]}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/TooManyRequests"}},"security":[{"key":[]},{"session":[]}]},"patch":{"tags":["Timing"],"summary":"Change the join code","description":"Hosts and keys only (403 for a one-night timing link). 3 to 12 letters or numbers, saved in upper case. It applies from the next phone that joins and stays until it is changed again; phones that already joined are not affected. Needs `timing.write`, or a host session.","operationId":"changeJoinCode","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","pattern":"^[A-Za-z0-9]{3,12}$"}},"required":["code"]},"example":{"code":"PINTS"}}}},"responses":{"200":{"description":"The new code.","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","example":"PINTS"}},"required":["code"]}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/TooManyRequests"}},"security":[{"key":[]},{"session":[]}]}},"/participant/join":{"post":{"tags":["Participants"],"summary":"Join tonight's run","description":"Swaps the club's join code (`GET /timing/join-code`) for a participant token for tonight's run: the run dated today, until it is finalised. The token only reaches this phone's own check-in. 404 if the code is wrong or tonight's run is not open. Limited to 10 attempts a minute.","operationId":"joinRun","security":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","example":"K7P2Q9"}},"required":["code"]}}}},"responses":{"201":{"description":"Joined.","content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string","description":"Starts `pt_`. Keep it on the phone for tonight."},"run":{"$ref":"#/components/schemas/ParticipantRun"}},"required":["token","run"]}}}},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/TooManyRequests"}}}},"/participant/roster":{"get":{"tags":["Participants"],"summary":"Find your name","description":"Up to 10 listed runners whose names start with every word typed (\"adam ca\"). At least three letters.","operationId":"findName","security":[{"participant":[]}],"parameters":[{"name":"q","in":"query","required":true,"schema":{"type":"string","minLength":3}}],"responses":{"200":{"description":"Matches.","content":{"application/json":{"schema":{"type":"object","properties":{"runners":{"type":"array","items":{"type":"object","properties":{"id":{"type":"integer"},"name":{"type":"string"}},"required":["id","name"]}}},"required":["runners"]}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/TooManyRequests"}}}},"/participant/state":{"get":{"tags":["Participants"],"summary":"Your status","description":"The start, the end and your own check-in, start, finish and time. Other people appear only as counts.","operationId":"getParticipantState","security":[{"participant":[]}],"responses":{"200":{"description":"This phone's view of the run.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ParticipantState"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"429":{"$ref":"#/components/responses/TooManyRequests"}}}},"/participant/checkin":{"post":{"tags":["Participants"],"summary":"Check in","description":"Checks this phone's person in: someone from `/participant/roster`, or a new runner. Walkers and pub-only are recorded as `walked` and `pubbed`. 409 if this phone or that name is already checked in.","operationId":"participantCheckin","security":[{"participant":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","description":"Send `runner_id` or `new_runner`.","properties":{"runner_id":{"type":"integer"},"new_runner":{"type":"object","properties":{"first_name":{"type":"string","maxLength":60},"last_name":{"type":"string","maxLength":60},"email":{"type":["string","null"],"format":"email","description":"Optional. Only hosts and admins see it."}},"required":["first_name","last_name"]},"kind":{"type":"string","enum":["runner","walker","pub"]},"estimate_seconds":{"type":["integer","null"],"minimum":300,"maximum":7200,"description":"For a runner with no history."}},"required":["kind"]}}}},"responses":{"201":{"description":"This phone's view of the run.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ParticipantState"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/TooManyRequests"}}},"delete":{"tags":["Participants"],"summary":"Cancel your check-in","description":"\"Not you?\": takes back this phone's check-in. 409 once there is a finish time.","operationId":"participantCancel","security":[{"participant":[]}],"responses":{"200":{"description":"This phone's view of the run.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ParticipantState"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"409":{"$ref":"#/components/responses/Conflict"},"429":{"$ref":"#/components/responses/TooManyRequests"}}}},"/participant/start":{"post":{"tags":["Participants"],"summary":"Start late","description":"For someone who arrived after the start: their time counts from now, by the server clock. 409 before the start, or if already started.","operationId":"participantStart","security":[{"participant":[]}],"responses":{"200":{"description":"This phone's view of the run.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ParticipantState"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"409":{"$ref":"#/components/responses/Conflict"},"429":{"$ref":"#/components/responses/TooManyRequests"}}}}},"components":{"securitySchemes":{"key":{"type":"http","scheme":"bearer","description":"A partner key from the club, starting `pr_`."},"session":{"type":"apiKey","in":"cookie","name":"pub-runners-preview-30-session","description":"A pub-runners.com session signed in as a host or admin, or holding a one-night timing link. Timing endpoints only."},"participant":{"type":"http","scheme":"bearer","description":"A participant token from `POST /participant/join`, starting `pt_`."}},"parameters":{"id":{"name":"id","in":"path","required":true,"schema":{"type":"integer"}},"run":{"name":"run","in":"path","required":true,"description":"A run open for timing (see `GET /timing/runs`).","schema":{"type":"integer"}},"page":{"name":"page","in":"query","schema":{"type":"integer","minimum":1,"default":1}},"per_page":{"name":"per_page","in":"query","schema":{"type":"integer","minimum":1,"maximum":200,"default":50}}},"responses":{"Unauthorized":{"description":"Missing, invalid or revoked key or token, or not signed in.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"Forbidden":{"description":"The key does not have the ability this needs.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"NotFound":{"description":"No such record, or not one this key can see.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"Conflict":{"description":"The request conflicts with existing data.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"Invalid":{"description":"Validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"TooManyRequests":{"description":"More than 120 requests in a minute.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"schemas":{"Location":{"type":"object","properties":{"id":{"type":"integer"},"name":{"type":"string"},"slug":{"type":"string"},"distance_m":{"type":["integer","null"],"description":"Course length in metres."},"active":{"type":"boolean"},"maps_url":{"type":["string","null"],"format":"uri"},"venue_url":{"type":["string","null"],"format":"uri"},"start_point_description":{"type":["string","null"]},"route_image_url":{"type":["string","null"],"format":"uri","description":"The route map image."},"route_gpx_url":{"type":["string","null"],"format":"uri","description":"A GPX download of the route. Public, no key needed."}},"required":["id","name","slug","distance_m","active","maps_url","venue_url","start_point_description","route_image_url","route_gpx_url"]},"Season":{"type":"object","properties":{"id":{"type":"integer"},"location_id":{"type":"integer"},"name":{"type":"string"},"slug":{"type":"string"},"year":{"type":"integer"},"starts_on":{"type":"string","format":"date"},"ends_on":{"type":["string","null"],"format":"date"}},"required":["id","location_id","name","slug","year","starts_on","ends_on"]},"Run":{"type":"object","properties":{"id":{"type":"integer"},"date":{"type":"string","format":"date"},"status":{"type":"string","enum":["scheduled","live","finalised","published"]},"season_id":{"type":"integer"},"location_id":{"type":"integer"},"notes":{"type":["string","null"],"description":"Notes from the club admin."}},"required":["id","date","status","season_id","location_id","notes"]},"Result":{"type":"object","properties":{"id":{"type":"integer"},"run_id":{"type":"integer"},"date":{"type":"string","format":"date"},"runner_id":{"type":["integer","null"],"description":"Null for an unnamed finisher, or a hidden runner without `runners.private`."},"runner_name":{"type":["string","null"]},"placeholder_label":{"type":["string","null"],"description":"Label for an unnamed finisher."},"position":{"type":["integer","null"],"description":"Null when untimed."},"elapsed_seconds":{"type":["integer","null"]},"attendance_type":{"type":["string","null"],"description":"Slug of the attendance type, for untimed results."},"source":{"type":"string","enum":["timer","self_reported","manual","import"]},"note":{"type":["string","null"]},"is_first_run":{"type":"boolean"},"is_pb_all_time":{"type":"boolean"},"is_pb_season":{"type":"boolean"},"is_pb_location":{"type":"boolean"}},"required":["id","run_id","date","runner_id","runner_name","placeholder_label","position","elapsed_seconds","attendance_type","source","note","is_first_run","is_pb_all_time","is_pb_season","is_pb_location"]},"Runner":{"type":"object","properties":{"id":{"type":"integer"},"public_id":{"type":["integer","null"],"description":"The number in their profile link."},"first_name":{"type":"string"},"last_name":{"type":"string"},"name":{"type":"string"},"email":{"type":["string","null"],"format":"email","description":"Only with `runners.private`."},"gender":{"type":["string","null"],"enum":["M","F",null],"description":"Only with `runners.private`."},"is_hidden":{"type":"boolean","description":"Only with `runners.private`."},"merged_into_id":{"type":["integer","null"],"description":"Only with `runners.private`."}},"required":["id","public_id","first_name","last_name","name"]},"AttendanceType":{"type":"object","properties":{"id":{"type":"integer"},"slug":{"type":"string"},"name":{"type":"string"},"counts_as_attendance":{"type":"boolean"},"is_volunteer":{"type":"boolean"},"sort":{"type":"integer"}},"required":["id","slug","name","counts_as_attendance","is_volunteer","sort"]},"Badge":{"type":"object","properties":{"id":{"type":"integer"},"slug":{"type":"string"},"name":{"type":"string"},"description":{"type":"string"},"code":{"type":"string","description":"Up to 4 characters, shown on the badge."},"sort":{"type":"integer"},"automatic":{"type":"boolean","description":"Awarded from results by the club's badge rules."}},"required":["id","slug","name","description","code","sort","automatic"]},"Award":{"type":"object","properties":{"id":{"type":"integer"},"runner_id":{"type":"integer"},"badge_id":{"type":"integer"},"run_id":{"type":["integer","null"]},"awarded_on":{"type":"string","format":"date"},"automatic":{"type":"boolean"}},"required":["id","runner_id","badge_id","run_id","awarded_on","automatic"]},"NewsPost":{"type":"object","properties":{"id":{"type":"integer"},"title":{"type":"string"},"slug":{"type":"string"},"body":{"type":"string","description":"Sanitised HTML."},"published_at":{"type":["string","null"],"format":"date-time","description":"Null for a draft; in the future for a scheduled post."},"byline":{"type":["string","null"]},"run_id":{"type":["integer","null"]},"url":{"type":"string","format":"uri"}},"required":["id","title","slug","body","published_at","byline","run_id","url"]},"RunInput":{"type":"object","description":"Required fields apply when creating.","properties":{"date":{"type":"string","format":"date","description":"One run per date."},"season_id":{"type":"integer"},"status":{"type":"string","enum":["scheduled","live","finalised","published"],"default":"scheduled","description":"Setting `published` makes the run public."},"notes":{"type":["string","null"],"maxLength":2000}},"required":["date","season_id"]},"ResultInput":{"type":"object","description":"Saved as a `manual` result; positions, PBs and badges recalculate shortly after.","properties":{"run_id":{"type":"integer","description":"On create only."},"runner_id":{"type":["integer","null"],"description":"Required unless `placeholder_label` is given. One result per runner per run."},"placeholder_label":{"type":["string","null"],"maxLength":255},"elapsed_seconds":{"type":["integer","null"],"minimum":60,"maximum":14400},"attendance_type":{"type":["string","null"],"description":"An attendance type slug, for untimed results."},"note":{"type":["string","null"],"maxLength":255}},"required":["run_id"]},"NewsPostInput":{"type":"object","description":"Required fields apply when creating.","properties":{"title":{"type":"string","maxLength":255},"slug":{"type":"string","maxLength":255,"pattern":"^[A-Za-z0-9_-]+$"},"body":{"type":"string","maxLength":100000,"description":"HTML, sanitised on save."},"published_at":{"type":["string","null"],"format":"date-time","description":"Null for a draft."},"author_name":{"type":["string","null"],"maxLength":255},"run_id":{"type":["integer","null"]}},"required":["title","slug","body"]},"TimingRun":{"type":"object","properties":{"id":{"type":"integer"},"date":{"type":"string","format":"date"},"status":{"type":"string","enum":["scheduled","live"]},"season":{"type":"string"},"location":{"type":"string"},"route_image_url":{"type":["string","null"],"format":"uri","description":"The route map. Public, no key needed."},"route_gpx_url":{"type":["string","null"],"format":"uri","description":"A GPX download of the route. Public, no key needed."}},"required":["id","date","status","season","location","route_image_url","route_gpx_url"]},"Roster":{"type":"object","properties":{"runners":{"type":"array","items":{"type":"object","properties":{"id":{"type":"integer"},"name":{"type":"string"},"public_id":{"type":["integer","null"]},"predicted":{"type":["integer","null"],"description":"Average of their last four timed runs, in seconds."},"last_seen":{"type":["string","null"],"format":"date"},"recent":{"type":"boolean","description":"Seen in the last 8 weeks."}},"required":["id","name","public_id","predicted","last_seen","recent"]}},"attendance_types":{"type":"array","items":{"type":"object","properties":{"slug":{"type":"string"},"name":{"type":"string"},"is_volunteer":{"type":"boolean"}},"required":["slug","name","is_volunteer"]}}},"required":["runners","attendance_types"]},"RunnerRef":{"description":"Someone on the roster, or someone first checked in tonight under that key.","oneOf":[{"title":"On the roster","type":"object","properties":{"runner_id":{"type":"integer"}},"required":["runner_id"]},{"title":"New tonight","type":"object","properties":{"new":{"type":"string","maxLength":40,"description":"The `key` from their checkin."}},"required":["new"]}]},"TimingEvent":{"type":"object","required":["uuid","type","payload","client_at","device_id"],"properties":{"uuid":{"type":"string","format":"uuid","description":"Made on the device. Resending the same event is safe."},"type":{"type":"string","enum":["checkin","gun","start","finish","assign","self_reported","attendance","back","end","void"]},"payload":{"description":"Depends on `type`. Fields not listed are dropped.","oneOf":[{"title":"checkin","description":"They are here. New runners are created when the run is finalised.","oneOf":[{"title":"Known runner","type":"object","properties":{"runner_id":{"type":"integer"}},"required":["runner_id"]},{"title":"New runner","type":"object","properties":{"new_runner":{"type":"object","properties":{"key":{"type":"string","maxLength":40},"first_name":{"type":"string","maxLength":60},"last_name":{"type":["string","null"],"maxLength":60},"email":{"type":["string","null"],"format":"email","description":"Optional. Saved on the new runner; only hosts and admins see it."}},"required":["key","first_name"]}},"required":["new_runner"]}],"properties":{"estimate_seconds":{"type":["integer","null"],"minimum":300,"maximum":7200,"description":"Their guess, for someone with no history."}}},{"title":"gun","type":"object","description":"The start. If there is more than one, the last counts.","properties":{}},{"title":"start","type":"object","description":"A late starter setting off: their time counts from here, not the gun.","properties":{"runner":{"$ref":"#/components/schemas/RunnerRef"}},"required":["runner"]},{"title":"finish","type":"object","description":"Crossed the line. Up to 10 together; an empty list is \"someone, name later\".","properties":{"runners":{"type":"array","maxItems":10,"items":{"$ref":"#/components/schemas/RunnerRef"}}},"required":["runners"]},{"title":"assign","type":"object","description":"Names an empty finish.","properties":{"finish":{"type":"string","format":"uuid"},"runner":{"$ref":"#/components/schemas/RunnerRef"}},"required":["finish","runner"]},{"title":"self_reported","type":"object","description":"A time they give you.","properties":{"runner":{"$ref":"#/components/schemas/RunnerRef"},"seconds":{"type":"integer","minimum":300,"maximum":7200}},"required":["runner","seconds"]},{"title":"attendance","type":"object","description":"Came but was not timed.","properties":{"runner":{"$ref":"#/components/schemas/RunnerRef"},"type":{"type":"string","description":"An attendance type slug."}},"required":["runner","type"]},{"title":"back","type":"object","description":"A walker is back. Shown live only.","properties":{"runner":{"$ref":"#/components/schemas/RunnerRef"}},"required":["runner"]},{"title":"end","type":"object","description":"The timer has ended the run. Shown live only; void it to carry on.","properties":{}},{"title":"void","type":"object","description":"Undoes one of your earlier events.","properties":{"target":{"type":"string","format":"uuid"}},"required":["target"]}]},"client_at":{"type":"string","format":"date-time","description":"When it happened, by the device clock. Times are finish minus start on that clock, so keep one device as the stopwatch."},"device_id":{"type":"string","maxLength":64}}},"RunState":{"type":"object","properties":{"run":{"type":"object","properties":{"id":{"type":"integer"},"date":{"type":"string","format":"date"},"status":{"type":"string"}},"required":["id","date","status"]},"gun":{"type":["object","null"],"properties":{"uuid":{"type":"string","format":"uuid"},"at":{"type":"string","format":"date-time"}},"required":["uuid","at"]},"end":{"type":["object","null"],"properties":{"uuid":{"type":"string","format":"uuid"},"at":{"type":"string","format":"date-time"}},"required":["uuid","at"]},"people":{"type":"array","items":{"type":"object","properties":{"ref":{"type":"string","description":"`id:4` for a runner on the roster, `new:k1` for someone new tonight."},"runner_id":{"type":["integer","null"]},"name":{"type":["string","null"],"description":"Null for hidden runners when read with a key."},"checked_in_at":{"type":["string","null"],"format":"date-time"},"late":{"type":"boolean","description":"Checked in after the start."},"started_at":{"type":["string","null"],"format":"date-time","description":"Their own start, if they started late."},"finished_at":{"type":["string","null"],"format":"date-time"},"seconds":{"type":["integer","null"],"description":"Elapsed, from their own start or the gun; or a self-reported time."},"source":{"type":["string","null"],"enum":["timer","self_reported"]},"attendance":{"type":["string","null"],"description":"Attendance type slug when untimed, such as `walked`."},"back_at":{"type":["string","null"],"format":"date-time"},"predicted":{"type":["integer","null"],"description":"Average of their last four timed runs, or their estimate."},"estimated":{"type":"boolean","description":"`predicted` is their own estimate."},"run_number":{"type":"integer","description":"Tonight is their Nth pub run."},"milestone":{"type":"boolean","description":"`run_number` is a multiple of 50."},"course_best":{"type":["integer","null"],"description":"Their best at this course before tonight, in seconds."},"events":{"type":"object","description":"The events behind this row, to void.","properties":{"checkin":{"type":["string","null"],"format":"uuid"},"start":{"type":["string","null"],"format":"uuid"},"outcome":{"type":["string","null"],"format":"uuid"},"back":{"type":["string","null"],"format":"uuid"}},"required":["checkin","start","outcome","back"]}},"required":["ref","runner_id","name","checked_in_at","late","started_at","finished_at","seconds","source","attendance","back_at","predicted","estimated","run_number","milestone","course_best","events"]}},"placeholders":{"type":"array","items":{"type":"object","description":"A finish with no name yet: name it with `assign`.","properties":{"uuid":{"type":"string","format":"uuid"},"finished_at":{"type":"string","format":"date-time"},"seconds":{"type":["integer","null"]}},"required":["uuid","finished_at","seconds"]}},"counts":{"type":"object","properties":{"checked_in":{"type":"integer"},"finished":{"type":"integer"},"attendance":{"type":"integer"},"placeholders":{"type":"integer"}},"required":["checked_in","finished","attendance","placeholders"]},"server_time":{"type":"string","format":"date-time"}},"required":["run","gun","end","people","placeholders","counts","server_time"]},"StoredTimingEvent":{"type":"object","properties":{"id":{"type":"integer"},"uuid":{"type":"string","format":"uuid"},"type":{"type":"string","enum":["checkin","gun","start","finish","assign","self_reported","attendance","back","end","void"]},"payload":{"type":"object"},"client_at":{"type":"string","format":"date-time"},"device_id":{"type":"string"}},"required":["id","uuid","type","payload","client_at","device_id"]},"FinaliseResult":{"type":"object","properties":{"finalised":{"type":"boolean"},"unresolved":{"type":"array","items":{"type":"string"},"description":"Checked in with no finish, time or attendance."},"skipped":{"type":"array","items":{"type":"string"},"description":"Already have a manual result for this run."},"timed":{"type":"integer"},"untimed":{"type":"integer"},"placeholders":{"type":"integer"},"newRunners":{"type":"integer"}},"required":["finalised","unresolved","skipped","timed","untimed","placeholders","newRunners"]},"ParticipantRun":{"type":"object","properties":{"id":{"type":"integer"},"date":{"type":"string","format":"date"},"status":{"type":"string","enum":["scheduled","live"]},"location":{"type":"string"},"route_image_url":{"type":["string","null"],"format":"uri"},"route_gpx_url":{"type":["string","null"],"format":"uri"}},"required":["id","date","status","location","route_image_url","route_gpx_url"]},"ParticipantState":{"type":"object","properties":{"run":{"$ref":"#/components/schemas/ParticipantRun"},"gun_at":{"type":["string","null"],"format":"date-time"},"ended_at":{"type":["string","null"],"format":"date-time"},"me":{"type":["object","null"],"properties":{"kind":{"type":"string","enum":["runner","walker","pub"]},"name":{"type":"string"},"late":{"type":"boolean"},"started_at":{"type":["string","null"],"format":"date-time"},"finished_at":{"type":["string","null"],"format":"date-time"},"seconds":{"type":["integer","null"]},"back_at":{"type":["string","null"],"format":"date-time"},"predicted":{"type":["integer","null"]},"run_number":{"type":"integer","description":"Tonight is their Nth pub run."},"milestone":{"type":"boolean"},"course_best":{"type":["integer","null"]}},"required":["kind","name","late","started_at","finished_at","seconds","back_at","predicted","run_number","milestone","course_best"],"description":"Null until this phone checks in."},"counts":{"type":"object","properties":{"checked_in":{"type":"integer"},"finished":{"type":"integer"}},"required":["checked_in","finished"]},"server_time":{"type":"string","format":"date-time"}},"required":["run","gun_at","ended_at","me","counts","server_time"]},"Error":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]},"ValidationError":{"type":"object","properties":{"message":{"type":"string"},"errors":{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}}}},"required":["message","errors"]}}}}