{
  "openapi": "3.1.0",
  "info": {
    "title": "DeltaNerd API",
    "version": "1",
    "description": "Laps, sessions and tracks, free to read with no key. Your own data and changes need an API key from your Account page."
  },
  "servers": [
    {
      "url": "https://www.deltanerd.com/api/v1"
    }
  ],
  "tags": [
    {
      "name": "Tracks",
      "description": "The track library: every circuit and layout, its GPS trace, and its turns, segments and sectors."
    },
    {
      "name": "Records",
      "description": "Leaderboards, records, best laps and best sector times. Public sessions only."
    },
    {
      "name": "Drivers",
      "description": "Drivers with public sessions, by account number."
    },
    {
      "name": "Sessions",
      "description": "Public sessions and laps, and everything about one session: laps, splits, moments, weather, channels."
    },
    {
      "name": "Exports",
      "description": "Laps and sessions in formats other tools read: GPX, KML, CSV, and one lap against another."
    },
    {
      "name": "Service",
      "description": "Is it up."
    },
    {
      "name": "Your account",
      "description": "Needs an API key from your Account page: `Authorization: Bearer dn_...`."
    },
    {
      "name": "Webhooks",
      "description": "DeltaNerd calls your server when something happens to your data. POSTed as JSON to your URL with `X-DeltaNerd-Event`, `X-DeltaNerd-Delivery` and `X-DeltaNerd-Signature: sha256=<HMAC-SHA256 of the raw body, keyed with your webhook's secret>`. Answer with any 2xx. Anything else is retried after 1, 5, 30, 120 and 360 minutes; ten failures in a row turn the webhook off."
    }
  ],
  "components": {
    "securitySchemes": {
      "apiKey": {
        "type": "http",
        "scheme": "bearer",
        "description": "An API key from your Account page."
      }
    },
    "schemas": {
      "Error": {
        "type": "object",
        "properties": {
          "error": {
            "type": "object",
            "properties": {
              "code": {
                "type": "string"
              },
              "message": {
                "type": "string"
              }
            }
          }
        },
        "example": {
          "error": {
            "code": "not_found",
            "message": "Not found."
          }
        }
      }
    },
    "parameters": {
      "SessionId": {
        "name": "id",
        "in": "path",
        "required": true,
        "schema": {
          "type": "integer"
        },
        "description": "The session's number."
      },
      "TrackId": {
        "name": "id",
        "in": "path",
        "required": true,
        "schema": {
          "type": "integer"
        },
        "description": "The track's number. A track is one layout of a venue."
      },
      "Direction": {
        "name": "direction",
        "in": "query",
        "schema": {
          "type": "string",
          "enum": [
            "cw",
            "ccw"
          ]
        },
        "description": "The lap driven this way round. Default: the way the library's trace runs."
      },
      "Limit": {
        "name": "limit",
        "in": "query",
        "schema": {
          "type": "integer"
        },
        "description": "Rows per page, up to 200. Default 50."
      },
      "Cursor": {
        "name": "cursor",
        "in": "query",
        "schema": {
          "type": "string"
        },
        "description": "The `next_cursor` from the last page."
      },
      "Vehicle": {
        "name": "vehicle",
        "in": "query",
        "schema": {
          "type": "string"
        },
        "description": "Only laps in this vehicle, as sessions name it."
      },
      "DriverId": {
        "name": "driver_id",
        "in": "query",
        "schema": {
          "type": "integer"
        },
        "description": "Only this driver."
      },
      "DirectionFilter": {
        "name": "direction",
        "in": "query",
        "schema": {
          "type": "string",
          "enum": [
            "cw",
            "ccw"
          ]
        },
        "description": "Only sessions driven this way round."
      },
      "From": {
        "name": "from",
        "in": "query",
        "schema": {
          "type": "string"
        },
        "description": "From this date, `YYYY-MM-DD`."
      },
      "To": {
        "name": "to",
        "in": "query",
        "schema": {
          "type": "string"
        },
        "description": "To this date, `YYYY-MM-DD`."
      },
      "Year": {
        "name": "year",
        "in": "query",
        "schema": {
          "type": "integer"
        },
        "description": "Only this year."
      },
      "Period": {
        "name": "period",
        "in": "query",
        "schema": {
          "type": "string",
          "enum": [
            "all",
            "year",
            "month",
            "week"
          ]
        },
        "description": "Only the last week, month or year."
      },
      "Video": {
        "name": "video",
        "in": "query",
        "schema": {
          "type": "string",
          "enum": [
            "1"
          ]
        },
        "description": "Only sessions with video."
      },
      "Telemetry": {
        "name": "telemetry",
        "in": "query",
        "schema": {
          "type": "string",
          "enum": [
            "1"
          ]
        },
        "description": "Only sessions with telemetry."
      },
      "DriverPath": {
        "name": "id",
        "in": "path",
        "required": true,
        "schema": {
          "type": "integer"
        },
        "description": "The driver's account number."
      }
    }
  },
  "security": [],
  "paths": {
    "/tracks": {
      "get": {
        "operationId": "listAnnotatedTracks",
        "tags": [
          "Tracks"
        ],
        "summary": "Every track with corners or sectors drawn on it",
        "description": "Positions along the lap are fractions of a lap: 0 is the start/finish line, 1 is back at it.",
        "security": [],
        "responses": {
          "200": {
            "description": "The annotated tracks, whole.",
            "content": {
              "application/json": {
                "example": {
                  "tracks": [
                    {
                      "id": 4654,
                      "full_name": "Spring Mountain - Charleston Peak - Short Course SMR-CharPkSh",
                      "name": "Spring Mountain",
                      "config": "Charleston Peak - Short Course",
                      "short_name": "SMR-CharPkSh",
                      "display": "SMR-CharPkSh",
                      "length_m": 3405.8,
                      "direction": "cw",
                      "centroid_lat": 36.3811261,
                      "centroid_lon": -115.6708932,
                      "sf_a_lat": 36.3792,
                      "sf_a_lon": -115.6721,
                      "sf_b_lat": 36.3793,
                      "sf_b_lon": -115.6718,
                      "trace": [
                        [
                          36.3792,
                          -115.6721
                        ],
                        [
                          36.3794,
                          -115.6719
                        ]
                      ],
                      "aliases": [
                        "CharlestonSS"
                      ],
                      "sync_points": [],
                      "turns": [
                        {
                          "order": 0,
                          "name": "T1",
                          "start": 0.011912,
                          "end": 0.097747
                        }
                      ],
                      "sectors": [
                        {
                          "order": 0,
                          "name": "S1",
                          "start": 0.0,
                          "end": 0.337263
                        }
                      ],
                      "sectors_reversed": []
                    }
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/tracks/library": {
      "get": {
        "operationId": "trackLibrary",
        "tags": [
          "Tracks"
        ],
        "summary": "The whole library as GPS points",
        "description": "Every track with a start/finish line. Corners and sectors are GPS points `[lat, lon, heading_deg]`. Send `If-None-Match` with the last ETag to get a 304 when nothing changed.",
        "security": [],
        "parameters": [
          {
            "name": "If-None-Match",
            "in": "header",
            "schema": {
              "type": "string"
            },
            "description": "The ETag from the last answer."
          }
        ],
        "responses": {
          "200": {
            "description": "The library.",
            "content": {
              "application/json": {
                "example": {
                  "version": 1,
                  "etag": "1f0c9e1d5a2b7c3e4d6f",
                  "tracks": [
                    {
                      "id": 4652,
                      "short_name": "SMR-CharPkFC",
                      "venue": "Spring Mountain - Charleston Peak - Full Course",
                      "display": "Charleston Peak - Full",
                      "length_m": 5151.3,
                      "direction": "cw",
                      "sf": [
                        [
                          36.17967,
                          -115.9139469
                        ],
                        [
                          36.179799,
                          -115.9133155
                        ]
                      ],
                      "sectors": [
                        {
                          "name": "S1",
                          "start": [
                            36.1797,
                            -115.9136,
                            271.4
                          ],
                          "end": [
                            36.1801,
                            -115.9241,
                            182.0
                          ]
                        }
                      ],
                      "turns": [
                        {
                          "name": "T1",
                          "start": [
                            36.1797,
                            -115.9136,
                            271.4
                          ],
                          "end": [
                            36.1799,
                            -115.915,
                            260.2
                          ]
                        }
                      ]
                    }
                  ]
                }
              }
            }
          },
          "304": {
            "description": "Nothing changed since that ETag."
          }
        }
      }
    },
    "/tracks/search": {
      "get": {
        "operationId": "searchTracks",
        "tags": [
          "Tracks"
        ],
        "summary": "Search the track library",
        "description": "All 5,000+ layouts. `public_sessions` counts the public sessions recorded there.",
        "security": [],
        "parameters": [
          {
            "name": "q",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "description": "Part of the name, layout, short name or another name it goes by."
          },
          {
            "name": "country",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "description": "Two-letter country code."
          },
          {
            "name": "city",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "surface",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "near",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "description": "`lat,lon`. Adds `distance_km` and sorts by it."
          },
          {
            "name": "radius_km",
            "in": "query",
            "schema": {
              "type": "number"
            },
            "description": "With `near`. Default 50, up to 500."
          },
          {
            "name": "annotated",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "1"
              ]
            },
            "description": "Only tracks with turns, segments or sectors drawn."
          },
          {
            "name": "driven",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "1"
              ]
            },
            "description": "Only tracks with public sessions."
          },
          {
            "name": "sort",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "name",
                "length",
                "sessions",
                "distance"
              ]
            }
          },
          {
            "$ref": "#/components/parameters/Limit"
          },
          {
            "$ref": "#/components/parameters/Cursor"
          }
        ],
        "responses": {
          "200": {
            "description": "A page of tracks.",
            "content": {
              "application/json": {
                "example": {
                  "tracks": [
                    {
                      "id": 4654,
                      "name": "Spring Mountain",
                      "config": "Charleston Peak - Short Course",
                      "display": "SMR-CharPkSh",
                      "short_name": "SMR-CharPkSh",
                      "full_name": "Spring Mountain - Charleston Peak - Short Course SMR-CharPkSh",
                      "country": "US",
                      "city": "Pahrump",
                      "length_m": 3405.8,
                      "direction": "cw",
                      "centroid": [
                        36.3811261,
                        -115.6708932
                      ],
                      "public_sessions": 12
                    }
                  ],
                  "next_cursor": "50"
                }
              }
            }
          }
        }
      }
    },
    "/tracks/nearest": {
      "get": {
        "operationId": "nearestTracks",
        "tags": [
          "Tracks"
        ],
        "summary": "Every layout at the nearest venue",
        "description": "Looks 50 km out. `venue` is null when nothing is that close.",
        "security": [],
        "parameters": [
          {
            "name": "lat",
            "in": "query",
            "schema": {
              "type": "number"
            },
            "required": true
          },
          {
            "name": "lon",
            "in": "query",
            "schema": {
              "type": "number"
            },
            "required": true
          }
        ],
        "responses": {
          "200": {
            "description": "The venue and its layouts, nearest first.",
            "content": {
              "application/json": {
                "example": {
                  "venue": "Spring Mountain",
                  "tracks": [
                    {
                      "id": 4654,
                      "name": "Spring Mountain",
                      "config": "Charleston Peak - Short Course",
                      "display": "SMR-CharPkSh",
                      "short_name": "SMR-CharPkSh",
                      "full_name": "Spring Mountain - Charleston Peak - Short Course SMR-CharPkSh",
                      "country": "US",
                      "city": "Pahrump",
                      "length_m": 3405.8,
                      "direction": "cw",
                      "centroid": [
                        36.3811261,
                        -115.6708932
                      ],
                      "public_sessions": 12,
                      "distance_km": 0.41
                    }
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/tracks/identify": {
      "post": {
        "operationId": "identifyTrack",
        "tags": [
          "Tracks"
        ],
        "summary": "Which layout a lap was driven on",
        "description": "Send one lap's GPS trace. A match must cover the lap and be covered by it, both at least 90%, and beat the next best by 5%. Otherwise `match` is null.",
        "security": [],
        "requestBody": {
          "required": true,
          "description": "One lap, up to 20,000 points.",
          "content": {
            "application/json": {
              "example": {
                "trace": [
                  [
                    36.3792,
                    -115.6721
                  ],
                  [
                    36.3794,
                    -115.6719
                  ],
                  [
                    36.3797,
                    -115.6714
                  ]
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The match, if any, and the five closest candidates.",
            "content": {
              "application/json": {
                "example": {
                  "match": {
                    "track": {
                      "id": 4654,
                      "name": "Spring Mountain",
                      "config": "Charleston Peak - Short Course",
                      "display": "SMR-CharPkSh",
                      "short_name": "SMR-CharPkSh",
                      "full_name": "Spring Mountain - Charleston Peak - Short Course SMR-CharPkSh",
                      "country": "US",
                      "city": "Pahrump",
                      "length_m": 3405.8,
                      "direction": "cw",
                      "centroid": [
                        36.3811261,
                        -115.6708932
                      ],
                      "public_sessions": 12
                    },
                    "cover_lap": 0.9981,
                    "cover_track": 0.9874,
                    "margin": 0.1432,
                    "decided_by": "coverage",
                    "reversed": false
                  },
                  "lap_direction": "cw",
                  "candidates": [
                    {
                      "track": {
                        "id": 4654,
                        "name": "Spring Mountain",
                        "config": "Charleston Peak - Short Course",
                        "display": "SMR-CharPkSh",
                        "short_name": "SMR-CharPkSh",
                        "full_name": "Spring Mountain - Charleston Peak - Short Course SMR-CharPkSh",
                        "country": "US",
                        "city": "Pahrump",
                        "length_m": 3405.8,
                        "direction": "cw",
                        "centroid": [
                          36.3811261,
                          -115.6708932
                        ],
                        "public_sessions": 12
                      },
                      "cover_lap": 0.9981,
                      "cover_track": 0.9874
                    }
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/tracks/{id}": {
      "get": {
        "operationId": "getTrack",
        "tags": [
          "Tracks"
        ],
        "summary": "One layout, everything about it",
        "security": [],
        "parameters": [
          {
            "$ref": "#/components/parameters/TrackId"
          }
        ],
        "responses": {
          "200": {
            "description": "The layout.",
            "content": {
              "application/json": {
                "example": {
                  "id": 4654,
                  "name": "Spring Mountain",
                  "config": "Charleston Peak - Short Course",
                  "display": "SMR-CharPkSh",
                  "short_name": "SMR-CharPkSh",
                  "full_name": "Spring Mountain - Charleston Peak - Short Course SMR-CharPkSh",
                  "country": "US",
                  "city": "Pahrump",
                  "length_m": 3405.8,
                  "direction": "cw",
                  "centroid": [
                    36.3811261,
                    -115.6708932
                  ],
                  "public_sessions": 12,
                  "aliases": [
                    "CharlestonSS"
                  ],
                  "timezone": "America/Los_Angeles",
                  "surface": "asphalt",
                  "start_finish": {
                    "a": [
                      36.3792,
                      -115.6721
                    ],
                    "b": [
                      36.3793,
                      -115.6718
                    ]
                  },
                  "point_count": 418,
                  "counts": {
                    "turns": 18,
                    "segments": 14,
                    "sectors": 4,
                    "sync_points": 2
                  },
                  "layouts": [
                    {
                      "id": 4652,
                      "name": "Spring Mountain",
                      "config": "Charleston Peak - Full Course",
                      "display": "SMR-CharPkFC",
                      "short_name": "SMR-CharPkSh",
                      "full_name": "Spring Mountain - Charleston Peak - Short Course SMR-CharPkSh",
                      "country": "US",
                      "city": "Pahrump",
                      "length_m": 5151.3,
                      "direction": "cw",
                      "centroid": [
                        36.3811261,
                        -115.6708932
                      ],
                      "public_sessions": 3
                    }
                  ]
                }
              }
            }
          },
          "404": {
            "description": "No such track."
          }
        }
      }
    },
    "/tracks/{id}/geometry": {
      "get": {
        "operationId": "getTrackGeometry",
        "tags": [
          "Tracks"
        ],
        "summary": "The layout's GPS trace",
        "description": "The reference lap, from the start/finish line. `json` lists `[lat, lon, alt_m, distance_m, heading_deg]` per point.",
        "security": [],
        "parameters": [
          {
            "$ref": "#/components/parameters/TrackId"
          },
          {
            "name": "format",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "json",
                "geojson",
                "gpx",
                "kml",
                "csv"
              ]
            },
            "description": "Default `json`."
          },
          {
            "name": "step_m",
            "in": "query",
            "schema": {
              "type": "number"
            },
            "description": "One point per this many meters. Default: every stored point."
          }
        ],
        "responses": {
          "200": {
            "description": "The trace.",
            "content": {
              "application/json": {
                "example": {
                  "track_id": 4654,
                  "length_m": 3405.8,
                  "columns": [
                    "lat",
                    "lon",
                    "alt_m",
                    "distance_m",
                    "heading_deg"
                  ],
                  "points": [
                    [
                      36.3792,
                      -115.6721,
                      812.4,
                      0.0,
                      271.4
                    ],
                    [
                      36.3793,
                      -115.6726,
                      812.6,
                      46.1,
                      270.9
                    ]
                  ]
                }
              }
            }
          },
          "404": {
            "description": "No such track."
          }
        }
      }
    },
    "/tracks/{id}/turns": {
      "get": {
        "operationId": "getTrackTurns",
        "tags": [
          "Tracks"
        ],
        "summary": "Turns: the lap split corner by corner",
        "description": "They tile the lap, like sectors, one per corner. Positions come three ways: `start`/`end` as fractions of a lap (0 is the start/finish line), `start_m`/`end_m` in meters along the reference lap, and `start_point`/`end_point` as `[lat, lon, heading_deg]`. `source` is `stored` when drawn for this direction, `mirrored` when the other direction's is reused, or `none`.",
        "security": [],
        "parameters": [
          {
            "$ref": "#/components/parameters/TrackId"
          },
          {
            "$ref": "#/components/parameters/Direction"
          }
        ],
        "responses": {
          "200": {
            "description": "The turns.",
            "content": {
              "application/json": {
                "example": {
                  "track_id": 4654,
                  "direction": "cw",
                  "turns": {
                    "source": "stored",
                    "items": [
                      {
                        "order": 0,
                        "name": "T1",
                        "label": "Turn 1",
                        "start": 0.0,
                        "end": 0.0976,
                        "start_m": 0.0,
                        "end_m": 332.5,
                        "length_m": 332.5,
                        "start_point": [
                          36.3792,
                          -115.6721,
                          271.4
                        ],
                        "end_point": [
                          36.3801,
                          -115.6655,
                          182.0
                        ]
                      }
                    ]
                  }
                }
              }
            }
          },
          "404": {
            "description": "No such track."
          }
        }
      }
    },
    "/tracks/{id}/segments": {
      "get": {
        "operationId": "getTrackSegments",
        "tags": [
          "Tracks"
        ],
        "summary": "Segments: the named corners",
        "description": "Named stretches like Ego Check or Carousel. They may overlap and may run past the start/finish line, so `end` can be less than `start`. Positions come three ways: `start`/`end` as fractions of a lap (0 is the start/finish line), `start_m`/`end_m` in meters along the reference lap, and `start_point`/`end_point` as `[lat, lon, heading_deg]`. `source` is `stored` when drawn for this direction, `mirrored` when the other direction's is reused, or `none`.",
        "security": [],
        "parameters": [
          {
            "$ref": "#/components/parameters/TrackId"
          },
          {
            "$ref": "#/components/parameters/Direction"
          }
        ],
        "responses": {
          "200": {
            "description": "The segments.",
            "content": {
              "application/json": {
                "example": {
                  "track_id": 4654,
                  "direction": "cw",
                  "segments": {
                    "source": "stored",
                    "items": [
                      {
                        "order": 0,
                        "name": "Ego Check",
                        "label_scale": 1.0,
                        "start": 0.011912,
                        "end": 0.097747,
                        "start_m": 40.6,
                        "end_m": 332.9,
                        "length_m": 292.3,
                        "start_point": [
                          36.3793,
                          -115.6726,
                          270.9
                        ],
                        "end_point": [
                          36.3803,
                          -115.6731,
                          12.4
                        ]
                      }
                    ]
                  }
                }
              }
            }
          },
          "404": {
            "description": "No such track."
          }
        }
      }
    },
    "/tracks/{id}/sectors": {
      "get": {
        "operationId": "getTrackSectors",
        "tags": [
          "Tracks"
        ],
        "summary": "Sectors: the timing splits",
        "description": "They tile the lap: the first starts at 0 and each ends where the next begins. Positions come three ways: `start`/`end` as fractions of a lap (0 is the start/finish line), `start_m`/`end_m` in meters along the reference lap, and `start_point`/`end_point` as `[lat, lon, heading_deg]`. `source` is `stored` when drawn for this direction, `mirrored` when the other direction's is reused, or `none`.",
        "security": [],
        "parameters": [
          {
            "$ref": "#/components/parameters/TrackId"
          },
          {
            "$ref": "#/components/parameters/Direction"
          }
        ],
        "responses": {
          "200": {
            "description": "The sectors.",
            "content": {
              "application/json": {
                "example": {
                  "track_id": 4654,
                  "direction": "cw",
                  "sectors": {
                    "source": "stored",
                    "items": [
                      {
                        "order": 0,
                        "name": "S1",
                        "label": "Sector 1",
                        "start": 0.0,
                        "end": 0.337263,
                        "start_m": 0.0,
                        "end_m": 1148.7,
                        "length_m": 1148.7,
                        "start_point": [
                          36.3792,
                          -115.6721,
                          271.4
                        ],
                        "end_point": [
                          36.3801,
                          -115.6655,
                          182.0
                        ]
                      }
                    ]
                  }
                }
              }
            }
          },
          "404": {
            "description": "No such track."
          }
        }
      }
    },
    "/tracks/{id}/sync-points": {
      "get": {
        "operationId": "getTrackSyncPoints",
        "tags": [
          "Tracks"
        ],
        "summary": "Sync points: where videos are lined up",
        "security": [],
        "parameters": [
          {
            "$ref": "#/components/parameters/TrackId"
          },
          {
            "$ref": "#/components/parameters/Direction"
          }
        ],
        "responses": {
          "200": {
            "description": "The sync points.",
            "content": {
              "application/json": {
                "example": {
                  "track_id": 4654,
                  "direction": "cw",
                  "sync_points": {
                    "source": "stored",
                    "items": [
                      {
                        "order": 0,
                        "name": "Back straight",
                        "position": 0.5124,
                        "at_m": 1745.1,
                        "point": [
                          36.3831,
                          -115.6702,
                          91.3
                        ]
                      }
                    ]
                  }
                }
              }
            }
          },
          "404": {
            "description": "No such track."
          }
        }
      }
    },
    "/tracks/{id}/annotations": {
      "get": {
        "operationId": "getTrackAnnotations",
        "tags": [
          "Tracks"
        ],
        "summary": "Turns, segments, sectors and sync points together",
        "security": [],
        "parameters": [
          {
            "$ref": "#/components/parameters/TrackId"
          },
          {
            "$ref": "#/components/parameters/Direction"
          }
        ],
        "responses": {
          "200": {
            "description": "All four lists, each as on its own endpoint.",
            "content": {
              "application/json": {
                "example": {
                  "track_id": 4654,
                  "direction": "cw",
                  "turns": {
                    "source": "stored",
                    "items": []
                  },
                  "segments": {
                    "source": "stored",
                    "items": []
                  },
                  "sectors": {
                    "source": "stored",
                    "items": [
                      {
                        "order": 0,
                        "name": "S1",
                        "label": "Sector 1",
                        "start": 0.0,
                        "end": 0.337263,
                        "start_m": 0.0,
                        "end_m": 1148.7,
                        "length_m": 1148.7,
                        "start_point": [
                          36.3792,
                          -115.6721,
                          271.4
                        ],
                        "end_point": [
                          36.3801,
                          -115.6655,
                          182.0
                        ]
                      }
                    ]
                  },
                  "sync_points": {
                    "source": "none",
                    "items": []
                  }
                }
              }
            }
          },
          "404": {
            "description": "No such track."
          }
        }
      }
    },
    "/tracks/{id}/map.svg": {
      "get": {
        "operationId": "getTrackMap",
        "tags": [
          "Tracks"
        ],
        "summary": "The layout drawn as an SVG",
        "description": "The trace, the start/finish line, sector cuts and segment names.",
        "security": [],
        "parameters": [
          {
            "$ref": "#/components/parameters/TrackId"
          },
          {
            "name": "theme",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "dark",
                "light"
              ]
            },
            "description": "Default `dark`."
          },
          {
            "name": "labels",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "0"
              ]
            },
            "description": "Leave out the segment names."
          },
          {
            "name": "sectors",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "0"
              ]
            },
            "description": "Leave out the sector cuts."
          }
        ],
        "responses": {
          "200": {
            "description": "The drawing.",
            "content": {
              "image/svg+xml": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "404": {
            "description": "No such track, or it has no drawing."
          }
        }
      }
    },
    "/venues/{name}": {
      "get": {
        "operationId": "getVenue",
        "tags": [
          "Tracks"
        ],
        "summary": "Every layout at one venue",
        "security": [],
        "parameters": [
          {
            "name": "name",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The venue, as a track's `name`: `Spring%20Mountain`."
          }
        ],
        "responses": {
          "200": {
            "description": "The venue's layouts.",
            "content": {
              "application/json": {
                "example": {
                  "venue": "Spring Mountain",
                  "tracks": [
                    {
                      "id": 4654,
                      "name": "Spring Mountain",
                      "config": "Charleston Peak - Short Course",
                      "display": "SMR-CharPkSh",
                      "short_name": "SMR-CharPkSh",
                      "full_name": "Spring Mountain - Charleston Peak - Short Course SMR-CharPkSh",
                      "country": "US",
                      "city": "Pahrump",
                      "length_m": 3405.8,
                      "direction": "cw",
                      "centroid": [
                        36.3811261,
                        -115.6708932
                      ],
                      "public_sessions": 12
                    }
                  ]
                }
              }
            }
          },
          "404": {
            "description": "No such venue."
          }
        }
      }
    },
    "/tracks/{id}/leaderboard": {
      "get": {
        "operationId": "trackLeaderboard",
        "tags": [
          "Records"
        ],
        "summary": "Best lap per driver at a track, ranked",
        "security": [],
        "parameters": [
          {
            "$ref": "#/components/parameters/TrackId"
          },
          {
            "$ref": "#/components/parameters/Vehicle"
          },
          {
            "$ref": "#/components/parameters/DriverId"
          },
          {
            "$ref": "#/components/parameters/DirectionFilter"
          },
          {
            "$ref": "#/components/parameters/From"
          },
          {
            "$ref": "#/components/parameters/To"
          },
          {
            "$ref": "#/components/parameters/Year"
          },
          {
            "$ref": "#/components/parameters/Period"
          },
          {
            "$ref": "#/components/parameters/Video"
          },
          {
            "$ref": "#/components/parameters/Telemetry"
          },
          {
            "name": "per",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "driver",
                "vehicle",
                "driver_vehicle",
                "lap"
              ]
            },
            "description": "One row per driver (default), vehicle, driver and vehicle, or every lap."
          },
          {
            "$ref": "#/components/parameters/Limit"
          }
        ],
        "responses": {
          "200": {
            "description": "Best lap per driver at a track, ranked",
            "content": {
              "application/json": {
                "example": {
                  "track": {
                    "id": 4652,
                    "display": "Charleston Peak - Full",
                    "name": "Spring Mountain",
                    "config": "Charleston Peak - Full Course",
                    "country": "US",
                    "direction": "cw",
                    "length_m": 5151.3
                  },
                  "per": "driver",
                  "rows": [
                    {
                      "rank": 1,
                      "gap_s": 0.0,
                      "session_id": 812,
                      "lap_index": 7,
                      "lap_s": 112.384,
                      "driver_id": 3,
                      "driver": "Cale Orosz",
                      "vehicle": "SR3 XX 1503",
                      "direction": "cw",
                      "date": "2026-10-04",
                      "has_video": true,
                      "viewer_url": "https://www.deltanerd.com/viewer/?session=812&laps=812:7"
                    }
                  ]
                }
              }
            }
          },
          "404": {
            "description": "No such track."
          }
        },
        "description": "From public sessions only. A lap counts if the lap search lists it, so out and in laps never do. One board per direction: `rank` and `gap_s` are within the row's `direction`, and `limit` applies to each board."
      }
    },
    "/tracks/{id}/records": {
      "get": {
        "operationId": "trackRecords",
        "tags": [
          "Records"
        ],
        "summary": "A track's records",
        "security": [],
        "parameters": [
          {
            "$ref": "#/components/parameters/TrackId"
          },
          {
            "$ref": "#/components/parameters/Vehicle"
          },
          {
            "$ref": "#/components/parameters/DriverId"
          },
          {
            "$ref": "#/components/parameters/DirectionFilter"
          },
          {
            "$ref": "#/components/parameters/From"
          },
          {
            "$ref": "#/components/parameters/To"
          },
          {
            "$ref": "#/components/parameters/Year"
          },
          {
            "$ref": "#/components/parameters/Period"
          },
          {
            "$ref": "#/components/parameters/Video"
          },
          {
            "$ref": "#/components/parameters/Telemetry"
          }
        ],
        "responses": {
          "200": {
            "description": "A track's records",
            "content": {
              "application/json": {
                "example": {
                  "track": {
                    "id": 4652,
                    "display": "Charleston Peak - Full",
                    "name": "Spring Mountain",
                    "config": "Charleston Peak - Full Course",
                    "country": "US",
                    "direction": "cw",
                    "length_m": 5151.3
                  },
                  "laps": {
                    "overall": {
                      "session_id": 812,
                      "lap_index": 7,
                      "lap_s": 112.384,
                      "driver_id": 3,
                      "driver": "Cale Orosz",
                      "vehicle": "SR3 XX 1503",
                      "direction": "cw",
                      "date": "2026-10-04",
                      "has_video": true,
                      "viewer_url": "https://www.deltanerd.com/viewer/?session=812&laps=812:7"
                    },
                    "by_direction": {
                      "cw": {
                        "session_id": 812,
                        "lap_index": 7,
                        "lap_s": 112.384,
                        "driver_id": 3,
                        "driver": "Cale Orosz",
                        "vehicle": "SR3 XX 1503",
                        "direction": "cw",
                        "date": "2026-10-04",
                        "has_video": true,
                        "viewer_url": "https://www.deltanerd.com/viewer/?session=812&laps=812:7"
                      }
                    },
                    "by_vehicle": [
                      {
                        "session_id": 812,
                        "lap_index": 7,
                        "lap_s": 112.384,
                        "driver_id": 3,
                        "driver": "Cale Orosz",
                        "vehicle": "SR3 XX 1503",
                        "direction": "cw",
                        "date": "2026-10-04",
                        "has_video": true,
                        "viewer_url": "https://www.deltanerd.com/viewer/?session=812&laps=812:7"
                      }
                    ],
                    "by_year": [
                      {
                        "year": 2026,
                        "session_id": 812,
                        "lap_index": 7,
                        "lap_s": 112.384,
                        "driver_id": 3,
                        "driver": "Cale Orosz",
                        "vehicle": "SR3 XX 1503",
                        "direction": "cw",
                        "date": "2026-10-04",
                        "has_video": true,
                        "viewer_url": "https://www.deltanerd.com/viewer/?session=812&laps=812:7"
                      }
                    ]
                  },
                  "top_speed": {
                    "mps": 63.9,
                    "session_id": 812,
                    "driver_id": 3,
                    "driver": "Cale Orosz",
                    "vehicle": "SR3 XX 1503",
                    "date": "2026-10-04",
                    "viewer_url": "https://www.deltanerd.com/viewer/?session=812"
                  },
                  "sectors": [
                    {
                      "direction": "cw",
                      "items": [
                        {
                          "idx": 0,
                          "name": "S1",
                          "label": "Sector 1",
                          "time_s": 28.911,
                          "session_id": 812,
                          "lap_index": 7,
                          "lap_s": 112.384,
                          "driver_id": 3,
                          "driver": "Cale Orosz",
                          "vehicle": "SR3 XX 1503",
                          "direction": "cw",
                          "date": "2026-10-04",
                          "has_video": true,
                          "viewer_url": "https://www.deltanerd.com/viewer/?session=812&laps=812:7"
                        }
                      ],
                      "optimal_s": 111.207
                    }
                  ],
                  "turns": []
                }
              }
            }
          },
          "404": {
            "description": "No such track."
          }
        },
        "description": "Lap records overall, each way round, per vehicle and per year; the top speed; the best time in every sector and turn, and the optimal lap they add up to. Sector and turn times are measured on each lap the way the viewer measures them. A track's splits belong to one direction of travel, so they come in `sets`, each saying which way round. `by_vehicle` and `by_year` have a row per direction."
      }
    },
    "/tracks/{id}/stats": {
      "get": {
        "operationId": "trackStats",
        "tags": [
          "Records"
        ],
        "summary": "Totals and lap time spread at a track",
        "security": [],
        "parameters": [
          {
            "$ref": "#/components/parameters/TrackId"
          },
          {
            "$ref": "#/components/parameters/Vehicle"
          },
          {
            "$ref": "#/components/parameters/DriverId"
          },
          {
            "$ref": "#/components/parameters/DirectionFilter"
          },
          {
            "$ref": "#/components/parameters/From"
          },
          {
            "$ref": "#/components/parameters/To"
          },
          {
            "$ref": "#/components/parameters/Year"
          },
          {
            "$ref": "#/components/parameters/Period"
          },
          {
            "$ref": "#/components/parameters/Video"
          },
          {
            "$ref": "#/components/parameters/Telemetry"
          },
          {
            "name": "bins",
            "in": "query",
            "schema": {
              "type": "integer"
            },
            "description": "Histogram bins, up to 100. Default 20."
          }
        ],
        "responses": {
          "200": {
            "description": "Totals and lap time spread at a track",
            "content": {
              "application/json": {
                "example": {
                  "track": {
                    "id": 4652,
                    "display": "Charleston Peak - Full",
                    "name": "Spring Mountain",
                    "config": "Charleston Peak - Full Course",
                    "country": "US",
                    "direction": "cw",
                    "length_m": 5151.3
                  },
                  "sessions": 48,
                  "drivers": 4,
                  "vehicles": 3,
                  "laps": 612,
                  "full_laps": 471,
                  "distance_m": 2412880.4,
                  "hours": 21.6,
                  "first": "2026-04-23",
                  "last": "2026-10-19",
                  "lap_times": {
                    "best": 112.384,
                    "p10": 114.02,
                    "median": 118.77,
                    "p90": 126.4,
                    "histogram": {
                      "start_s": 112.384,
                      "bin_s": 0.82,
                      "counts": [
                        3,
                        9,
                        21
                      ]
                    }
                  },
                  "by_month": [
                    {
                      "month": "2026-10",
                      "sessions": 9
                    }
                  ],
                  "busiest_days": [
                    {
                      "date": "2026-10-04",
                      "sessions": 6,
                      "drivers": 3
                    }
                  ],
                  "by_temperature": [
                    {
                      "band_c": [
                        20,
                        25
                      ],
                      "laps": 140,
                      "best": {
                        "session_id": 812,
                        "lap_index": 7,
                        "lap_s": 112.384,
                        "driver_id": 3,
                        "driver": "Cale Orosz",
                        "vehicle": "SR3 XX 1503",
                        "direction": "cw",
                        "date": "2026-10-04",
                        "has_video": true,
                        "viewer_url": "https://www.deltanerd.com/viewer/?session=812&laps=812:7"
                      }
                    }
                  ]
                }
              }
            }
          },
          "404": {
            "description": "No such track."
          }
        },
        "description": "From public sessions only. A lap counts if the lap search lists it, so out and in laps never do. `by_temperature` uses the nearest weather station's air temperature. `lap_times` covers every lap either way round; `lap_times_by_direction` is the same, each way on its own. `by_temperature` has a band per direction."
      }
    },
    "/tracks/{id}/sectors/stats": {
      "get": {
        "operationId": "trackSectorStats",
        "tags": [
          "Records"
        ],
        "summary": "Every sector's best, median and leaders",
        "security": [],
        "parameters": [
          {
            "$ref": "#/components/parameters/TrackId"
          },
          {
            "$ref": "#/components/parameters/Vehicle"
          },
          {
            "$ref": "#/components/parameters/DriverId"
          },
          {
            "$ref": "#/components/parameters/DirectionFilter"
          },
          {
            "$ref": "#/components/parameters/From"
          },
          {
            "$ref": "#/components/parameters/To"
          },
          {
            "$ref": "#/components/parameters/Year"
          },
          {
            "$ref": "#/components/parameters/Period"
          },
          {
            "$ref": "#/components/parameters/Video"
          },
          {
            "$ref": "#/components/parameters/Telemetry"
          }
        ],
        "responses": {
          "200": {
            "description": "Every sector's best, median and leaders",
            "content": {
              "application/json": {
                "example": {
                  "track": {
                    "id": 4652,
                    "display": "Charleston Peak - Full",
                    "name": "Spring Mountain",
                    "config": "Charleston Peak - Full Course",
                    "country": "US",
                    "direction": "cw",
                    "length_m": 5151.3
                  },
                  "sets": [
                    {
                      "direction": "cw",
                      "items": [
                        {
                          "idx": 0,
                          "name": "S1",
                          "label": "Sector 1",
                          "laps": 471,
                          "best": {
                            "idx": 0,
                            "name": "S1",
                            "label": "Sector 1",
                            "time_s": 28.911,
                            "session_id": 812,
                            "lap_index": 7,
                            "lap_s": 112.384,
                            "driver_id": 3,
                            "driver": "Cale Orosz",
                            "vehicle": "SR3 XX 1503",
                            "direction": "cw",
                            "date": "2026-10-04",
                            "has_video": true,
                            "viewer_url": "https://www.deltanerd.com/viewer/?session=812&laps=812:7"
                          },
                          "p10_s": 29.4,
                          "median_s": 30.1
                        }
                      ]
                    }
                  ],
                  "top_drivers": [
                    {
                      "driver_id": 3,
                      "driver": "Cale Orosz",
                      "sets": [
                        {
                          "direction": "cw",
                          "items": [
                            {
                              "idx": 0,
                              "name": "S1",
                              "label": "Sector 1",
                              "time_s": 28.911,
                              "session_id": 812,
                              "lap_index": 7,
                              "lap_s": 112.384,
                              "driver_id": 3,
                              "driver": "Cale Orosz",
                              "vehicle": "SR3 XX 1503",
                              "direction": "cw",
                              "date": "2026-10-04",
                              "has_video": true,
                              "viewer_url": "https://www.deltanerd.com/viewer/?session=812&laps=812:7"
                            }
                          ],
                          "optimal_s": 111.207
                        }
                      ]
                    }
                  ]
                }
              }
            }
          },
          "404": {
            "description": "No such track."
          }
        },
        "description": "Sector and turn times are measured on each lap the way the viewer measures them. A track's splits belong to one direction of travel, so they come in `sets`, each saying which way round."
      }
    },
    "/tracks/{id}/turns/stats": {
      "get": {
        "operationId": "trackTurnStats",
        "tags": [
          "Records"
        ],
        "summary": "Every turn's best time and speeds",
        "security": [],
        "parameters": [
          {
            "$ref": "#/components/parameters/TrackId"
          },
          {
            "$ref": "#/components/parameters/Vehicle"
          },
          {
            "$ref": "#/components/parameters/DriverId"
          },
          {
            "$ref": "#/components/parameters/DirectionFilter"
          },
          {
            "$ref": "#/components/parameters/From"
          },
          {
            "$ref": "#/components/parameters/To"
          },
          {
            "$ref": "#/components/parameters/Year"
          },
          {
            "$ref": "#/components/parameters/Period"
          },
          {
            "$ref": "#/components/parameters/Video"
          },
          {
            "$ref": "#/components/parameters/Telemetry"
          }
        ],
        "responses": {
          "200": {
            "description": "Every turn's best time and speeds",
            "content": {
              "application/json": {
                "example": {
                  "track": {
                    "id": 4652,
                    "display": "Charleston Peak - Full",
                    "name": "Spring Mountain",
                    "config": "Charleston Peak - Full Course",
                    "country": "US",
                    "direction": "cw",
                    "length_m": 5151.3
                  },
                  "sets": [
                    {
                      "direction": "cw",
                      "items": [
                        {
                          "idx": 0,
                          "name": "T1",
                          "label": "Turn 1",
                          "laps": 471,
                          "best": {
                            "idx": 0,
                            "name": "T1",
                            "label": "Turn 1",
                            "time_s": 6.204,
                            "session_id": 812,
                            "lap_index": 7,
                            "lap_s": 112.384,
                            "driver_id": 3,
                            "driver": "Cale Orosz",
                            "vehicle": "SR3 XX 1503",
                            "direction": "cw",
                            "date": "2026-10-04",
                            "has_video": true,
                            "viewer_url": "https://www.deltanerd.com/viewer/?session=812&laps=812:7"
                          },
                          "p10_s": 6.4,
                          "median_s": 6.7,
                          "best_min_speed": {
                            "mps": 31.2,
                            "session_id": 812,
                            "lap_index": 7,
                            "lap_s": 112.384,
                            "driver_id": 3,
                            "driver": "Cale Orosz",
                            "vehicle": "SR3 XX 1503",
                            "direction": "cw",
                            "date": "2026-10-04",
                            "has_video": true,
                            "viewer_url": "https://www.deltanerd.com/viewer/?session=812&laps=812:7"
                          },
                          "best_entry_speed": {
                            "mps": 52.8,
                            "session_id": 812,
                            "lap_index": 7,
                            "lap_s": 112.384,
                            "driver_id": 3,
                            "driver": "Cale Orosz",
                            "vehicle": "SR3 XX 1503",
                            "direction": "cw",
                            "date": "2026-10-04",
                            "has_video": true,
                            "viewer_url": "https://www.deltanerd.com/viewer/?session=812&laps=812:7"
                          },
                          "best_exit_speed": {
                            "mps": 41.5,
                            "session_id": 812,
                            "lap_index": 7,
                            "lap_s": 112.384,
                            "driver_id": 3,
                            "driver": "Cale Orosz",
                            "vehicle": "SR3 XX 1503",
                            "direction": "cw",
                            "date": "2026-10-04",
                            "has_video": true,
                            "viewer_url": "https://www.deltanerd.com/viewer/?session=812&laps=812:7"
                          }
                        }
                      ]
                    }
                  ],
                  "top_drivers": []
                }
              }
            }
          },
          "404": {
            "description": "No such track."
          }
        },
        "description": "Speeds are meters per second: at the turn's start, its slowest, and its end. Sector and turn times are measured on each lap the way the viewer measures them. A track's splits belong to one direction of travel, so they come in `sets`, each saying which way round."
      }
    },
    "/tracks/{id}/vehicles": {
      "get": {
        "operationId": "trackVehicles",
        "tags": [
          "Records"
        ],
        "summary": "Vehicles driven at a track",
        "security": [],
        "parameters": [
          {
            "$ref": "#/components/parameters/TrackId"
          },
          {
            "$ref": "#/components/parameters/Vehicle"
          },
          {
            "$ref": "#/components/parameters/DriverId"
          },
          {
            "$ref": "#/components/parameters/DirectionFilter"
          },
          {
            "$ref": "#/components/parameters/From"
          },
          {
            "$ref": "#/components/parameters/To"
          },
          {
            "$ref": "#/components/parameters/Year"
          },
          {
            "$ref": "#/components/parameters/Period"
          },
          {
            "$ref": "#/components/parameters/Video"
          },
          {
            "$ref": "#/components/parameters/Telemetry"
          }
        ],
        "responses": {
          "200": {
            "description": "Vehicles driven at a track",
            "content": {
              "application/json": {
                "example": {
                  "track": {
                    "id": 4652,
                    "display": "Charleston Peak - Full",
                    "name": "Spring Mountain",
                    "config": "Charleston Peak - Full Course",
                    "country": "US",
                    "direction": "cw",
                    "length_m": 5151.3
                  },
                  "vehicles": [
                    {
                      "vehicle": "SR3 XX 1503",
                      "sessions": 31,
                      "laps": 402,
                      "drivers": 2,
                      "top_speed_mps": 63.9,
                      "best": {
                        "session_id": 812,
                        "lap_index": 7,
                        "lap_s": 112.384,
                        "driver_id": 3,
                        "driver": "Cale Orosz",
                        "vehicle": "SR3 XX 1503",
                        "direction": "cw",
                        "date": "2026-10-04",
                        "has_video": true,
                        "viewer_url": "https://www.deltanerd.com/viewer/?session=812&laps=812:7"
                      }
                    }
                  ]
                }
              }
            }
          },
          "404": {
            "description": "No such track."
          }
        },
        "description": "From public sessions only. A lap counts if the lap search lists it, so out and in laps never do. One row per vehicle per direction."
      }
    },
    "/tracks/{id}/drivers": {
      "get": {
        "operationId": "trackDrivers",
        "tags": [
          "Records"
        ],
        "summary": "Drivers at a track",
        "security": [],
        "parameters": [
          {
            "$ref": "#/components/parameters/TrackId"
          },
          {
            "$ref": "#/components/parameters/Vehicle"
          },
          {
            "$ref": "#/components/parameters/DriverId"
          },
          {
            "$ref": "#/components/parameters/DirectionFilter"
          },
          {
            "$ref": "#/components/parameters/From"
          },
          {
            "$ref": "#/components/parameters/To"
          },
          {
            "$ref": "#/components/parameters/Year"
          },
          {
            "$ref": "#/components/parameters/Period"
          },
          {
            "$ref": "#/components/parameters/Video"
          },
          {
            "$ref": "#/components/parameters/Telemetry"
          }
        ],
        "responses": {
          "200": {
            "description": "Drivers at a track",
            "content": {
              "application/json": {
                "example": {
                  "track": {
                    "id": 4652,
                    "display": "Charleston Peak - Full",
                    "name": "Spring Mountain",
                    "config": "Charleston Peak - Full Course",
                    "country": "US",
                    "direction": "cw",
                    "length_m": 5151.3
                  },
                  "drivers": [
                    {
                      "driver_id": 3,
                      "driver": "Cale Orosz",
                      "sessions": 31,
                      "laps": 402,
                      "last_visit": "2026-10-19",
                      "best": {
                        "session_id": 812,
                        "lap_index": 7,
                        "lap_s": 112.384,
                        "driver_id": 3,
                        "driver": "Cale Orosz",
                        "vehicle": "SR3 XX 1503",
                        "direction": "cw",
                        "date": "2026-10-04",
                        "has_video": true,
                        "viewer_url": "https://www.deltanerd.com/viewer/?session=812&laps=812:7"
                      }
                    }
                  ]
                }
              }
            }
          },
          "404": {
            "description": "No such track."
          }
        },
        "description": "From public sessions only. A lap counts if the lap search lists it, so out and in laps never do. One row per driver per direction."
      }
    },
    "/tracks/{id}/drivers/{driver_id}": {
      "get": {
        "operationId": "trackDriver",
        "tags": [
          "Records"
        ],
        "summary": "One driver at one track",
        "security": [],
        "parameters": [
          {
            "$ref": "#/components/parameters/TrackId"
          },
          {
            "name": "driver_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            }
          },
          {
            "$ref": "#/components/parameters/Vehicle"
          },
          {
            "$ref": "#/components/parameters/DriverId"
          },
          {
            "$ref": "#/components/parameters/DirectionFilter"
          },
          {
            "$ref": "#/components/parameters/From"
          },
          {
            "$ref": "#/components/parameters/To"
          },
          {
            "$ref": "#/components/parameters/Year"
          },
          {
            "$ref": "#/components/parameters/Period"
          },
          {
            "$ref": "#/components/parameters/Video"
          },
          {
            "$ref": "#/components/parameters/Telemetry"
          }
        ],
        "responses": {
          "200": {
            "description": "One driver at one track",
            "content": {
              "application/json": {
                "example": {
                  "track": {
                    "id": 4652,
                    "display": "Charleston Peak - Full",
                    "name": "Spring Mountain",
                    "config": "Charleston Peak - Full Course",
                    "country": "US",
                    "direction": "cw",
                    "length_m": 5151.3
                  },
                  "driver_id": 3,
                  "driver": "Cale Orosz",
                  "sessions": 31,
                  "laps": 402,
                  "best": {
                    "rank": 1,
                    "session_id": 812,
                    "lap_index": 7,
                    "lap_s": 112.384,
                    "driver_id": 3,
                    "driver": "Cale Orosz",
                    "vehicle": "SR3 XX 1503",
                    "direction": "cw",
                    "date": "2026-10-04",
                    "has_video": true,
                    "viewer_url": "https://www.deltanerd.com/viewer/?session=812&laps=812:7"
                  },
                  "sectors": [
                    {
                      "direction": "cw",
                      "items": [
                        {
                          "idx": 0,
                          "name": "S1",
                          "label": "Sector 1",
                          "time_s": 28.911,
                          "session_id": 812,
                          "lap_index": 7,
                          "lap_s": 112.384,
                          "driver_id": 3,
                          "driver": "Cale Orosz",
                          "vehicle": "SR3 XX 1503",
                          "direction": "cw",
                          "date": "2026-10-04",
                          "has_video": true,
                          "viewer_url": "https://www.deltanerd.com/viewer/?session=812&laps=812:7"
                        }
                      ],
                      "optimal_s": 111.207
                    }
                  ],
                  "turns": [],
                  "progress": [
                    {
                      "date": "2026-04-23",
                      "session_id": 3,
                      "best_lap_s": 118.2,
                      "personal_best": true,
                      "viewer_url": "https://www.deltanerd.com/viewer/?session=3&laps=3:4"
                    }
                  ]
                }
              }
            }
          },
          "404": {
            "description": "No such track, or no public laps by that driver there."
          }
        },
        "description": "Their best lap and rank, their best time in every sector and turn with the lap that set it, their optimal lap, and their best lap at each visit. Sector and turn times are measured on each lap the way the viewer measures them. A track's splits belong to one direction of travel, so they come in `sets`, each saying which way round. `best` is their fastest either way round, ranked within its direction; `best_by_direction` has each way on its own. A visit is a personal best against that direction only."
      }
    },
    "/tracks/{id}/progression": {
      "get": {
        "operationId": "trackProgression",
        "tags": [
          "Records"
        ],
        "summary": "How the lap record fell over time",
        "security": [],
        "parameters": [
          {
            "$ref": "#/components/parameters/TrackId"
          },
          {
            "$ref": "#/components/parameters/Vehicle"
          },
          {
            "$ref": "#/components/parameters/DriverId"
          },
          {
            "$ref": "#/components/parameters/DirectionFilter"
          },
          {
            "$ref": "#/components/parameters/From"
          },
          {
            "$ref": "#/components/parameters/To"
          },
          {
            "$ref": "#/components/parameters/Year"
          },
          {
            "$ref": "#/components/parameters/Period"
          },
          {
            "$ref": "#/components/parameters/Video"
          },
          {
            "$ref": "#/components/parameters/Telemetry"
          }
        ],
        "responses": {
          "200": {
            "description": "How the lap record fell over time",
            "content": {
              "application/json": {
                "example": {
                  "track": {
                    "id": 4652,
                    "display": "Charleston Peak - Full",
                    "name": "Spring Mountain",
                    "config": "Charleston Peak - Full Course",
                    "country": "US",
                    "direction": "cw",
                    "length_m": 5151.3
                  },
                  "records": [
                    {
                      "improvement_s": null,
                      "session_id": 812,
                      "lap_index": 7,
                      "lap_s": 112.384,
                      "driver_id": 3,
                      "driver": "Cale Orosz",
                      "vehicle": "SR3 XX 1503",
                      "direction": "cw",
                      "date": "2026-10-04",
                      "has_video": true,
                      "viewer_url": "https://www.deltanerd.com/viewer/?session=812&laps=812:7"
                    },
                    {
                      "improvement_s": 1.042,
                      "session_id": 812,
                      "lap_index": 7,
                      "lap_s": 112.384,
                      "driver_id": 3,
                      "driver": "Cale Orosz",
                      "vehicle": "SR3 XX 1503",
                      "direction": "cw",
                      "date": "2026-10-04",
                      "has_video": true,
                      "viewer_url": "https://www.deltanerd.com/viewer/?session=812&laps=812:7"
                    }
                  ]
                }
              }
            }
          },
          "404": {
            "description": "No such track."
          }
        },
        "description": "From public sessions only. A lap counts if the lap search lists it, so out and in laps never do. The record falls separately in each direction."
      }
    },
    "/tracks/popular": {
      "get": {
        "operationId": "popularTracks",
        "tags": [
          "Records"
        ],
        "summary": "Tracks with the most public sessions",
        "security": [],
        "parameters": [
          {
            "$ref": "#/components/parameters/Vehicle"
          },
          {
            "$ref": "#/components/parameters/DriverId"
          },
          {
            "$ref": "#/components/parameters/DirectionFilter"
          },
          {
            "$ref": "#/components/parameters/From"
          },
          {
            "$ref": "#/components/parameters/To"
          },
          {
            "$ref": "#/components/parameters/Year"
          },
          {
            "$ref": "#/components/parameters/Period"
          },
          {
            "$ref": "#/components/parameters/Video"
          },
          {
            "$ref": "#/components/parameters/Telemetry"
          },
          {
            "name": "country",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "description": "Two-letter country code."
          },
          {
            "name": "sort",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "sessions",
                "drivers",
                "distance_m"
              ]
            }
          },
          {
            "$ref": "#/components/parameters/Limit"
          }
        ],
        "responses": {
          "200": {
            "description": "Tracks with the most public sessions",
            "content": {
              "application/json": {
                "example": {
                  "tracks": [
                    {
                      "track": {
                        "id": 4652,
                        "display": "Charleston Peak - Full",
                        "name": "Spring Mountain",
                        "config": "Charleston Peak - Full Course",
                        "country": "US",
                        "direction": "cw",
                        "length_m": 5151.3
                      },
                      "sessions": 48,
                      "drivers": 4,
                      "distance_m": 2412880.4
                    }
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/bests": {
      "get": {
        "operationId": "bests",
        "tags": [
          "Records"
        ],
        "summary": "Best lap at each track for each driver",
        "security": [],
        "parameters": [
          {
            "name": "track_id",
            "in": "query",
            "schema": {
              "type": "integer"
            },
            "description": "Only this track."
          },
          {
            "$ref": "#/components/parameters/Vehicle"
          },
          {
            "$ref": "#/components/parameters/DriverId"
          },
          {
            "$ref": "#/components/parameters/DirectionFilter"
          },
          {
            "$ref": "#/components/parameters/From"
          },
          {
            "$ref": "#/components/parameters/To"
          },
          {
            "$ref": "#/components/parameters/Year"
          },
          {
            "$ref": "#/components/parameters/Period"
          },
          {
            "$ref": "#/components/parameters/Video"
          },
          {
            "$ref": "#/components/parameters/Telemetry"
          },
          {
            "name": "country",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "description": "Only tracks in this country."
          },
          {
            "name": "per",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "driver",
                "driver_vehicle"
              ]
            },
            "description": "One row per driver (default), or per driver and vehicle."
          },
          {
            "$ref": "#/components/parameters/Limit"
          },
          {
            "$ref": "#/components/parameters/Cursor"
          }
        ],
        "responses": {
          "200": {
            "description": "Best lap at each track for each driver",
            "content": {
              "application/json": {
                "example": {
                  "rows": [
                    {
                      "track": {
                        "id": 4652,
                        "display": "Charleston Peak - Full",
                        "name": "Spring Mountain",
                        "config": "Charleston Peak - Full Course",
                        "country": "US",
                        "direction": "cw",
                        "length_m": 5151.3
                      },
                      "rank": 1,
                      "gap_to_record_s": 0.0,
                      "session_id": 812,
                      "lap_index": 7,
                      "lap_s": 112.384,
                      "driver_id": 3,
                      "driver": "Cale Orosz",
                      "vehicle": "SR3 XX 1503",
                      "direction": "cw",
                      "date": "2026-10-04",
                      "has_video": true,
                      "viewer_url": "https://www.deltanerd.com/viewer/?session=812&laps=812:7",
                      "sectors": [
                        {
                          "name": "S1",
                          "label": "Sector 1",
                          "time_s": 28.911
                        }
                      ]
                    }
                  ],
                  "next_cursor": null
                }
              }
            }
          }
        },
        "description": "Ranked within each track. `driver_id` narrows the rows but not the ranking. From public sessions only. A lap counts if the lap search lists it, so out and in laps never do. One row per track, direction and driver, ranked within the track and direction."
      }
    },
    "/bests/sectors": {
      "get": {
        "operationId": "bestSectors",
        "tags": [
          "Records"
        ],
        "summary": "Best sector times at each track for each driver",
        "security": [],
        "parameters": [
          {
            "name": "track_id",
            "in": "query",
            "schema": {
              "type": "integer"
            },
            "description": "Only this track."
          },
          {
            "$ref": "#/components/parameters/Vehicle"
          },
          {
            "$ref": "#/components/parameters/DriverId"
          },
          {
            "$ref": "#/components/parameters/DirectionFilter"
          },
          {
            "$ref": "#/components/parameters/From"
          },
          {
            "$ref": "#/components/parameters/To"
          },
          {
            "$ref": "#/components/parameters/Year"
          },
          {
            "$ref": "#/components/parameters/Period"
          },
          {
            "$ref": "#/components/parameters/Video"
          },
          {
            "$ref": "#/components/parameters/Telemetry"
          },
          {
            "name": "country",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "description": "Only tracks in this country."
          },
          {
            "$ref": "#/components/parameters/Limit"
          },
          {
            "$ref": "#/components/parameters/Cursor"
          }
        ],
        "responses": {
          "200": {
            "description": "Best sector times at each track for each driver",
            "content": {
              "application/json": {
                "example": {
                  "rows": [
                    {
                      "track": {
                        "id": 4652,
                        "display": "Charleston Peak - Full",
                        "name": "Spring Mountain",
                        "config": "Charleston Peak - Full Course",
                        "country": "US",
                        "direction": "cw",
                        "length_m": 5151.3
                      },
                      "driver_id": 3,
                      "driver": "Cale Orosz",
                      "direction": "cw",
                      "sectors": [
                        {
                          "idx": 0,
                          "name": "S1",
                          "label": "Sector 1",
                          "time_s": 28.911,
                          "gap_s": 0.0,
                          "session_id": 812,
                          "lap_index": 7,
                          "viewer_url": "https://www.deltanerd.com/viewer/?session=812&laps=812:7"
                        }
                      ],
                      "optimal_s": 111.207,
                      "track_optimal_s": 110.981
                    }
                  ],
                  "next_cursor": null
                }
              }
            }
          }
        },
        "description": "Each driver's best time in every sector, each from whichever lap set it; the optimal lap those add up to; and each sector's gap to the best anyone has driven it. Sector and turn times are measured on each lap the way the viewer measures them. A track's splits belong to one direction of travel, so they come in `sets`, each saying which way round."
      }
    },
    "/stats": {
      "get": {
        "operationId": "siteStats",
        "tags": [
          "Records"
        ],
        "summary": "Totals across every public session",
        "security": [],
        "parameters": [
          {
            "$ref": "#/components/parameters/Vehicle"
          },
          {
            "$ref": "#/components/parameters/DriverId"
          },
          {
            "$ref": "#/components/parameters/DirectionFilter"
          },
          {
            "$ref": "#/components/parameters/From"
          },
          {
            "$ref": "#/components/parameters/To"
          },
          {
            "$ref": "#/components/parameters/Year"
          },
          {
            "$ref": "#/components/parameters/Period"
          },
          {
            "$ref": "#/components/parameters/Video"
          },
          {
            "$ref": "#/components/parameters/Telemetry"
          }
        ],
        "responses": {
          "200": {
            "description": "Totals across every public session",
            "content": {
              "application/json": {
                "example": {
                  "sessions": 126,
                  "laps": 930,
                  "full_laps": 727,
                  "distance_m": 6120400.2,
                  "hours": 61.4,
                  "drivers": 5,
                  "tracks": 8,
                  "vehicles": 6,
                  "active_tracks_this_month": [
                    {
                      "track": {
                        "id": 4652,
                        "display": "Charleston Peak - Full",
                        "name": "Spring Mountain",
                        "config": "Charleston Peak - Full Course",
                        "country": "US",
                        "direction": "cw",
                        "length_m": 5151.3
                      },
                      "sessions": 9
                    }
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/vehicles": {
      "get": {
        "operationId": "vehicles",
        "tags": [
          "Records"
        ],
        "summary": "Vehicles across public sessions",
        "security": [],
        "parameters": [
          {
            "$ref": "#/components/parameters/Vehicle"
          },
          {
            "$ref": "#/components/parameters/DriverId"
          },
          {
            "$ref": "#/components/parameters/DirectionFilter"
          },
          {
            "$ref": "#/components/parameters/From"
          },
          {
            "$ref": "#/components/parameters/To"
          },
          {
            "$ref": "#/components/parameters/Year"
          },
          {
            "$ref": "#/components/parameters/Period"
          },
          {
            "$ref": "#/components/parameters/Video"
          },
          {
            "$ref": "#/components/parameters/Telemetry"
          }
        ],
        "responses": {
          "200": {
            "description": "Vehicles across public sessions",
            "content": {
              "application/json": {
                "example": {
                  "vehicles": [
                    {
                      "vehicle": "SR3 XX 1503",
                      "sessions": 61,
                      "laps": 610,
                      "tracks": 5,
                      "drivers": 2
                    }
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/vehicles/{name}/records": {
      "get": {
        "operationId": "vehicleRecords",
        "tags": [
          "Records"
        ],
        "summary": "A vehicle's best lap at every track",
        "security": [],
        "parameters": [
          {
            "name": "name",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The vehicle, as sessions name it."
          },
          {
            "$ref": "#/components/parameters/Vehicle"
          },
          {
            "$ref": "#/components/parameters/DriverId"
          },
          {
            "$ref": "#/components/parameters/DirectionFilter"
          },
          {
            "$ref": "#/components/parameters/From"
          },
          {
            "$ref": "#/components/parameters/To"
          },
          {
            "$ref": "#/components/parameters/Year"
          },
          {
            "$ref": "#/components/parameters/Period"
          },
          {
            "$ref": "#/components/parameters/Video"
          },
          {
            "$ref": "#/components/parameters/Telemetry"
          }
        ],
        "responses": {
          "200": {
            "description": "A vehicle's best lap at every track",
            "content": {
              "application/json": {
                "example": {
                  "vehicle": "SR3 XX 1503",
                  "tracks": [
                    {
                      "track": {
                        "id": 4652,
                        "display": "Charleston Peak - Full",
                        "name": "Spring Mountain",
                        "config": "Charleston Peak - Full Course",
                        "country": "US",
                        "direction": "cw",
                        "length_m": 5151.3
                      },
                      "session_id": 812,
                      "lap_index": 7,
                      "lap_s": 112.384,
                      "driver_id": 3,
                      "driver": "Cale Orosz",
                      "vehicle": "SR3 XX 1503",
                      "direction": "cw",
                      "date": "2026-10-04",
                      "has_video": true,
                      "viewer_url": "https://www.deltanerd.com/viewer/?session=812&laps=812:7"
                    }
                  ]
                }
              }
            }
          },
          "404": {
            "description": "No public laps in that vehicle."
          }
        },
        "description": "One row per track per direction."
      }
    },
    "/drivers": {
      "get": {
        "operationId": "drivers",
        "tags": [
          "Drivers"
        ],
        "summary": "Drivers with public sessions",
        "security": [],
        "parameters": [
          {
            "name": "q",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "description": "Part of the name."
          },
          {
            "name": "track_id",
            "in": "query",
            "schema": {
              "type": "integer"
            },
            "description": "Only drivers seen at this track."
          },
          {
            "name": "sort",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "sessions",
                "name",
                "recent"
              ]
            }
          },
          {
            "$ref": "#/components/parameters/Vehicle"
          },
          {
            "$ref": "#/components/parameters/DriverId"
          },
          {
            "$ref": "#/components/parameters/DirectionFilter"
          },
          {
            "$ref": "#/components/parameters/From"
          },
          {
            "$ref": "#/components/parameters/To"
          },
          {
            "$ref": "#/components/parameters/Year"
          },
          {
            "$ref": "#/components/parameters/Period"
          },
          {
            "$ref": "#/components/parameters/Video"
          },
          {
            "$ref": "#/components/parameters/Telemetry"
          },
          {
            "$ref": "#/components/parameters/Limit"
          },
          {
            "$ref": "#/components/parameters/Cursor"
          }
        ],
        "responses": {
          "200": {
            "description": "Drivers with public sessions",
            "content": {
              "application/json": {
                "example": {
                  "drivers": [
                    {
                      "tracks": 3,
                      "driver_id": 3,
                      "driver": "Cale Orosz",
                      "sessions": 61,
                      "laps": 610,
                      "last_active": "2026-10-19"
                    }
                  ],
                  "next_cursor": null
                }
              }
            }
          }
        }
      }
    },
    "/drivers/{id}": {
      "get": {
        "operationId": "driver",
        "tags": [
          "Drivers"
        ],
        "summary": "A driver's public profile",
        "security": [],
        "parameters": [
          {
            "$ref": "#/components/parameters/DriverPath"
          }
        ],
        "responses": {
          "200": {
            "description": "A driver's public profile",
            "content": {
              "application/json": {
                "example": {
                  "id": 3,
                  "name": "Cale Orosz",
                  "sessions": 61,
                  "laps": 712,
                  "full_laps": 610,
                  "distance_m": 3120400.5,
                  "hours": 30.2,
                  "first": "2026-04-23",
                  "last": "2026-10-19",
                  "vehicles": [
                    "SR3 XX 1503"
                  ],
                  "tracks": [
                    {
                      "id": 4652,
                      "display": "Charleston Peak - Full",
                      "name": "Spring Mountain",
                      "config": "Charleston Peak - Full Course",
                      "country": "US",
                      "direction": "cw",
                      "length_m": 5151.3
                    }
                  ]
                }
              }
            }
          },
          "404": {
            "description": "No such driver, or none of their sessions are public."
          }
        },
        "description": "Only drivers with public sessions are found."
      }
    },
    "/drivers/{id}/bests": {
      "get": {
        "operationId": "driverBests",
        "tags": [
          "Drivers"
        ],
        "summary": "A driver's best lap at every track",
        "security": [],
        "parameters": [
          {
            "$ref": "#/components/parameters/DriverPath"
          },
          {
            "$ref": "#/components/parameters/Vehicle"
          },
          {
            "$ref": "#/components/parameters/DriverId"
          },
          {
            "$ref": "#/components/parameters/DirectionFilter"
          },
          {
            "$ref": "#/components/parameters/From"
          },
          {
            "$ref": "#/components/parameters/To"
          },
          {
            "$ref": "#/components/parameters/Year"
          },
          {
            "$ref": "#/components/parameters/Period"
          },
          {
            "$ref": "#/components/parameters/Video"
          },
          {
            "$ref": "#/components/parameters/Telemetry"
          }
        ],
        "responses": {
          "200": {
            "description": "A driver's best lap at every track",
            "content": {
              "application/json": {
                "example": {
                  "driver_id": 3,
                  "bests": [
                    {
                      "track": {
                        "id": 4652,
                        "display": "Charleston Peak - Full",
                        "name": "Spring Mountain",
                        "config": "Charleston Peak - Full Course",
                        "country": "US",
                        "direction": "cw",
                        "length_m": 5151.3
                      },
                      "rank": 1,
                      "gap_to_record_s": 0.0,
                      "session_id": 812,
                      "lap_index": 7,
                      "lap_s": 112.384,
                      "driver_id": 3,
                      "driver": "Cale Orosz",
                      "vehicle": "SR3 XX 1503",
                      "direction": "cw",
                      "date": "2026-10-04",
                      "has_video": true,
                      "viewer_url": "https://www.deltanerd.com/viewer/?session=812&laps=812:7",
                      "sectors": []
                    }
                  ]
                }
              }
            }
          },
          "404": {
            "description": "No such driver."
          }
        },
        "description": "With their rank on each track's leaderboard. One row per track and direction."
      }
    },
    "/drivers/{id}/records": {
      "get": {
        "operationId": "driverRecords",
        "tags": [
          "Drivers"
        ],
        "summary": "Track records a driver holds",
        "security": [],
        "parameters": [
          {
            "$ref": "#/components/parameters/DriverPath"
          }
        ],
        "responses": {
          "200": {
            "description": "Track records a driver holds",
            "content": {
              "application/json": {
                "example": {
                  "driver_id": 3,
                  "records": [
                    {
                      "kind": "lap",
                      "track": {
                        "id": 4652,
                        "display": "Charleston Peak - Full",
                        "name": "Spring Mountain",
                        "config": "Charleston Peak - Full Course",
                        "country": "US",
                        "direction": "cw",
                        "length_m": 5151.3
                      },
                      "session_id": 812,
                      "lap_index": 7,
                      "lap_s": 112.384,
                      "driver_id": 3,
                      "driver": "Cale Orosz",
                      "vehicle": "SR3 XX 1503",
                      "direction": "cw",
                      "date": "2026-10-04",
                      "has_video": true,
                      "viewer_url": "https://www.deltanerd.com/viewer/?session=812&laps=812:7"
                    },
                    {
                      "kind": "sector",
                      "track": {
                        "id": 4652,
                        "display": "Charleston Peak - Full",
                        "name": "Spring Mountain",
                        "config": "Charleston Peak - Full Course",
                        "country": "US",
                        "direction": "cw",
                        "length_m": 5151.3
                      },
                      "direction": "cw",
                      "idx": 0,
                      "name": "S1",
                      "label": "Sector 1",
                      "time_s": 28.911,
                      "session_id": 812,
                      "lap_index": 7,
                      "lap_s": 112.384,
                      "driver_id": 3,
                      "driver": "Cale Orosz",
                      "vehicle": "SR3 XX 1503",
                      "date": "2026-10-04",
                      "has_video": true,
                      "viewer_url": "https://www.deltanerd.com/viewer/?session=812&laps=812:7"
                    }
                  ]
                }
              }
            }
          },
          "404": {
            "description": "No such driver."
          }
        },
        "description": "Laps, sectors and turns. A lap record is held in one direction."
      }
    },
    "/drivers/{id}/progress": {
      "get": {
        "operationId": "driverProgress",
        "tags": [
          "Drivers"
        ],
        "summary": "A driver's best lap at one track, visit by visit",
        "security": [],
        "parameters": [
          {
            "$ref": "#/components/parameters/DriverPath"
          },
          {
            "name": "track_id",
            "in": "query",
            "schema": {
              "type": "integer"
            },
            "description": "The track.",
            "required": true
          }
        ],
        "responses": {
          "200": {
            "description": "A driver's best lap at one track, visit by visit",
            "content": {
              "application/json": {
                "example": {
                  "driver_id": 3,
                  "track": {
                    "id": 4652,
                    "display": "Charleston Peak - Full",
                    "name": "Spring Mountain",
                    "config": "Charleston Peak - Full Course",
                    "country": "US",
                    "direction": "cw",
                    "length_m": 5151.3
                  },
                  "progress": [
                    {
                      "date": "2026-04-23",
                      "session_id": 3,
                      "best_lap_s": 118.2,
                      "personal_best": true,
                      "viewer_url": "https://www.deltanerd.com/viewer/?session=3&laps=3:4"
                    }
                  ]
                }
              }
            }
          },
          "404": {
            "description": "No such driver, or no public laps by them at that track."
          }
        }
      }
    },
    "/healthz": {
      "get": {
        "operationId": "healthz",
        "tags": [
          "Service"
        ],
        "summary": "Service up",
        "security": [],
        "responses": {
          "200": {
            "description": "Up.",
            "content": {
              "application/json": {
                "example": {
                  "status": "ok"
                }
              }
            }
          }
        }
      }
    },
    "/public/sessions": {
      "get": {
        "operationId": "publicSessions",
        "tags": [
          "Sessions"
        ],
        "summary": "Public sessions, newest first",
        "security": [],
        "parameters": [
          {
            "name": "track_id",
            "in": "query",
            "schema": {
              "type": "integer"
            },
            "description": "Only this track."
          },
          {
            "name": "driver_id",
            "in": "query",
            "schema": {
              "type": "integer"
            },
            "description": "Only this driver."
          },
          {
            "name": "track",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "description": "Only sessions whose track name is exactly this (see `/public/options`)."
          },
          {
            "name": "vehicle",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "description": "Only this vehicle, exactly."
          },
          {
            "name": "driver",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "description": "Only this driver's name, exactly."
          },
          {
            "name": "from",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "description": "From this date, `YYYY-MM-DD`."
          },
          {
            "name": "to",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "description": "To this date, `YYYY-MM-DD`."
          },
          {
            "name": "direction",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "cw",
                "ccw"
              ]
            }
          },
          {
            "name": "video",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "1"
              ]
            },
            "description": "Only sessions with video."
          },
          {
            "name": "telemetry",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "1"
              ]
            },
            "description": "Only sessions with telemetry."
          },
          {
            "name": "ignore",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "description": "Leave out laps or sessions whose only moments are these kinds, comma separated: `spin,oversteer,alert`."
          },
          {
            "name": "order",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "asc",
                "desc"
              ]
            }
          },
          {
            "$ref": "#/components/parameters/Limit"
          },
          {
            "$ref": "#/components/parameters/Cursor"
          },
          {
            "name": "sort",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "id",
                "date",
                "track",
                "vehicle",
                "driver",
                "best_lap",
                "laps",
                "size",
                "length",
                "distance",
                "top_speed",
                "moments"
              ]
            }
          },
          {
            "name": "lapless",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "1"
              ]
            },
            "description": "Only sessions with no full lap."
          }
        ],
        "responses": {
          "200": {
            "description": "Public sessions, newest first",
            "content": {
              "application/json": {
                "example": {
                  "sessions": [
                    {
                      "id": 812,
                      "driver": "Cale Orosz",
                      "vehicle": "SR3 XX 1503",
                      "car": "2021 Radical SR3 1340cc XX",
                      "track": "SMR-CharPkFC",
                      "track_display": "Charleston Peak - Full",
                      "direction": "cw",
                      "visibility": "public",
                      "recorded_at": "2026-10-04",
                      "started_at": "2026-10-04T10:42:03",
                      "duration_s": 2385.0,
                      "distance_m": 51240.2,
                      "top_speed_mps": 53.7,
                      "full_laps": 19,
                      "best_lap_s": 131.728,
                      "alert_trips": 0,
                      "alerts": [],
                      "moments": {
                        "oversteer": 1,
                        "spin": 0
                      },
                      "has_video": true,
                      "has_telemetry": true,
                      "total_size": 1840211339,
                      "driver_id": 15,
                      "track_id": 4652,
                      "viewer_url": "https://www.deltanerd.com/viewer/?session=812"
                    }
                  ],
                  "total": 87,
                  "next_cursor": "50"
                }
              }
            }
          }
        },
        "description": "The rows the site's Search Sessions page shows."
      }
    },
    "/public/laps": {
      "get": {
        "operationId": "publicLaps",
        "tags": [
          "Sessions"
        ],
        "summary": "Public laps, fastest first",
        "security": [],
        "parameters": [
          {
            "name": "track_id",
            "in": "query",
            "schema": {
              "type": "integer"
            },
            "description": "Only this track."
          },
          {
            "name": "driver_id",
            "in": "query",
            "schema": {
              "type": "integer"
            },
            "description": "Only this driver."
          },
          {
            "name": "track",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "description": "Only sessions whose track name is exactly this (see `/public/options`)."
          },
          {
            "name": "vehicle",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "description": "Only this vehicle, exactly."
          },
          {
            "name": "driver",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "description": "Only this driver's name, exactly."
          },
          {
            "name": "from",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "description": "From this date, `YYYY-MM-DD`."
          },
          {
            "name": "to",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "description": "To this date, `YYYY-MM-DD`."
          },
          {
            "name": "direction",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "cw",
                "ccw"
              ]
            }
          },
          {
            "name": "video",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "1"
              ]
            },
            "description": "Only sessions with video."
          },
          {
            "name": "telemetry",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "1"
              ]
            },
            "description": "Only sessions with telemetry."
          },
          {
            "name": "ignore",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "description": "Leave out laps or sessions whose only moments are these kinds, comma separated: `spin,oversteer,alert`."
          },
          {
            "name": "order",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "asc",
                "desc"
              ]
            }
          },
          {
            "$ref": "#/components/parameters/Limit"
          },
          {
            "$ref": "#/components/parameters/Cursor"
          },
          {
            "name": "sort",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "id",
                "time",
                "date",
                "track",
                "vehicle",
                "driver",
                "moments"
              ]
            }
          },
          {
            "name": "fastest",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "0",
                "1"
              ]
            },
            "description": "One lap per driver, track and direction (default). `0` lists every lap."
          }
        ],
        "responses": {
          "200": {
            "description": "Public laps, fastest first",
            "content": {
              "application/json": {
                "example": {
                  "laps": [
                    {
                      "session_id": 812,
                      "lap_index": 7,
                      "lap_time_s": 131.728,
                      "driver": "Cale Orosz",
                      "vehicle": "SR3 XX 1503",
                      "car": "2021 Radical SR3 1340cc XX",
                      "track": "SMR-CharPkFC",
                      "track_display": "Charleston Peak - Full",
                      "direction": "cw",
                      "visibility": "public",
                      "recorded_at": "2026-10-04",
                      "started_at": "2026-10-04T10:42:03",
                      "has_video": true,
                      "has_telemetry": true,
                      "alert_trips": 0,
                      "alerts": [],
                      "moments": {
                        "oversteer": 0,
                        "spin": 0
                      },
                      "setup_visible": false,
                      "driver_id": 15,
                      "track_id": 4652,
                      "viewer_url": "https://www.deltanerd.com/viewer/?session=812&laps=812:7"
                    }
                  ],
                  "total": 412,
                  "next_cursor": "50"
                }
              }
            }
          }
        },
        "description": "The rows the site's Search Laps page shows. Out and in laps are never listed."
      }
    },
    "/public/options": {
      "get": {
        "operationId": "publicOptions",
        "tags": [
          "Sessions"
        ],
        "summary": "The values a filter can take",
        "security": [],
        "parameters": [
          {
            "name": "field",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "track",
                "vehicle",
                "driver"
              ]
            }
          },
          {
            "name": "q",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "description": "Part of the value."
          }
        ],
        "responses": {
          "200": {
            "description": "The values a filter can take",
            "content": {
              "application/json": {
                "example": {
                  "values": [
                    "SMR-CharPkSh",
                    [
                      "SMR-CharPkFC",
                      "Charleston Peak - Full"
                    ]
                  ]
                }
              }
            }
          }
        },
        "description": "A value is a string, or `[value, shown]` when a track has a display name."
      }
    },
    "/tracks/{id}/sessions": {
      "get": {
        "operationId": "trackSessions",
        "tags": [
          "Sessions"
        ],
        "summary": "Public sessions at a track",
        "security": [],
        "parameters": [
          {
            "$ref": "#/components/parameters/TrackId"
          },
          {
            "name": "track",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "description": "Only sessions whose track name is exactly this (see `/public/options`)."
          },
          {
            "name": "vehicle",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "description": "Only this vehicle, exactly."
          },
          {
            "name": "driver",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "description": "Only this driver's name, exactly."
          },
          {
            "name": "from",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "description": "From this date, `YYYY-MM-DD`."
          },
          {
            "name": "to",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "description": "To this date, `YYYY-MM-DD`."
          },
          {
            "name": "direction",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "cw",
                "ccw"
              ]
            }
          },
          {
            "name": "video",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "1"
              ]
            },
            "description": "Only sessions with video."
          },
          {
            "name": "telemetry",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "1"
              ]
            },
            "description": "Only sessions with telemetry."
          },
          {
            "name": "ignore",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "description": "Leave out laps or sessions whose only moments are these kinds, comma separated: `spin,oversteer,alert`."
          },
          {
            "name": "order",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "asc",
                "desc"
              ]
            }
          },
          {
            "$ref": "#/components/parameters/Limit"
          },
          {
            "$ref": "#/components/parameters/Cursor"
          },
          {
            "name": "sort",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "id",
                "date",
                "track",
                "vehicle",
                "driver",
                "best_lap",
                "laps",
                "size",
                "length",
                "distance",
                "top_speed",
                "moments"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Public sessions at a track",
            "content": {
              "application/json": {
                "example": {
                  "sessions": [
                    {
                      "id": 812,
                      "driver": "Cale Orosz",
                      "vehicle": "SR3 XX 1503",
                      "car": "2021 Radical SR3 1340cc XX",
                      "track": "SMR-CharPkFC",
                      "track_display": "Charleston Peak - Full",
                      "direction": "cw",
                      "visibility": "public",
                      "recorded_at": "2026-10-04",
                      "started_at": "2026-10-04T10:42:03",
                      "duration_s": 2385.0,
                      "distance_m": 51240.2,
                      "top_speed_mps": 53.7,
                      "full_laps": 19,
                      "best_lap_s": 131.728,
                      "alert_trips": 0,
                      "alerts": [],
                      "moments": {
                        "oversteer": 1,
                        "spin": 0
                      },
                      "has_video": true,
                      "has_telemetry": true,
                      "total_size": 1840211339,
                      "driver_id": 15,
                      "track_id": 4652,
                      "viewer_url": "https://www.deltanerd.com/viewer/?session=812"
                    }
                  ],
                  "total": 48,
                  "next_cursor": null
                }
              }
            }
          },
          "404": {
            "description": "No such track."
          }
        }
      }
    },
    "/tracks/{id}/laps": {
      "get": {
        "operationId": "trackLaps",
        "tags": [
          "Sessions"
        ],
        "summary": "Public laps at a track, fastest first",
        "security": [],
        "parameters": [
          {
            "$ref": "#/components/parameters/TrackId"
          },
          {
            "name": "track",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "description": "Only sessions whose track name is exactly this (see `/public/options`)."
          },
          {
            "name": "vehicle",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "description": "Only this vehicle, exactly."
          },
          {
            "name": "driver",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "description": "Only this driver's name, exactly."
          },
          {
            "name": "from",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "description": "From this date, `YYYY-MM-DD`."
          },
          {
            "name": "to",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "description": "To this date, `YYYY-MM-DD`."
          },
          {
            "name": "direction",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "cw",
                "ccw"
              ]
            }
          },
          {
            "name": "video",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "1"
              ]
            },
            "description": "Only sessions with video."
          },
          {
            "name": "telemetry",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "1"
              ]
            },
            "description": "Only sessions with telemetry."
          },
          {
            "name": "ignore",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "description": "Leave out laps or sessions whose only moments are these kinds, comma separated: `spin,oversteer,alert`."
          },
          {
            "name": "order",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "asc",
                "desc"
              ]
            }
          },
          {
            "$ref": "#/components/parameters/Limit"
          },
          {
            "$ref": "#/components/parameters/Cursor"
          },
          {
            "name": "sort",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "id",
                "time",
                "date",
                "track",
                "vehicle",
                "driver",
                "moments"
              ]
            }
          },
          {
            "name": "fastest",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "0",
                "1"
              ]
            },
            "description": "One lap per driver, track and direction (default). `0` lists every lap."
          }
        ],
        "responses": {
          "200": {
            "description": "Public laps at a track, fastest first",
            "content": {
              "application/json": {
                "example": {
                  "laps": [
                    {
                      "session_id": 812,
                      "lap_index": 7,
                      "lap_time_s": 131.728,
                      "driver": "Cale Orosz",
                      "vehicle": "SR3 XX 1503",
                      "car": "2021 Radical SR3 1340cc XX",
                      "track": "SMR-CharPkFC",
                      "track_display": "Charleston Peak - Full",
                      "direction": "cw",
                      "visibility": "public",
                      "recorded_at": "2026-10-04",
                      "started_at": "2026-10-04T10:42:03",
                      "has_video": true,
                      "has_telemetry": true,
                      "alert_trips": 0,
                      "alerts": [],
                      "moments": {
                        "oversteer": 0,
                        "spin": 0
                      },
                      "setup_visible": false,
                      "driver_id": 15,
                      "track_id": 4652,
                      "viewer_url": "https://www.deltanerd.com/viewer/?session=812&laps=812:7"
                    }
                  ],
                  "total": 4,
                  "next_cursor": null
                }
              }
            }
          },
          "404": {
            "description": "No such track."
          }
        }
      }
    },
    "/drivers/{id}/sessions": {
      "get": {
        "operationId": "driverSessions",
        "tags": [
          "Drivers"
        ],
        "summary": "A driver's public sessions",
        "security": [],
        "parameters": [
          {
            "$ref": "#/components/parameters/DriverPath"
          },
          {
            "name": "track",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "description": "Only sessions whose track name is exactly this (see `/public/options`)."
          },
          {
            "name": "vehicle",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "description": "Only this vehicle, exactly."
          },
          {
            "name": "driver",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "description": "Only this driver's name, exactly."
          },
          {
            "name": "from",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "description": "From this date, `YYYY-MM-DD`."
          },
          {
            "name": "to",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "description": "To this date, `YYYY-MM-DD`."
          },
          {
            "name": "direction",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "cw",
                "ccw"
              ]
            }
          },
          {
            "name": "video",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "1"
              ]
            },
            "description": "Only sessions with video."
          },
          {
            "name": "telemetry",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "1"
              ]
            },
            "description": "Only sessions with telemetry."
          },
          {
            "name": "ignore",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "description": "Leave out laps or sessions whose only moments are these kinds, comma separated: `spin,oversteer,alert`."
          },
          {
            "name": "order",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "asc",
                "desc"
              ]
            }
          },
          {
            "$ref": "#/components/parameters/Limit"
          },
          {
            "$ref": "#/components/parameters/Cursor"
          },
          {
            "name": "sort",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "id",
                "date",
                "track",
                "vehicle",
                "driver",
                "best_lap",
                "laps",
                "size",
                "length",
                "distance",
                "top_speed",
                "moments"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "A driver's public sessions",
            "content": {
              "application/json": {
                "example": {
                  "sessions": [
                    {
                      "id": 812,
                      "driver": "Cale Orosz",
                      "vehicle": "SR3 XX 1503",
                      "car": "2021 Radical SR3 1340cc XX",
                      "track": "SMR-CharPkFC",
                      "track_display": "Charleston Peak - Full",
                      "direction": "cw",
                      "visibility": "public",
                      "recorded_at": "2026-10-04",
                      "started_at": "2026-10-04T10:42:03",
                      "duration_s": 2385.0,
                      "distance_m": 51240.2,
                      "top_speed_mps": 53.7,
                      "full_laps": 19,
                      "best_lap_s": 131.728,
                      "alert_trips": 0,
                      "alerts": [],
                      "moments": {
                        "oversteer": 1,
                        "spin": 0
                      },
                      "has_video": true,
                      "has_telemetry": true,
                      "total_size": 1840211339,
                      "driver_id": 15,
                      "track_id": 4652,
                      "viewer_url": "https://www.deltanerd.com/viewer/?session=812"
                    }
                  ],
                  "total": 38,
                  "next_cursor": null
                }
              }
            }
          },
          "404": {
            "description": "No such driver."
          }
        }
      }
    },
    "/drivers/{id}/laps": {
      "get": {
        "operationId": "driverLaps",
        "tags": [
          "Drivers"
        ],
        "summary": "A driver's public laps",
        "security": [],
        "parameters": [
          {
            "$ref": "#/components/parameters/DriverPath"
          },
          {
            "name": "track",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "description": "Only sessions whose track name is exactly this (see `/public/options`)."
          },
          {
            "name": "vehicle",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "description": "Only this vehicle, exactly."
          },
          {
            "name": "driver",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "description": "Only this driver's name, exactly."
          },
          {
            "name": "from",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "description": "From this date, `YYYY-MM-DD`."
          },
          {
            "name": "to",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "description": "To this date, `YYYY-MM-DD`."
          },
          {
            "name": "direction",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "cw",
                "ccw"
              ]
            }
          },
          {
            "name": "video",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "1"
              ]
            },
            "description": "Only sessions with video."
          },
          {
            "name": "telemetry",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "1"
              ]
            },
            "description": "Only sessions with telemetry."
          },
          {
            "name": "ignore",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "description": "Leave out laps or sessions whose only moments are these kinds, comma separated: `spin,oversteer,alert`."
          },
          {
            "name": "order",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "asc",
                "desc"
              ]
            }
          },
          {
            "$ref": "#/components/parameters/Limit"
          },
          {
            "$ref": "#/components/parameters/Cursor"
          },
          {
            "name": "sort",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "id",
                "time",
                "date",
                "track",
                "vehicle",
                "driver",
                "moments"
              ]
            }
          },
          {
            "name": "fastest",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "0",
                "1"
              ]
            },
            "description": "One lap per driver, track and direction (default). `0` lists every lap."
          }
        ],
        "responses": {
          "200": {
            "description": "A driver's public laps",
            "content": {
              "application/json": {
                "example": {
                  "laps": [
                    {
                      "session_id": 812,
                      "lap_index": 7,
                      "lap_time_s": 131.728,
                      "driver": "Cale Orosz",
                      "vehicle": "SR3 XX 1503",
                      "car": "2021 Radical SR3 1340cc XX",
                      "track": "SMR-CharPkFC",
                      "track_display": "Charleston Peak - Full",
                      "direction": "cw",
                      "visibility": "public",
                      "recorded_at": "2026-10-04",
                      "started_at": "2026-10-04T10:42:03",
                      "has_video": true,
                      "has_telemetry": true,
                      "alert_trips": 0,
                      "alerts": [],
                      "moments": {
                        "oversteer": 0,
                        "spin": 0
                      },
                      "setup_visible": false,
                      "driver_id": 15,
                      "track_id": 4652,
                      "viewer_url": "https://www.deltanerd.com/viewer/?session=812&laps=812:7"
                    }
                  ],
                  "total": 7,
                  "next_cursor": null
                }
              }
            }
          },
          "404": {
            "description": "No such driver."
          }
        }
      }
    },
    "/sessions/{id}": {
      "get": {
        "operationId": "getSession",
        "tags": [
          "Sessions"
        ],
        "summary": "One session: its laps, channels and moments",
        "description": "Public sessions need no key. A private session is a 404 without its owner's key.",
        "security": [
          {},
          {
            "apiKey": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/SessionId"
          }
        ],
        "responses": {
          "200": {
            "description": "The session.",
            "content": {
              "application/json": {
                "example": {
                  "id": 3,
                  "owner_name": "Cale Orosz",
                  "driver": "Cale Orosz",
                  "vehicle": "SR3 XX 1503",
                  "car": "2021 Radical SR3 1340cc XX",
                  "track": "CharlestonSS",
                  "track_display": "CharlestonSS",
                  "recorded_at": "2026-04-23",
                  "started_at": "2026-04-23T15:30:17",
                  "duration_s": 1660.311,
                  "lap_count": 15,
                  "full_laps": 13,
                  "best_lap_s": 94.5,
                  "distance_m": 42618.4,
                  "top_speed_mps": 63.9,
                  "max_rpm": 10240.0,
                  "direction": "ccw",
                  "laps": [
                    {
                      "lap_index": 0,
                      "start_s": 0.0,
                      "duration_s": 143.5,
                      "is_outlap": true,
                      "is_inlap": false,
                      "source": "logger"
                    },
                    {
                      "lap_index": 1,
                      "start_s": 143.5,
                      "duration_s": 94.5,
                      "is_outlap": false,
                      "is_inlap": false,
                      "source": "logger"
                    }
                  ],
                  "moments": [
                    {
                      "kind": "oversteer",
                      "source": "logger",
                      "lap_index": 8,
                      "t_session_s": 1042.6,
                      "t_lap_s": 61.3,
                      "distance_m": 2130.4
                    }
                  ]
                }
              }
            }
          },
          "404": {
            "description": "No such session, or not one you may see.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "patch": {
        "operationId": "updateSession",
        "tags": [
          "Sessions"
        ],
        "summary": "Rename a session, or set who can see it",
        "security": [
          {
            "apiKey": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/SessionId"
          }
        ],
        "responses": {
          "200": {
            "description": "Rename a session, or set who can see it",
            "content": {
              "application/json": {
                "example": {
                  "id": 22,
                  "driver": null,
                  "vehicle": "SR3 XX 1503",
                  "car": "2021 Radical SR3 1340cc XX",
                  "track": "Thunderhill West",
                  "visibility": "private"
                }
              }
            }
          },
          "401": {
            "description": "No key, an unknown or revoked one, or a read-only key on a change."
          },
          "404": {
            "description": "No such session, or not yours."
          }
        },
        "x-key-access": "write",
        "description": "Only the fields you send change. `visibility` is `public`, `private`, or `null` to follow your account.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "example": {
                "track": "Thunderhill West",
                "visibility": "private"
              }
            }
          }
        }
      }
    },
    "/sessions/{id}/laps": {
      "get": {
        "operationId": "sessionLaps",
        "tags": [
          "Sessions"
        ],
        "summary": "A session's laps with their splits",
        "security": [
          {},
          {
            "apiKey": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/SessionId"
          }
        ],
        "responses": {
          "200": {
            "description": "A session's laps with their splits",
            "content": {
              "application/json": {
                "example": {
                  "session_id": 812,
                  "track_id": 4652,
                  "best_lap_s": 131.728,
                  "track_record_s": 131.728,
                  "laps": [
                    {
                      "lap_index": 7,
                      "lap_s": 131.728,
                      "start_s": 903.112,
                      "out_lap": false,
                      "in_lap": false,
                      "counted": true,
                      "source": "logger",
                      "gap_to_best_s": 0.0,
                      "gap_to_record_s": 0.0,
                      "sectors": [
                        {
                          "idx": 0,
                          "name": "S1",
                          "label": "Sector 1",
                          "time_s": 33.013,
                          "entry_mps": 41.2,
                          "min_mps": 24.8,
                          "exit_mps": 38.1
                        }
                      ],
                      "turns": [],
                      "viewer_url": "https://www.deltanerd.com/viewer/?session=812&laps=812:7"
                    }
                  ]
                }
              }
            }
          },
          "404": {
            "description": "No such session, or not one you may see."
          }
        },
        "description": "`counted` is whether the lap search lists it; out and in laps are not. Splits are meters per second for speeds and seconds for times, measured the way the viewer measures them. `track_record_s` is the public record in the direction this session was driven."
      }
    },
    "/sessions/{id}/laps/{n}": {
      "get": {
        "operationId": "sessionLap",
        "tags": [
          "Sessions"
        ],
        "summary": "One lap, with its moments",
        "security": [
          {},
          {
            "apiKey": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/SessionId"
          },
          {
            "name": "n",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            },
            "description": "The lap's `lap_index`."
          }
        ],
        "responses": {
          "200": {
            "description": "One lap, with its moments",
            "content": {
              "application/json": {
                "example": {
                  "session_id": 812,
                  "track_id": 4652,
                  "lap_index": 7,
                  "lap_s": 131.728,
                  "start_s": 903.112,
                  "out_lap": false,
                  "in_lap": false,
                  "counted": true,
                  "source": "logger",
                  "gap_to_best_s": 0.0,
                  "gap_to_record_s": 0.0,
                  "sectors": [
                    {
                      "idx": 0,
                      "name": "S1",
                      "label": "Sector 1",
                      "time_s": 33.013,
                      "entry_mps": 41.2,
                      "min_mps": 24.8,
                      "exit_mps": 38.1
                    }
                  ],
                  "turns": [],
                  "viewer_url": "https://www.deltanerd.com/viewer/?session=812&laps=812:7",
                  "moments": [
                    {
                      "kind": "oversteer",
                      "lap_index": 7,
                      "t_lap_s": 61.3,
                      "distance_m": 2130.4
                    }
                  ]
                }
              }
            }
          },
          "404": {
            "description": "No such session or lap, or not one you may see."
          }
        }
      }
    },
    "/sessions/{id}/optimal": {
      "get": {
        "operationId": "sessionOptimal",
        "tags": [
          "Sessions"
        ],
        "summary": "The session's optimal lap",
        "security": [
          {},
          {
            "apiKey": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/SessionId"
          }
        ],
        "responses": {
          "200": {
            "description": "The session's optimal lap",
            "content": {
              "application/json": {
                "example": {
                  "session_id": 812,
                  "best_lap_s": 131.728,
                  "sectors": {
                    "items": [
                      {
                        "idx": 0,
                        "name": "S1",
                        "label": "Sector 1",
                        "time_s": 33.013,
                        "lap_index": 13,
                        "viewer_url": "https://www.deltanerd.com/viewer/?session=812&laps=812:13"
                      }
                    ],
                    "optimal_s": 130.991
                  },
                  "turns": {
                    "items": [],
                    "optimal_s": null
                  }
                }
              }
            }
          },
          "404": {
            "description": "No such session, or not one you may see."
          }
        },
        "description": "Its best time in every sector and turn, each from whichever counted lap set it."
      }
    },
    "/sessions/{id}/moments": {
      "get": {
        "operationId": "sessionMoments",
        "tags": [
          "Sessions"
        ],
        "summary": "Where the car stepped out",
        "security": [
          {},
          {
            "apiKey": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/SessionId"
          }
        ],
        "responses": {
          "200": {
            "description": "Where the car stepped out",
            "content": {
              "application/json": {
                "example": {
                  "session_id": 812,
                  "moments": [
                    {
                      "kind": "spin",
                      "source": "logger",
                      "lap_index": 8,
                      "t_session_s": 1042.6,
                      "t_lap_s": 61.3,
                      "distance_m": 2130.4
                    }
                  ]
                }
              }
            }
          },
          "404": {
            "description": "No such session, or not one you may see."
          }
        },
        "description": "Oversteer and spins, with the lap and the time."
      }
    },
    "/sessions/{id}/channels": {
      "get": {
        "operationId": "sessionChannels",
        "tags": [
          "Sessions"
        ],
        "summary": "Every channel the session recorded",
        "security": [
          {},
          {
            "apiKey": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/SessionId"
          }
        ],
        "responses": {
          "200": {
            "description": "Every channel the session recorded",
            "content": {
              "application/json": {
                "example": {
                  "session_id": 812,
                  "channels": [
                    {
                      "name": "GPS Speed",
                      "source": "logger",
                      "units": "m/s",
                      "roles": [
                        "speed"
                      ],
                      "sample_count": 23850,
                      "t0_s": 0.0,
                      "dt_s": 0.1,
                      "rate_hz": 10.0,
                      "min": 0.0,
                      "max": 53.7
                    }
                  ]
                }
              }
            }
          },
          "404": {
            "description": "No such session, or not one you may see."
          }
        },
        "description": "`roles` names what the viewer draws the channel as."
      }
    },
    "/sessions/{id}/track": {
      "get": {
        "operationId": "getSessionTrack",
        "tags": [
          "Sessions"
        ],
        "summary": "The track the session ran at, with its corners and sectors",
        "security": [
          {},
          {
            "apiKey": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/SessionId"
          }
        ],
        "responses": {
          "200": {
            "description": "The matched track, or `track: null`.",
            "content": {
              "application/json": {
                "example": {
                  "track": {
                    "id": 4654,
                    "name": "Spring Mountain",
                    "config": "Charleston Peak - Short Course",
                    "display": "SMR-CharPkSh",
                    "length_m": 3405.8,
                    "direction": "cw",
                    "sync_points": [
                      {
                        "order": 0,
                        "name": "Back straight",
                        "lap_pos": 0.5124
                      }
                    ],
                    "turns": [
                      {
                        "order": 0,
                        "name": "T1",
                        "start": 0.011912,
                        "end": 0.097747
                      }
                    ],
                    "sectors": [
                      {
                        "order": 0,
                        "name": "S1",
                        "start": 0.0,
                        "end": 0.337263
                      }
                    ]
                  }
                }
              }
            }
          },
          "404": {
            "description": "No such session, or not one you may see."
          }
        }
      }
    },
    "/sessions/{id}/weather": {
      "get": {
        "operationId": "getSessionWeather",
        "tags": [
          "Sessions"
        ],
        "summary": "The weather while the session ran",
        "description": "The nearest weather station's reports for the whole day, every 5 minutes. Any field may be null.",
        "security": [
          {},
          {
            "apiKey": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/SessionId"
          }
        ],
        "responses": {
          "200": {
            "description": "When it ran, and the station's day.",
            "content": {
              "application/json": {
                "example": {
                  "when": {
                    "start": "2026-10-04T17:42:10Z",
                    "end": "2026-10-04T18:21:55Z",
                    "utc_offset_min": -420,
                    "timezone": "America/Los_Angeles"
                  },
                  "weather": {
                    "station": "KNVPAHRU274",
                    "station_km": 0.05,
                    "elevation_m": 812.4,
                    "day": "2026-10-04",
                    "reports": [
                      {
                        "t": "2026-10-04T17:45:00Z",
                        "temp_c": 22.4,
                        "humidity_pct": 28.0,
                        "wind_kph": 12.6,
                        "wind_dir_deg": 225,
                        "pressure_hpa": 1014.2
                      }
                    ]
                  }
                }
              }
            }
          },
          "404": {
            "description": "No such session, or not one you may see."
          }
        }
      }
    },
    "/sessions/{id}/day": {
      "get": {
        "operationId": "getSessionDay",
        "tags": [
          "Sessions"
        ],
        "summary": "Every public session at that track that day",
        "security": [
          {},
          {
            "apiKey": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/SessionId"
          }
        ],
        "responses": {
          "200": {
            "description": "The day's sessions, by start time.",
            "content": {
              "application/json": {
                "example": {
                  "sessions": [
                    {
                      "id": 882,
                      "owner_name": "Cale",
                      "driver": "Cale",
                      "vehicle": "Miata",
                      "start": "2026-10-04T17:42:10Z",
                      "started_at": "2026-10-04T10:42:03",
                      "duration_s": 2385.0,
                      "lap_count": 21,
                      "full_laps": 19,
                      "best_lap_s": 91.43,
                      "top_speed_mps": 51.2,
                      "temp_c": 22.6
                    }
                  ]
                }
              }
            }
          },
          "404": {
            "description": "No such session, or not one you may see."
          }
        }
      }
    },
    "/sessions/{id}/channels/{name}": {
      "get": {
        "operationId": "getSessionChannel",
        "tags": [
          "Sessions"
        ],
        "summary": "One channel's samples",
        "description": "Raw little-endian float32 by default, one value per sample (float64, `sample_count * 8` bytes, for GPS position and ITOW stored since 2026-11-07). `format=json` or `csv` gives each value with its time. Percent-encode the name: `GPS%20Speed`.",
        "security": [
          {},
          {
            "apiKey": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/SessionId"
          },
          {
            "name": "name",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The channel's name, as the session document lists it."
          },
          {
            "name": "source",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "logger",
                "camera",
                "carpi"
              ]
            },
            "description": "Which recorder's copy, when more than one has this channel."
          },
          {
            "name": "axis",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "times"
              ]
            },
            "description": "The time of each sample instead, for a channel without a fixed rate."
          },
          {
            "name": "format",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "raw",
                "json",
                "csv"
              ]
            },
            "description": "`raw` (default): little-endian float32 (float64 for GPS position and ITOW). `json`: times and values. `csv`: `time_s,value`."
          }
        ],
        "responses": {
          "200": {
            "description": "The samples.",
            "content": {
              "application/octet-stream": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              },
              "application/json": {
                "example": {
                  "name": "GPS Speed",
                  "source": "logger",
                  "units": "m/s",
                  "sample_count": 3,
                  "t0_s": 0.0,
                  "dt_s": 0.1,
                  "times": [
                    0.0,
                    0.1,
                    0.2
                  ],
                  "values": [
                    12.4,
                    12.6,
                    null
                  ]
                }
              },
              "text/csv": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "404": {
            "description": "No such channel or session, or not one you may see."
          }
        }
      }
    },
    "/auth/me": {
      "get": {
        "operationId": "me",
        "tags": [
          "Your account"
        ],
        "summary": "Your account",
        "security": [
          {
            "apiKey": []
          }
        ],
        "parameters": [],
        "responses": {
          "200": {
            "description": "Your account",
            "content": {
              "application/json": {
                "example": {
                  "user": {
                    "id": 15,
                    "name": "Cale Orosz",
                    "backup_retention_days": 30,
                    "server_side_processing": true,
                    "server_side_storage": true,
                    "visibility": "public",
                    "track_fix_policy": "auto"
                  }
                }
              }
            }
          },
          "401": {
            "description": "No key, an unknown or revoked one, or a read-only key on a change."
          }
        },
        "description": "Your email is never sent to a key."
      }
    },
    "/sessions": {
      "get": {
        "operationId": "mySessions",
        "tags": [
          "Your account"
        ],
        "summary": "Your sessions, private ones included",
        "security": [
          {
            "apiKey": []
          }
        ],
        "parameters": [],
        "responses": {
          "200": {
            "description": "Your sessions, private ones included",
            "content": {
              "application/json": {
                "example": {
                  "sessions": [
                    {
                      "id": 3,
                      "driver": "Cale Orosz",
                      "vehicle": "SR3 XX 1503",
                      "car": "2021 Radical SR3 1340cc XX",
                      "track": "SMR-CharPkSh",
                      "track_display": "Charleston Peak - Short",
                      "visibility": "private",
                      "recorded_at": "2026-04-23",
                      "started_at": "2026-04-23T15:30:17",
                      "duration_s": 1660.3,
                      "distance_m": 42618.4,
                      "top_speed_mps": 63.9,
                      "lap_count": 15,
                      "full_laps": 13,
                      "best_lap_s": 89.123,
                      "has_video": true,
                      "has_telemetry": true,
                      "direction": "cw"
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "description": "No key, an unknown or revoked one, or a read-only key on a change."
          }
        }
      }
    },
    "/shared": {
      "get": {
        "operationId": "sharedWithMe",
        "tags": [
          "Your account"
        ],
        "summary": "Sessions other drivers shared with you",
        "security": [
          {
            "apiKey": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/Limit"
          },
          {
            "$ref": "#/components/parameters/Cursor"
          }
        ],
        "responses": {
          "200": {
            "description": "Sessions other drivers shared with you",
            "content": {
              "application/json": {
                "example": {
                  "sessions": [],
                  "total": 0,
                  "next_cursor": null
                }
              }
            }
          },
          "401": {
            "description": "No key, an unknown or revoked one, or a read-only key on a change."
          }
        },
        "description": "Same rows as `/public/sessions`."
      }
    },
    "/me/bests": {
      "get": {
        "operationId": "myBests",
        "tags": [
          "Your account"
        ],
        "summary": "Your best lap at every track",
        "security": [
          {
            "apiKey": []
          }
        ],
        "parameters": [
          {
            "name": "track_id",
            "in": "query",
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Your best lap at every track",
            "content": {
              "application/json": {
                "example": {
                  "driver_id": 15,
                  "bests": [
                    {
                      "track": {
                        "id": 4652,
                        "display": "Charleston Peak - Full",
                        "name": "Spring Mountain",
                        "config": "Charleston Peak - Full Course",
                        "country": "US",
                        "direction": "cw",
                        "length_m": 5151.3
                      },
                      "rank": 1,
                      "gap_to_record_s": 0.0,
                      "session_id": 812,
                      "lap_index": 7,
                      "lap_s": 131.728,
                      "driver_id": 15,
                      "driver": "Cale Orosz",
                      "vehicle": "SR3 XX 1503",
                      "car": "2021 Radical SR3 1340cc XX",
                      "direction": "cw",
                      "date": "2026-10-04",
                      "has_video": true,
                      "viewer_url": "https://www.deltanerd.com/viewer/?session=812&laps=812:7",
                      "sectors": [
                        {
                          "name": "S1",
                          "label": "Sector 1",
                          "time_s": 33.013
                        }
                      ]
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "description": "No key, an unknown or revoked one, or a read-only key on a change."
          }
        },
        "description": "Private sessions included. `rank` is where the lap would place among everyone's public laps. One row per track and direction, ranked within the direction."
      }
    },
    "/me/bests/sectors": {
      "get": {
        "operationId": "myBestSectors",
        "tags": [
          "Your account"
        ],
        "summary": "Your best sector times at every track",
        "security": [
          {
            "apiKey": []
          }
        ],
        "parameters": [
          {
            "name": "track_id",
            "in": "query",
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Your best sector times at every track",
            "content": {
              "application/json": {
                "example": {
                  "driver_id": 15,
                  "rows": [
                    {
                      "track": {
                        "id": 4652,
                        "display": "Charleston Peak - Full",
                        "name": "Spring Mountain",
                        "config": "Charleston Peak - Full Course",
                        "country": "US",
                        "direction": "cw",
                        "length_m": 5151.3
                      },
                      "driver_id": 15,
                      "driver": "Cale Orosz",
                      "direction": "cw",
                      "sectors": [
                        {
                          "idx": 0,
                          "name": "S1",
                          "label": "Sector 1",
                          "time_s": 33.013,
                          "gap_s": 0.0,
                          "session_id": 937,
                          "lap_index": 13,
                          "viewer_url": "https://www.deltanerd.com/viewer/?session=937&laps=937:13"
                        }
                      ],
                      "optimal_s": 131.728,
                      "track_optimal_s": 130.778
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "description": "No key, an unknown or revoked one, or a read-only key on a change."
          }
        },
        "description": "Private sessions included. Gaps are to the best anyone has driven publicly."
      }
    },
    "/keys": {
      "get": {
        "operationId": "myKeys",
        "tags": [
          "Your account"
        ],
        "summary": "Your API keys",
        "security": [
          {
            "apiKey": []
          }
        ],
        "parameters": [],
        "responses": {
          "200": {
            "description": "Your API keys",
            "content": {
              "application/json": {
                "example": {
                  "keys": [
                    {
                      "id": 88,
                      "name": "My lap timer",
                      "can_write": false,
                      "created_at": "2026-10-21 19:40:02",
                      "last_used": "2026-10-21 19:52:13",
                      "expires_at": "2027-10-21 19:40:02"
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "description": "No key, an unknown or revoked one, or a read-only key on a change."
          }
        },
        "description": "Never the keys themselves. Make and revoke them on your Account page."
      }
    },
    "/jobs": {
      "get": {
        "operationId": "myJobs",
        "tags": [
          "Your account"
        ],
        "summary": "Processing progress on your uploads",
        "security": [
          {
            "apiKey": []
          }
        ],
        "parameters": [
          {
            "name": "since",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "description": "The `cursor` from the last answer."
          }
        ],
        "responses": {
          "200": {
            "description": "Processing progress on your uploads",
            "content": {
              "application/json": {
                "example": {
                  "jobs": [
                    {
                      "id": 41,
                      "type": "extract",
                      "state": "running",
                      "stage": "encoding",
                      "progress_pct": 47,
                      "eta_s": 180,
                      "session_id": 3,
                      "created_at": "2026-08-13T09:14:02"
                    }
                  ],
                  "cursor": "1786614709-0",
                  "active": 1,
                  "poll_after_s": 2,
                  "has_more": false
                }
              }
            }
          },
          "401": {
            "description": "No key, an unknown or revoked one, or a read-only key on a change."
          }
        }
      }
    },
    "/jobs/{id}": {
      "get": {
        "operationId": "myJob",
        "tags": [
          "Your account"
        ],
        "summary": "One job",
        "security": [
          {
            "apiKey": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "One job",
            "content": {
              "application/json": {
                "example": {
                  "id": 41,
                  "type": "extract",
                  "state": "done",
                  "progress_pct": 100
                }
              }
            }
          },
          "401": {
            "description": "No key, an unknown or revoked one, or a read-only key on a change."
          },
          "404": {
            "description": "No such job, or not yours."
          }
        }
      }
    },
    "/cars": {
      "get": {
        "operationId": "myCars",
        "tags": [
          "Your account"
        ],
        "summary": "Your cars and their setups",
        "security": [
          {
            "apiKey": []
          }
        ],
        "parameters": [],
        "responses": {
          "200": {
            "description": "Your cars and their setups",
            "content": {
              "application/json": {
                "example": {
                  "cars": [
                    {
                      "vehicle": "SR3 XX 1503",
                      "year": 2021,
                      "make": "Radical",
                      "model": "SR3 1340cc XX",
                      "car": "2021 Radical SR3 1340cc XX",
                      "sessions": 41,
                      "share_public": true,
                      "setup": {
                        "template": "radical",
                        "values": {
                          "front_wing": "3"
                        },
                        "updated_at": "2026-10-04T09:12:40"
                      }
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "description": "No key, an unknown or revoked one, or a read-only key on a change."
          }
        }
      },
      "post": {
        "operationId": "addCar",
        "tags": [
          "Your account"
        ],
        "summary": "Add a car",
        "security": [
          {
            "apiKey": []
          }
        ],
        "parameters": [],
        "responses": {
          "200": {
            "description": "The new car",
            "content": {
              "application/json": {
                "example": {
                  "vehicle": "SR3 XX 1503",
                  "year": 2021,
                  "make": "Radical",
                  "model": "SR3 1340cc XX",
                  "car": "2021 Radical SR3 1340cc XX",
                  "sessions": 0,
                  "share_public": true,
                  "setup": null
                }
              }
            }
          },
          "400": {
            "description": "No Unique Car Name, a bad year, or a car by that name already."
          },
          "401": {
            "description": "No key, an unknown or revoked one, or a read-only key on a change."
          }
        },
        "x-key-access": "write",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "example": {
                "vehicle": "SR3 XX 1503",
                "year": 2021,
                "make": "Radical",
                "model": "SR3 1340cc XX"
              }
            }
          }
        }
      }
    },
    "/cars/setup": {
      "get": {
        "operationId": "myCarSetup",
        "tags": [
          "Your account"
        ],
        "summary": "A car's current setup",
        "security": [
          {
            "apiKey": []
          }
        ],
        "parameters": [
          {
            "name": "vehicle",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The car, as sessions name it."
          }
        ],
        "responses": {
          "200": {
            "description": "A car's current setup",
            "content": {
              "application/json": {
                "example": {
                  "setup": {
                    "template": "radical",
                    "values": {
                      "front_wing": "3"
                    },
                    "updated_at": "2026-10-04T09:12:40"
                  }
                }
              }
            }
          },
          "401": {
            "description": "No key, an unknown or revoked one, or a read-only key on a change."
          }
        }
      },
      "put": {
        "operationId": "saveCarSetup",
        "tags": [
          "Your account"
        ],
        "summary": "Save a car's current setup",
        "security": [
          {
            "apiKey": []
          }
        ],
        "parameters": [
          {
            "name": "vehicle",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The car, as sessions name it."
          }
        ],
        "responses": {
          "200": {
            "description": "Save a car's current setup",
            "content": {
              "application/json": {
                "example": {
                  "setup": {
                    "template": "radical",
                    "values": {
                      "front_wing": "3"
                    },
                    "updated_at": "2026-10-04T09:12:40"
                  }
                }
              }
            }
          },
          "401": {
            "description": "No key, an unknown or revoked one, or a read-only key on a change."
          }
        },
        "x-key-access": "write",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "example": {
                "template": "radical",
                "values": {
                  "front_wing": "3"
                }
              }
            }
          }
        }
      }
    },
    "/cars/share": {
      "patch": {
        "operationId": "shareCarSetup",
        "tags": [
          "Your account"
        ],
        "summary": "Whether a car's setup is public",
        "security": [
          {
            "apiKey": []
          }
        ],
        "parameters": [
          {
            "name": "vehicle",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The car, as sessions name it."
          }
        ],
        "responses": {
          "200": {
            "description": "Whether a car's setup is public",
            "content": {
              "application/json": {
                "example": {
                  "vehicle": "SR3 XX 1503",
                  "share_public": true
                }
              }
            }
          },
          "401": {
            "description": "No key, an unknown or revoked one, or a read-only key on a change."
          }
        },
        "x-key-access": "write",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "example": {
                "share_public": true
              }
            }
          }
        }
      }
    },
    "/cars/info": {
      "patch": {
        "operationId": "saveCarInfo",
        "tags": [
          "Your account"
        ],
        "summary": "Set a car's year, make and model",
        "security": [
          {
            "apiKey": []
          }
        ],
        "parameters": [
          {
            "name": "vehicle",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The car's Unique Car Name, as sessions name it."
          }
        ],
        "responses": {
          "200": {
            "description": "The car",
            "content": {
              "application/json": {
                "example": {
                  "vehicle": "SR3 XX 1503",
                  "year": 2021,
                  "make": "Radical",
                  "model": "SR3 1340cc XX",
                  "car": "2021 Radical SR3 1340cc XX",
                  "sessions": 0,
                  "share_public": true,
                  "setup": null
                }
              }
            }
          },
          "400": {
            "description": "A bad year, or text too long."
          },
          "401": {
            "description": "No key, an unknown or revoked one, or a read-only key on a change."
          }
        },
        "x-key-access": "write",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "example": {
                "year": 2021,
                "make": "Radical",
                "model": "SR3 1340cc XX"
              }
            }
          }
        }
      }
    },
    "/clips": {
      "get": {
        "operationId": "myClips",
        "tags": [
          "Your account"
        ],
        "summary": "Your clips",
        "security": [
          {
            "apiKey": []
          }
        ],
        "parameters": [],
        "responses": {
          "200": {
            "description": "Your clips",
            "content": {
              "application/json": {
                "example": {
                  "clips": [
                    {
                      "id": 93,
                      "title": "Turn 6 comparison",
                      "session_id": 12,
                      "session": {
                        "id": 12,
                        "driver": "Cale",
                        "track": "Buttonwillow",
                        "recorded_at": "2026-07-04",
                        "car": "1999 Mazda Miata"
                      },
                      "duration_s": 14.57,
                      "segments": 2,
                      "video": {
                        "size": 4718592,
                        "duration_s": 14.6,
                        "width": 1280,
                        "height": 720
                      },
                      "download_url": "/media/video/14/clip-93.mp4",
                      "mp4_current": true,
                      "thumb_url": "/api/v1/clips/93/thumb?v=3f9a0c21be47"
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "description": "No key, an unknown or revoked one, or a read-only key on a change."
          }
        },
        "description": "Read only: clips are made and edited in DeltaNerd itself."
      }
    },
    "/clips/{id}": {
      "get": {
        "operationId": "myClip",
        "tags": [
          "Your account"
        ],
        "summary": "One clip",
        "security": [
          {
            "apiKey": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "One clip",
            "content": {
              "application/json": {
                "example": {
                  "id": 93,
                  "title": "Turn 6 comparison"
                }
              }
            }
          },
          "401": {
            "description": "No key, an unknown or revoked one, or a read-only key on a change."
          },
          "404": {
            "description": "No such clip, or not yours."
          }
        }
      }
    },
    "/clips/{id}/download": {
      "get": {
        "operationId": "downloadClip",
        "tags": [
          "Your account"
        ],
        "summary": "A clip's video",
        "security": [
          {
            "apiKey": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The MP4.",
            "content": {
              "video/mp4": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              }
            }
          }
        }
      }
    },
    "/clips/{id}/thumb": {
      "get": {
        "operationId": "clipThumb",
        "tags": [
          "Your account"
        ],
        "summary": "A clip's still",
        "security": [
          {
            "apiKey": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "A 480x270 JPEG: off the MP4, else off the first segment's session video. Fetch it by the clip's thumb_url, whose ?v= changes when the picture does.",
            "content": {
              "image/jpeg": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              }
            }
          },
          "401": {
            "description": "No key, an unknown or revoked one, or a read-only key on a change."
          },
          "404": {
            "description": "No such clip, not yours, or no frame can be made."
          }
        }
      }
    },
    "/auth/me/shared-with": {
      "get": {
        "operationId": "accountSharedWith",
        "tags": [
          "Your account"
        ],
        "summary": "Who your whole account is shared with",
        "security": [
          {
            "apiKey": []
          }
        ],
        "parameters": [],
        "responses": {
          "200": {
            "description": "Who your whole account is shared with",
            "content": {
              "application/json": {
                "example": {
                  "shared_with": [
                    {
                      "email": "coach@example.com",
                      "created_at": "2026-09-17T09:12:40"
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "description": "No key, an unknown or revoked one, or a read-only key on a change."
          }
        }
      },
      "post": {
        "operationId": "shareAccount",
        "tags": [
          "Your account"
        ],
        "summary": "Share your whole account with a driver",
        "security": [
          {
            "apiKey": []
          }
        ],
        "parameters": [],
        "responses": {
          "200": {
            "description": "Share your whole account with a driver",
            "content": {
              "application/json": {
                "example": {
                  "shared_with": [
                    {
                      "email": "coach@example.com",
                      "created_at": "2026-09-17T09:12:40"
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "description": "No key, an unknown or revoked one, or a read-only key on a change."
          }
        },
        "x-key-access": "write",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "example": {
                "email": "coach@example.com"
              }
            }
          }
        }
      },
      "delete": {
        "operationId": "unshareAccount",
        "tags": [
          "Your account"
        ],
        "summary": "Stop sharing your account with a driver",
        "security": [
          {
            "apiKey": []
          }
        ],
        "parameters": [],
        "responses": {
          "200": {
            "description": "Stop sharing your account with a driver",
            "content": {
              "application/json": {
                "example": {
                  "shared_with": []
                }
              }
            }
          },
          "401": {
            "description": "No key, an unknown or revoked one, or a read-only key on a change."
          }
        },
        "x-key-access": "write",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "example": {
                "email": "coach@example.com"
              }
            }
          }
        }
      }
    },
    "/sessions/{id}/setup": {
      "get": {
        "operationId": "getSessionSetup",
        "tags": [
          "Sessions"
        ],
        "summary": "The car setup a session ran",
        "security": [
          {},
          {
            "apiKey": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/SessionId"
          }
        ],
        "description": "Only when its owner shares their setups, or it is yours.",
        "responses": {
          "200": {
            "description": "The setup, or `setup: null`.",
            "content": {
              "application/json": {
                "example": {
                  "setup": {
                    "template": "radical",
                    "values": {
                      "front_wing": "3"
                    },
                    "updated_at": "2026-10-04T09:12:40"
                  }
                }
              }
            }
          },
          "404": {
            "description": "No such session, or not one you may see."
          }
        }
      },
      "put": {
        "operationId": "saveSessionSetup",
        "tags": [
          "Sessions"
        ],
        "summary": "Save the setup a session ran",
        "security": [
          {
            "apiKey": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/SessionId"
          }
        ],
        "responses": {
          "200": {
            "description": "Save the setup a session ran",
            "content": {
              "application/json": {
                "example": {
                  "setup": {
                    "template": "radical",
                    "values": {
                      "front_wing": "3"
                    },
                    "updated_at": "2026-10-04T09:12:40"
                  }
                }
              }
            }
          },
          "401": {
            "description": "No key, an unknown or revoked one, or a read-only key on a change."
          },
          "404": {
            "description": "No such session, or not yours."
          }
        },
        "x-key-access": "write",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "example": {
                "template": "radical",
                "values": {
                  "front_wing": "3"
                }
              }
            }
          }
        }
      }
    },
    "/sessions/{id}/share": {
      "get": {
        "operationId": "getShare",
        "tags": [
          "Sessions"
        ],
        "summary": "A session's share link and who it is shared with",
        "security": [
          {
            "apiKey": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/SessionId"
          }
        ],
        "responses": {
          "200": {
            "description": "A session's share link and who it is shared with",
            "content": {
              "application/json": {
                "example": {
                  "share": {
                    "token": "k7qm3xd2rphs4nvb9tzjwe",
                    "url": "https://www.deltanerd.com/s/k7qm3xd2rphs4nvb9tzjwe",
                    "created_at": "2026-09-07T14:02:11"
                  },
                  "shared_with": [
                    {
                      "email": "coach@example.com",
                      "created_at": "2026-09-17T09:12:40"
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "description": "No key, an unknown or revoked one, or a read-only key on a change."
          },
          "404": {
            "description": "No such session, or not yours."
          }
        }
      },
      "post": {
        "operationId": "createShare",
        "tags": [
          "Sessions"
        ],
        "summary": "Make a share link",
        "security": [
          {
            "apiKey": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/SessionId"
          }
        ],
        "responses": {
          "200": {
            "description": "Make a share link",
            "content": {
              "application/json": {
                "example": {
                  "share": {
                    "token": "k7qm3xd2rphs4nvb9tzjwe",
                    "url": "https://www.deltanerd.com/s/k7qm3xd2rphs4nvb9tzjwe",
                    "created_at": "2026-09-07T14:02:11"
                  },
                  "shared_with": [
                    {
                      "email": "coach@example.com",
                      "created_at": "2026-09-17T09:12:40"
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "description": "No key, an unknown or revoked one, or a read-only key on a change."
          },
          "404": {
            "description": "No such session, or not yours."
          }
        },
        "x-key-access": "write",
        "description": "Anyone with the link can watch this one session."
      },
      "delete": {
        "operationId": "removeShare",
        "tags": [
          "Sessions"
        ],
        "summary": "Turn the share link off",
        "security": [
          {
            "apiKey": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/SessionId"
          }
        ],
        "responses": {
          "200": {
            "description": "Turn the share link off",
            "content": {
              "application/json": {
                "example": {
                  "share": null,
                  "shared_with": []
                }
              }
            }
          },
          "401": {
            "description": "No key, an unknown or revoked one, or a read-only key on a change."
          },
          "404": {
            "description": "No such session, or not yours."
          }
        },
        "x-key-access": "write"
      }
    },
    "/sessions/{id}/share/with": {
      "post": {
        "operationId": "shareSessionWith",
        "tags": [
          "Sessions"
        ],
        "summary": "Share a session with a driver by email",
        "security": [
          {
            "apiKey": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/SessionId"
          }
        ],
        "responses": {
          "200": {
            "description": "Share a session with a driver by email",
            "content": {
              "application/json": {
                "example": {
                  "share": {
                    "token": "k7qm3xd2rphs4nvb9tzjwe",
                    "url": "https://www.deltanerd.com/s/k7qm3xd2rphs4nvb9tzjwe",
                    "created_at": "2026-09-07T14:02:11"
                  },
                  "shared_with": [
                    {
                      "email": "coach@example.com",
                      "created_at": "2026-09-17T09:12:40"
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "description": "No key, an unknown or revoked one, or a read-only key on a change."
          },
          "404": {
            "description": "No such session, or not yours."
          }
        },
        "x-key-access": "write",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "example": {
                "email": "coach@example.com"
              }
            }
          }
        }
      },
      "delete": {
        "operationId": "unshareSessionWith",
        "tags": [
          "Sessions"
        ],
        "summary": "Stop sharing a session with a driver",
        "security": [
          {
            "apiKey": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/SessionId"
          }
        ],
        "responses": {
          "200": {
            "description": "Stop sharing a session with a driver",
            "content": {
              "application/json": {
                "example": {
                  "share": {
                    "token": "k7qm3xd2rphs4nvb9tzjwe",
                    "url": "https://www.deltanerd.com/s/k7qm3xd2rphs4nvb9tzjwe",
                    "created_at": "2026-09-07T14:02:11"
                  },
                  "shared_with": [
                    {
                      "email": "coach@example.com",
                      "created_at": "2026-09-17T09:12:40"
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "description": "No key, an unknown or revoked one, or a read-only key on a change."
          },
          "404": {
            "description": "No such session, or not yours."
          }
        },
        "x-key-access": "write",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "example": {
                "email": "coach@example.com"
              }
            }
          }
        }
      }
    },
    "/sessions/setup": {
      "patch": {
        "operationId": "patchSetups",
        "tags": [
          "Sessions"
        ],
        "summary": "Set fields of several sessions' setups",
        "security": [
          {
            "apiKey": []
          }
        ],
        "parameters": [],
        "responses": {
          "200": {
            "description": "Set fields of several sessions' setups",
            "content": {
              "application/json": {
                "example": {
                  "updated": 3
                }
              }
            }
          },
          "401": {
            "description": "No key, an unknown or revoked one, or a read-only key on a change."
          }
        },
        "x-key-access": "write",
        "description": "Only the fields you send change, on every session listed. Every id must be yours.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "example": {
                "ids": [
                  21,
                  22,
                  23
                ],
                "values": {
                  "front_wing": "4"
                }
              }
            }
          }
        }
      }
    },
    "/sessions/{id}/laps/{n}/trace.gpx": {
      "get": {
        "operationId": "lapGpx",
        "tags": [
          "Exports"
        ],
        "summary": "A lap's GPS trace as GPX",
        "description": "For Strava-like tools and GPS apps.",
        "security": [
          {},
          {
            "apiKey": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/SessionId"
          },
          {
            "name": "n",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            },
            "description": "The lap's `lap_index`."
          }
        ],
        "responses": {
          "200": {
            "description": "A lap's GPS trace as GPX",
            "content": {
              "application/gpx+xml": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "404": {
            "description": "No such session or lap, not one you may see, or no trace to export."
          }
        }
      }
    },
    "/sessions/{id}/laps/{n}/trace.kml": {
      "get": {
        "operationId": "lapKml",
        "tags": [
          "Exports"
        ],
        "summary": "A lap's GPS trace as KML",
        "description": "For Google Earth.",
        "security": [
          {},
          {
            "apiKey": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/SessionId"
          },
          {
            "name": "n",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            },
            "description": "The lap's `lap_index`."
          }
        ],
        "responses": {
          "200": {
            "description": "A lap's GPS trace as KML",
            "content": {
              "application/vnd.google-earth.kml+xml": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "404": {
            "description": "No such session or lap, not one you may see, or no trace to export."
          }
        }
      }
    },
    "/sessions/{id}/laps/{n}/channels.csv": {
      "get": {
        "operationId": "lapCsv",
        "tags": [
          "Exports"
        ],
        "summary": "A lap's channels as CSV",
        "description": "One row per speed sample: `time_s` from the start of the lap, `distance_m` along it, then each channel at that moment. Opens in a spreadsheet, MoTeC i2 or RaceRender.",
        "security": [
          {},
          {
            "apiKey": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/SessionId"
          },
          {
            "name": "n",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            },
            "description": "The lap's `lap_index`."
          },
          {
            "name": "ch",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "description": "Channel names, comma separated, as `/sessions/{id}/channels` lists them. Default: speed, rpm, throttle, brake, gear, steering and g."
          }
        ],
        "responses": {
          "200": {
            "description": "A lap's channels as CSV",
            "content": {
              "text/csv": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "404": {
            "description": "No such session or lap, not one you may see, or no trace to export."
          }
        }
      }
    },
    "/sessions/{id}/channels.csv": {
      "get": {
        "operationId": "sessionCsv",
        "tags": [
          "Exports"
        ],
        "summary": "A session's channels as CSV",
        "description": "The same, for the whole session, `time_s` on the session clock.",
        "security": [
          {},
          {
            "apiKey": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/SessionId"
          },
          {
            "name": "ch",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "description": "Channel names, comma separated, as `/sessions/{id}/channels` lists them. Default: speed, rpm, throttle, brake, gear, steering and g."
          }
        ],
        "responses": {
          "200": {
            "description": "A session's channels as CSV",
            "content": {
              "text/csv": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "404": {
            "description": "No such session or lap, not one you may see, or no trace to export."
          }
        }
      }
    },
    "/laps/compare": {
      "get": {
        "operationId": "compareLaps",
        "tags": [
          "Exports"
        ],
        "summary": "One lap against another",
        "description": "The delta the viewer draws. `a` is the reference. Both laps are put on the reference's length, so `distance_m` is meters along it; `delta_s` is how far behind the reference `b` is there, positive when behind. The last point is the finish line, where the delta is the difference in lap times.",
        "security": [
          {},
          {
            "apiKey": []
          }
        ],
        "parameters": [
          {
            "name": "a",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The reference lap, `session:lap`, as in `937:13`."
          },
          {
            "name": "b",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The lap to compare, `session:lap`."
          },
          {
            "name": "step_m",
            "in": "query",
            "schema": {
              "type": "number"
            },
            "description": "Meters between points, 1 to 100. Default 5."
          }
        ],
        "responses": {
          "200": {
            "description": "The comparison.",
            "content": {
              "application/json": {
                "example": {
                  "reference": {
                    "session_id": 937,
                    "lap_index": 13,
                    "lap_s": 131.728,
                    "length_m": 5162.4,
                    "driver": "Cale Orosz",
                    "vehicle": "SR3 XX 1503",
                    "viewer_url": "https://www.deltanerd.com/viewer/?session=937&laps=937:13"
                  },
                  "lap": {
                    "session_id": 940,
                    "lap_index": 9,
                    "lap_s": 131.779,
                    "length_m": 5148.9,
                    "driver": "Kevin Haskins",
                    "vehicle": null,
                    "viewer_url": "https://www.deltanerd.com/viewer/?session=940&laps=940:9"
                  },
                  "step_m": 5,
                  "distance_m": [
                    0,
                    5,
                    10
                  ],
                  "delta_s": [
                    0,
                    0.004,
                    0.011
                  ],
                  "speed_ref_mps": [
                    41.2,
                    41.5,
                    41.9
                  ],
                  "speed_lap_mps": [
                    40.8,
                    41.0,
                    41.4
                  ],
                  "sectors": [
                    {
                      "idx": 0,
                      "label": "Sector 1",
                      "ref_s": 33.013,
                      "lap_s": 33.341,
                      "delta_s": 0.328
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "description": "`a` or `b` is not `session:lap`."
          },
          "404": {
            "description": "No such session or lap, not one you may see, or no trace to export."
          }
        }
      }
    },
    "/webhooks": {
      "get": {
        "operationId": "listWebhooks",
        "tags": [
          "Webhooks"
        ],
        "summary": "Your webhooks",
        "security": [
          {
            "apiKey": []
          }
        ],
        "parameters": [],
        "responses": {
          "200": {
            "description": "Your webhooks",
            "content": {
              "application/json": {
                "example": {
                  "webhooks": [
                    {
                      "id": 4,
                      "url": "https://example.com/deltanerd",
                      "events": [
                        "session.processed",
                        "lap.personal_best",
                        "alert.tripped",
                        "clip.ready"
                      ],
                      "enabled": true,
                      "failure_count": 0,
                      "created_at": "2026-10-21 20:01:44"
                    }
                  ]
                }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "createWebhook",
        "tags": [
          "Webhooks"
        ],
        "summary": "Add a webhook",
        "security": [
          {
            "apiKey": []
          }
        ],
        "parameters": [],
        "responses": {
          "200": {
            "description": "Add a webhook",
            "content": {
              "application/json": {
                "example": {
                  "webhook": {
                    "id": 4,
                    "url": "https://example.com/deltanerd",
                    "events": [
                      "session.processed",
                      "lap.personal_best",
                      "alert.tripped",
                      "clip.ready"
                    ],
                    "enabled": true,
                    "failure_count": 0,
                    "created_at": "2026-10-21 20:01:44"
                  },
                  "secret": "9f2c…64 hex characters"
                }
              }
            }
          }
        },
        "x-key-access": "write",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "example": {
                "url": "https://example.com/deltanerd",
                "events": [
                  "session.processed",
                  "lap.personal_best"
                ]
              }
            }
          }
        },
        "description": "The URL must be https and on the public internet. `secret` is in this answer and no other; keep it to check signatures."
      }
    },
    "/webhooks/{id}": {
      "patch": {
        "operationId": "updateWebhook",
        "tags": [
          "Webhooks"
        ],
        "summary": "Change a webhook, or turn it back on",
        "security": [
          {
            "apiKey": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Change a webhook, or turn it back on",
            "content": {
              "application/json": {
                "example": {
                  "webhook": {
                    "id": 4,
                    "url": "https://example.com/deltanerd",
                    "events": [
                      "session.processed",
                      "lap.personal_best",
                      "alert.tripped",
                      "clip.ready"
                    ],
                    "enabled": true,
                    "failure_count": 0,
                    "created_at": "2026-10-21 20:01:44"
                  }
                }
              }
            }
          },
          "404": {
            "description": "No such webhook, or not yours."
          }
        },
        "x-key-access": "write",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "example": {
                "events": [
                  "lap.personal_best"
                ],
                "enabled": true
              }
            }
          }
        },
        "description": "`enabled: true` turns a webhook back on after failures turned it off."
      },
      "delete": {
        "operationId": "deleteWebhook",
        "tags": [
          "Webhooks"
        ],
        "summary": "Remove a webhook",
        "security": [
          {
            "apiKey": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Remove a webhook",
            "content": {
              "application/json": {
                "example": {
                  "deleted": true
                }
              }
            }
          },
          "404": {
            "description": "No such webhook, or not yours."
          }
        },
        "x-key-access": "write"
      }
    },
    "/webhooks/{id}/test": {
      "post": {
        "operationId": "testWebhook",
        "tags": [
          "Webhooks"
        ],
        "summary": "Send a ping now",
        "security": [
          {
            "apiKey": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Send a ping now",
            "content": {
              "application/json": {
                "example": {
                  "delivered": true,
                  "status": 200,
                  "error": null
                }
              }
            }
          },
          "404": {
            "description": "No such webhook, or not yours."
          }
        },
        "x-key-access": "write"
      }
    },
    "/webhooks/{id}/deliveries": {
      "get": {
        "operationId": "webhookDeliveries",
        "tags": [
          "Webhooks"
        ],
        "summary": "The last 50 deliveries",
        "security": [
          {
            "apiKey": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The last 50 deliveries",
            "content": {
              "application/json": {
                "example": {
                  "deliveries": [
                    {
                      "id": 311,
                      "event": "lap.personal_best",
                      "attempts": 1,
                      "delivered_at": "2026-10-21 20:03:10",
                      "next_try_at": null,
                      "last_status": 200,
                      "last_error": null,
                      "created_at": "2026-10-21 20:03:09"
                    }
                  ]
                }
              }
            }
          },
          "404": {
            "description": "No such webhook, or not yours."
          }
        }
      }
    }
  },
  "webhooks": {
    "session.processed": {
      "post": {
        "operationId": "event_session_processed",
        "tags": [
          "Webhooks"
        ],
        "summary": "A session finished processing",
        "description": "POSTed as JSON to your URL with `X-DeltaNerd-Event`, `X-DeltaNerd-Delivery` and `X-DeltaNerd-Signature: sha256=<HMAC-SHA256 of the raw body, keyed with your webhook's secret>`. Answer with any 2xx. Anything else is retried after 1, 5, 30, 120 and 360 minutes; ten failures in a row turn the webhook off.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "integer"
                  },
                  "event": {
                    "type": "string"
                  },
                  "created_at": {
                    "type": "string"
                  },
                  "data": {
                    "type": "object"
                  }
                }
              },
              "example": {
                "id": 311,
                "event": "session.processed",
                "created_at": "2026-10-21T20:03:09Z",
                "data": {
                  "session_id": 961,
                  "track": "Charleston Peak - Full",
                  "track_id": 4652,
                  "vehicle": "SR3 XX 1503",
                  "started_at": "2026-10-21T10:42:03",
                  "best_lap_s": 131.728,
                  "full_laps": 19,
                  "viewer_url": "https://www.deltanerd.com/viewer/?session=961"
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Received."
          }
        }
      }
    },
    "lap.personal_best": {
      "post": {
        "operationId": "event_lap_personal_best",
        "tags": [
          "Webhooks"
        ],
        "summary": "A new personal best at a track",
        "description": "POSTed as JSON to your URL with `X-DeltaNerd-Event`, `X-DeltaNerd-Delivery` and `X-DeltaNerd-Signature: sha256=<HMAC-SHA256 of the raw body, keyed with your webhook's secret>`. Answer with any 2xx. Anything else is retried after 1, 5, 30, 120 and 360 minutes; ten failures in a row turn the webhook off. A personal best is against the member's laps in the same direction only.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "integer"
                  },
                  "event": {
                    "type": "string"
                  },
                  "created_at": {
                    "type": "string"
                  },
                  "data": {
                    "type": "object"
                  }
                }
              },
              "example": {
                "id": 311,
                "event": "lap.personal_best",
                "created_at": "2026-10-21T20:03:09Z",
                "data": {
                  "session_id": 961,
                  "lap_index": 13,
                  "lap_s": 131.728,
                  "previous_s": 132.414,
                  "track_id": 4652,
                  "track": "Charleston Peak - Full",
                  "vehicle": "SR3 XX 1503",
                  "viewer_url": "https://www.deltanerd.com/viewer/?session=961&laps=961:13"
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Received."
          }
        }
      }
    },
    "alert.tripped": {
      "post": {
        "operationId": "event_alert_tripped",
        "tags": [
          "Webhooks"
        ],
        "summary": "An alert held during a session",
        "description": "POSTed as JSON to your URL with `X-DeltaNerd-Event`, `X-DeltaNerd-Delivery` and `X-DeltaNerd-Signature: sha256=<HMAC-SHA256 of the raw body, keyed with your webhook's secret>`. Answer with any 2xx. Anything else is retried after 1, 5, 30, 120 and 360 minutes; ten failures in a row turn the webhook off.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "integer"
                  },
                  "event": {
                    "type": "string"
                  },
                  "created_at": {
                    "type": "string"
                  },
                  "data": {
                    "type": "object"
                  }
                }
              },
              "example": {
                "id": 311,
                "event": "alert.tripped",
                "created_at": "2026-10-21T20:03:09Z",
                "data": {
                  "session_id": 961,
                  "alert": "Oil pressure lost",
                  "trips": 2,
                  "seconds": 3.4,
                  "first_s": 412.0,
                  "last_s": 1290.5,
                  "viewer_url": "https://www.deltanerd.com/viewer/?session=961"
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Received."
          }
        }
      }
    },
    "clip.ready": {
      "post": {
        "operationId": "event_clip_ready",
        "tags": [
          "Webhooks"
        ],
        "summary": "A clip finished rendering",
        "description": "POSTed as JSON to your URL with `X-DeltaNerd-Event`, `X-DeltaNerd-Delivery` and `X-DeltaNerd-Signature: sha256=<HMAC-SHA256 of the raw body, keyed with your webhook's secret>`. Answer with any 2xx. Anything else is retried after 1, 5, 30, 120 and 360 minutes; ten failures in a row turn the webhook off.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "integer"
                  },
                  "event": {
                    "type": "string"
                  },
                  "created_at": {
                    "type": "string"
                  },
                  "data": {
                    "type": "object"
                  }
                }
              },
              "example": {
                "id": 311,
                "event": "clip.ready",
                "created_at": "2026-10-21T20:03:09Z",
                "data": {
                  "clip_id": 93,
                  "session_id": 12,
                  "title": "Turn 6 comparison",
                  "duration_s": 14.57,
                  "download_url": "https://www.deltanerd.com/api/v1/clips/93/download",
                  "viewer_url": "https://www.deltanerd.com/viewer/?clip=93"
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Received."
          }
        }
      }
    },
    "ping": {
      "post": {
        "operationId": "event_ping",
        "tags": [
          "Webhooks"
        ],
        "summary": "A test from Send a ping",
        "description": "POSTed as JSON to your URL with `X-DeltaNerd-Event`, `X-DeltaNerd-Delivery` and `X-DeltaNerd-Signature: sha256=<HMAC-SHA256 of the raw body, keyed with your webhook's secret>`. Answer with any 2xx. Anything else is retried after 1, 5, 30, 120 and 360 minutes; ten failures in a row turn the webhook off.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "integer"
                  },
                  "event": {
                    "type": "string"
                  },
                  "created_at": {
                    "type": "string"
                  },
                  "data": {
                    "type": "object"
                  }
                }
              },
              "example": {
                "id": 311,
                "event": "ping",
                "created_at": "2026-10-21T20:03:09Z",
                "data": {
                  "webhook_id": 4
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Received."
          }
        }
      }
    }
  }
}
