Outlap Docs
Open Outlap

Quickstart

Mint an API key, find your event ID, post your first lap and read it back from the leaderboard in about five minutes.

By the end of this page you’ll have sent a lap into an Outlap event from code and seen it come back.

You’ll need an Outlap club or track account that you administer, and an event in it. Any event works; a draft is fine for testing.

  1. Create an API key.

    In the app, open your club, go to Settings → API keys, and create a key named for what will use it. Copy it immediately; it’s shown once. Full steps: Create an API key.

    export OUTLAP_API_KEY="olap_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
  2. Find your event ID.

    Open the event in the app. The ID is the last part of its URL: /clubs/your-club/events/<eventId>. Race Control → Timing → Connect timing also shows it.

    export EVENT_ID="6c0e0000-0000-4000-8000-000000000000"
  3. Post a lap.

    Lap times are in milliseconds, so 92345 is 1:32.345.

    curl -X POST https://fzfstcyowovukscxgdrh.supabase.co/functions/v1/timing-api/v1/events/$EVENT_ID/laps \
      -H "Authorization: Bearer $OUTLAP_API_KEY" \
      -H "Content-Type: application/json" \
      -d '{ "laps": [ { "lap_number": 1, "lap_time_ms": 92345, "s1_ms": 28110, "s2_ms": 31900, "s3_ms": 32335, "transponder_id": "TR-4421" } ] }'
    const res = await fetch(`https://fzfstcyowovukscxgdrh.supabase.co/functions/v1/timing-api/v1/events/${process.env.EVENT_ID}/laps`, {
      method: "POST",
      headers: {
        Authorization: `Bearer ${process.env.OUTLAP_API_KEY}`,
        "Content-Type": "application/json",
      },
      body: JSON.stringify({
        laps: [{ lap_number: 1, lap_time_ms: 92345, transponder_id: "TR-4421" }],
      }),
    });
    console.log(res.status, await res.json());
    import os, requests
    
    r = requests.post(
        f"https://fzfstcyowovukscxgdrh.supabase.co/functions/v1/timing-api/v1/events/{os.environ['EVENT_ID']}/laps",
        headers={"Authorization": f"Bearer {os.environ['OUTLAP_API_KEY']}"},
        json={"laps": [{"lap_number": 1, "lap_time_ms": 92345, "transponder_id": "TR-4421"}]},
    )
    print(r.status_code, r.json())

    You should get 200 and:

    { "inserted": 1 }
  4. Read it back.

    If the event is public, anyone can read its laps and standings:

    curl https://fzfstcyowovukscxgdrh.supabase.co/functions/v1/timing-api/v1/events/$EVENT_ID/laps
    curl https://fzfstcyowovukscxgdrh.supabase.co/functions/v1/timing-api/v1/events/$EVENT_ID/leaderboard

    For a private event, open Race Control → Log laps to see the lap. A lap with an unknown transponder is stored without a driver until you assign it.

If it didn’t work

You seeIt means
401 invalid api keyThe key is wrong or revoked. Check for stray whitespace.
403 event does not belong to api key's clubThe event is in a different club than the key.
403 insufficient scopeThe key lacks timing:write.
404 not found on a GETThe event isn’t public. Check Race Control instead.

More in Errors and Troubleshooting.

What next

esc
↑↓ to navigate ↵ to open esc to close