सार्वजनिक API · v0बीटादस्तावेज़ संस्करण 0.1.0

Scoreboards API संदर्भ

अपनी लीडरबोर्ड पढ़ें और किसी भी ऐसी चीज़ से उनमें परिणाम भेजें जो HTTP अनुरोध कर सकती है। नौ एंडपॉइंट, एक कुंजी, कोई SDK नहीं।

API बीटा में है

पहुँच हर सर्वर के लिए अलग से मंज़ूर होती है। अपना डैशबोर्ड खोलें, जिस सर्वर के आप एडमिन हैं उसके API सेक्शन में जाएँ और वहीं अनुरोध करें; मंज़ूरी मिलने पर आप कुंजियाँ बना सकते हैं। जब तक v0 बीटा में है, एंडपॉइंट और रिस्पॉन्स फ़ील्ड बदल सकते हैं, और हर बदलाव से पहले हर मंज़ूर इंटीग्रेशन को बताया जाता है।

पहले यह पढ़ें: लेखन अतुल्यकालिक है

लेखन कोई रैंक नहीं लौटाता। वह 202 Accepted और एक handle लौटाता है, क्योंकि API सिर्फ़ एक आदेश कतार में डालता है — पूरी रेटिंग गणना Discord बॉट के पास है। सत्यापन अवधि वाले बोर्ड पर लीडरबोर्ड में तब तक कुछ नहीं बदलता जब तक कोई मॉडरेटर Discord में Approve पर क्लिक न करे, और वह एक दिन बाद हो सकता है, या कभी नहीं।

201 Created ठीक एक ही स्थिति में मिलता है: बोर्ड की सत्यापन अवधि शून्य घंटे हो और वर्कर API की लगभग तीन सेकंड की प्रतीक्षा के भीतर पूरा कर ले। समय समाप्त होने पर उत्तर फिर भी 202 रहता है, इसलिए दोनों संभालें।

GET /submissions/{handle} को पोल करना ही यह जानने का एकमात्र सही तरीका है कि क्या हुआ। जो एकीकरण सफल POST को बदली हुई रैंकिंग मान लेता है, वह लाइव होने से पहले ही टूटा हुआ है।

कोड लिखने से पहले

आठ बातें जो तय करती हैं कि एकीकरण चलेगा या नहीं। इनमें से कोई भी एंडपॉइंट सूची देखकर अनुमान नहीं लगाई जा सकती।

लेखन एक अनुरोध है, परिणाम नहीं

POST एक आदेश कतार में डालता है और sub_88213 जैसे handle तथा applied: false के साथ उत्तर देता है। handle को पोल करें; कभी यह न मानें कि रैंकिंग बदल गई।

रेटिंग जमा करते समय स्थिर हो जाती है

हर प्रतिभागी की रेटिंग तब पढ़ी जाती है जब मैच बनाया जाता है, तब नहीं जब वह स्वीकृत होता है। लगातार भेजे गए दस मैच सभी टूर्नामेंट से पहले वाली रेटिंग पर गणना करते हैं। यह पूर्वानुमेय है, बॉट जैसा ही है — और पहली बार चौंकाता है।

ELO विजेता लेता है, League स्कोरलाइन

ELO बोर्ड में कोई स्कोर फ़ील्ड नहीं होता: winner को team1, team2 या draw के रूप में भेजें। League बोर्ड team1_score और team2_score लेता है और विजेता स्वयं निकालता है। हर एक दूसरे के फ़ील्ड को 422 के साथ अस्वीकार करता है जो ग़लत कुंजी का नाम बताता है।

Time बोर्ड मिलीसेकंड लेते हैं

पूर्णांक के रूप में: 1:30 यानी 90000। सेकंड भेजना इस पूरे API की सबसे संभावित एकीकरण ग़लती है, इसीलिए हर Time बोर्ड अपने लेखन अनुबंध में score_unit: milliseconds बताता है।

हर पक्ष में ठीक team_size प्रतिभागी

3v3 बोर्ड हर पक्ष में तीन प्रतिभागी चाहता है; इससे अलग कुछ भी 422 team_size_mismatch है। अपवाद है fixed_teams: true वाला बोर्ड, जहाँ हर पक्ष ठीक एक team_id होता है — मैच दोनों टीम इकाइयों के बीच होता है, उनके सदस्यों के बीच नहीं।

खिलाड़ी आईडी नामस्थान के साथ आती हैं

प्रतिक्रियाओं में discord:198374652000000000, custom:Ava, role:998877 या team:5 आते हैं, और पथ तथा फ़िल्टर वही रूप स्वीकार करते हैं। इनपुट में सादा Discord snowflake भी चलता है, इसलिए Discord से कॉपी की गई आईडी सीधे चिपकाई जा सकती है।

हर POST को Idempotency-Key चाहिए

यह आवश्यक है, वैकल्पिक नहीं: समय समाप्ति और विफलता में अंतर नहीं किया जा सकता, और आँख मूँदकर दोहराया गया लेखन किसी के सत्यापन चैनल में दूसरा मैच बन जाता है। वही कुंजी और वही बॉडी संग्रहीत प्रतिक्रिया दोहरा देती है; वही कुंजी अलग बॉडी के साथ 409 है। रिकॉर्ड कम से कम 24 घंटे रखे जाते हैं — यह न्यूनतम अवधि है, समाप्ति नहीं — इसलिए किसी कुंजी को दोबारा इस्तेमाल करने के बजाय हमेशा के लिए ख़र्च हुई मानें।

कर्सर, ऑफ़सेट नहीं

लीडरबोर्ड दो अनुरोधों के बीच बदलता रहता है, इसलिए ऑफ़सेट पेजिनेशन दोहरी गिनती करता है। कर्सर संयुक्त होते हैं — एक मान और एक टाई-ब्रेकर — ताकि बराबर स्कोर वाले समूह के बीच पड़ी पृष्ठ सीमा उसी समूह के भीतर से आगे बढ़े, न कि सबको छोड़ दे। डिफ़ॉल्ट 50 पंक्तियाँ प्रति पृष्ठ, अधिकतम 200। next_cursor को अपारदर्शी मानें।

हर बोर्ड प्रकार क्या स्वीकार करता है

लेखन का रूप बोर्ड तय करता है, हर प्रस्तुति पर नहीं चुना जाता। इस तालिका को कोड में जड़ने के बजाय GET /boards/{board} से पूछें: उसका write ब्लॉक उसी एक बोर्ड के लिए उत्तर देता है, उसके k-factor या प्रति जीत अंकों तक।

बोर्ड प्रकारएंडपॉइंटबॉडी में क्या जाता है422 के साथ अस्वीकृतस्वीकृति क्या लागू करती है
ClassicPOST /boards/{board}/scoresplayer, scoreteam1, team2, winner, team1_score, team2_scoreभेजा गया स्कोर चालू कुल में जोड़ता है।
HighscorePOST /boards/{board}/scoresplayer, scoreteam1, team2, winner, team1_score, team2_scoreपुराने और नए स्कोर में से बेहतर रखता है।
TimePOST /boards/{board}/scoresplayer, scoreteam1, team2, winner, team1_score, team2_scoreबोर्ड के क्रम के अनुसार बेहतर समय रखता है।
ELOPOST /boards/{board}/matchesteam1, team2, winnerteam1_score, team2_score, scoreटीमों के लिए शून्य-योग रेटिंग परिवर्तन, साथ में जीत, ड्रॉ या हार।
LeaguePOST /boards/{board}/matchesteam1, team2, team1_score, team2_scorewinner, scoreजीत, ड्रॉ या हार के अंक, साथ में रिकॉर्ड।
Ratingv0 में कोई लेखन एंडपॉइंट नहीं — रेटिंग प्रस्तुति के लिए छवि अपलोड चाहिए।

प्रमाणीकरण

डैशबोर्ड से ली गई कुंजी Authorization: Bearer sk_live_... के रूप में भेजें। हर कुंजी ठीक एक स्वामी से बँधी होती है — एक Discord सर्वर, या व्यक्तिगत बोर्ड के लिए एक उपयोगकर्ता खाता — इसलिए कोई कुंजी कभी किसी और के बोर्ड तक नहीं पहुँच सकती। दूसरे का बोर्ड 404 होता है, कभी 403 नहीं: उसके अस्तित्व की पुष्टि करने से कोई भी दूसरों के बोर्ड गिन सकता।

परीक्षण कुंजियाँ केवल पढ़ सकती हैं। sk_test_ कुंजी हर पठन पूरा करती है और हर लेखन स्कोप अस्वीकार करती है। कुंजियाँ बनाते समय एक ही बार दिखती हैं और केवल हैश के रूप में संग्रहीत होती हैं, इसलिए खो जाए तो नई बनाएँ और पुरानी रद्द करें — प्रति स्वामी कई सक्रिय कुंजियाँ चलती हैं, जिससे बदलाव में कोई डाउनटाइम नहीं लगता।

गुप्त कुंजी कभी क्लाइंट-साइड कोड में न रखें। /v1 रूट कोई CORS हेडर नहीं भेजते, इसलिए ब्राउज़र उन्हें कॉल नहीं कर सकता। यह जानबूझकर है, चूक नहीं।

curl 'https://api.scoreboards.dev/v1/boards' \
  -H 'Authorization: Bearer sk_live_...'

स्कोप

डिफ़ॉल्ट रूप से न्यूनतम अधिकार: डैशबोर्ड का केवल पढ़ना स्तर तीनों पढ़ने वाले स्कोप देता है और उससे अधिक कुछ नहीं; matches:write और scores:write केवल पढ़ना और लिखना के साथ जुड़ते हैं। स्कोप ठीक-ठीक जाँचे जाते हैं और एक-दूसरे को नहीं देते — matches:write से matches:read नहीं मिलता। दोनों लेखन स्कोप अलग हैं क्योंकि उनका असर अलग है: ख़राब स्कोर एकीकरण एक बोर्ड फुला देता है, जबकि ख़राब मैच एकीकरण सबकी रेटिंग हिला देता है।

स्कोपक्या अनुमति देता है
boards:readबोर्ड सूचीबद्ध करना, किसी बोर्ड का लेखन अनुबंध पढ़ना और लेखन handle हल करना।
entries:readरैंकिंग और किसी एक प्रतिभागी की स्थिति पढ़ना।
matches:readELO और League बोर्ड पर मैच इतिहास पढ़ना।
matches:writeELO या League मैच कतार में डालना। परीक्षण कुंजी को कभी नहीं मिलता।
scores:writeClassic, Highscore या Time बोर्ड पर स्कोर कतार में डालना। परीक्षण कुंजी को कभी नहीं मिलता।

एंडपॉइंट

नौ ऑपरेशन। नीचे दिया हर पथ आधार URL के सापेक्ष है, हर अनुरोध को bearer कुंजी चाहिए, और 2xx के अलावा हर प्रतिक्रिया एक समस्या दस्तावेज़ है।

Boards

Boards and their derived write contracts.

get/v1/boards

List every board this key can address

Every board owned by the key's owner, oldest first, with the derived write contract on each. A key is bound to exactly one owner (a Discord guild, or a user for u_ boards) and can never address another owner's board.

Start here: write.endpoint, write.requires and write.rejects tell you what to send without reading any prose, and auto_applies tells you whether a write will ever return 201.

Requires the boards:read scope.

पैरामीटर
नामस्थानप्रकारविवरण
limitवैकल्पिकqueryinteger

Page size. Default 50, maximum 200. Out of range is a 422.

cursorवैकल्पिकquerystring

Opaque cursor. Pass the previous page's next_cursor back verbatim, or omit it to start at the top. Cursors are composite (value, tie-breaker) so a page boundary inside a block of tied scores resumes mid-tie. A malformed cursor is a 400; cursors are NOT signed, so a hand-built one is accepted and silently starts you at an arbitrary position. Never synthesize one.

प्रतिक्रियाएँ
स्थितिविवरण
200

A page of boards.

400

invalid_request at the transport level: a body that is not JSON, a missing or unusable Idempotency-Key, a malformed cursor, or a player id that is not one this API issues. A body that parsed but was semantically wrong is a 422 instead.

401

Missing, malformed, unknown or revoked API key. Present the key as Authorization: Bearer sk_live_.... Authentication runs before the rate limiter, so this response carries no RateLimit-* headers.

403

The key authenticated but may not do this: it is missing the scope the operation needs, or it is a sk_test_ key, which is read-only and is never granted a write scope.

422

The request was understood and refused. code says which rule: invalid_request (schema, including a .strict() body naming the unrecognized key), board_type_mismatch, team_size_mismatch, duplicate_participant or unknown_player.

429

Per-key token bucket: 600 reads and 60 writes per minute, tracked as separate buckets so a burst of writes cannot starve the polling that watches for their result. Rate limiting is evaluated BEFORE idempotency, so a 429 is never a replay.

500

Something failed on our side. The detail is deliberately generic — quote request_id, which joins your report to our log line.

फ़ील्डप्रकारविवरण
dataBoard[]
has_moreboolean

True when another page exists. Do not infer it from a short page — a page can be short and still have more.

next_cursorstring | null

Pass back as ?cursor=. null on the last page. Opaque: never parse it, never build one.

उदाहरण प्रतिक्रिया · 200
{
  "data": [
    {
      "id": "board_1",
      "display_name": "Tuesday Chess",
      "type": "ELO",
      "sort": "desc",
      "team_size": 3,
      "fixed_teams": false,
      "url": "https://scoreboards.dev/leaderboards/111222333444555666/board_1",
      "write": {
        "endpoint": "/v1/boards/board_1/matches",
        "requires": [
          "team1",
          "team2",
          "winner"
        ],
        "rejects": [
          "team1_score",
          "team2_score",
          "score"
        ],
        "operator": "elo",
        "k_factor": 24,
        "start_rating": 1000
      },
      "validation_window_hours": 24,
      "auto_applies": false
    },
    {
      "id": "board_2",
      "display_name": "Sunday League",
      "type": "League",
      "sort": "desc",
      "team_size": 1,
      "fixed_teams": false,
      "url": "https://scoreboards.dev/leaderboards/111222333444555666/board_2",
      "write": {
        "endpoint": "/v1/boards/board_2/matches",
        "requires": [
          "team1",
          "team2",
          "team1_score",
          "team2_score"
        ],
        "rejects": [
          "winner",
          "score"
        ],
        "operator": "league_points",
        "points_win": 3,
        "points_draw": 1,
        "points_loss": 0
      },
      "validation_window_hours": 0,
      "auto_applies": true
    },
    {
      "id": "board_3",
      "display_name": "Speedrun",
      "type": "Highscore",
      "sort": "desc",
      "team_size": 1,
      "fixed_teams": false,
      "url": "https://scoreboards.dev/leaderboards/111222333444555666/board_3",
      "write": {
        "endpoint": "/v1/boards/board_3/scores",
        "requires": [
          "player",
          "score"
        ],
        "rejects": [
          "team1",
          "team2",
          "winner",
          "team1_score",
          "team2_score"
        ],
        "operator": "keep_highest"
      },
      "validation_window_hours": 24,
      "auto_applies": false
    }
  ],
  "has_more": false,
  "next_cursor": null
}
उदाहरण अनुरोध
curl 'https://api.scoreboards.dev/v1/boards?cursor=eyJzIjoxMjAwLCJwIjoiMTk4Mzc0NjUyMDAwMDAwMDAyIn0' \
  -H 'Authorization: Bearer sk_live_...'
get/v1/boards/{board}

Get one board and its write contract

Metadata plus the derived, read-only write contract. The operator is fixed by the board's type and sort when it is created — Classic accumulates, Highscore keeps the maximum, Time keeps the minimum, ELO applies a zero-sum delta, League awards points — and cannot be overridden per submission.

Read auto_applies before you build anything: when it is false, every write returns 202 and nothing changes until a moderator approves it in Discord.

Requires the boards:read scope.

पैरामीटर
नामस्थानप्रकारविवरण
boardआवश्यकpathstring

The board id — metadata.game_name, e.g. board_1. Immutable, and never the display name. Older boards may carry a free-form (even non-ASCII) name, so URL-encode it.

प्रतिक्रियाएँ
स्थितिविवरण
200

The board.

401

Missing, malformed, unknown or revoked API key. Present the key as Authorization: Bearer sk_live_.... Authentication runs before the rate limiter, so this response carries no RateLimit-* headers.

403

The key authenticated but may not do this: it is missing the scope the operation needs, or it is a sk_test_ key, which is read-only and is never granted a write scope.

404

No such resource for this key's owner. A board that exists but belongs to somebody else returns exactly this, indistinguishable from one that does not exist — confirming existence would let a caller enumerate other people's boards.

422

The request was understood and refused. code says which rule: invalid_request (schema, including a .strict() body naming the unrecognized key), board_type_mismatch, team_size_mismatch, duplicate_participant or unknown_player.

429

Per-key token bucket: 600 reads and 60 writes per minute, tracked as separate buckets so a burst of writes cannot starve the polling that watches for their result. Rate limiting is evaluated BEFORE idempotency, so a 429 is never a replay.

500

Something failed on our side. The detail is deliberately generic — quote request_id, which joins your report to our log line.

फ़ील्डप्रकारविवरण
idstring

Immutable public id. Use it in every path; it never changes, even when display_name does.

display_namestring
type"Classic" | "Highscore" | "Time" | "ELO" | "League" | "Rating"

Decides which write endpoint applies. ELO and League take matches; Classic, Highscore and Time take scores; Rating takes neither in v0.

sort"desc" | "asc"
team_sizeinteger

Participants per side on a match board. Each roster must carry exactly this many — unless fixed_teams is true, in which case each side is exactly ONE team entity.

fixed_teamsboolean

True when the board plays fixed team entities against each other. A match then names two team_ids, not 2 × team_size players.

urlstring
writeWriteContract | null

What to POST. null on Rating boards, which have no v0 write endpoint.

validation_window_hoursinteger

Hours a submission waits for a moderator. 0 auto-applies; 999 means manual review with no countdown.

auto_appliesboolean

True only when validation_window_hours is 0. When false, a write returns 202 and NOTHING changes on the leaderboard until a human clicks Approve in Discord.

उदाहरण प्रतिक्रिया · 200
{
  "id": "board_1",
  "display_name": "Tuesday Chess",
  "type": "ELO",
  "sort": "desc",
  "team_size": 3,
  "fixed_teams": false,
  "url": "https://scoreboards.dev/leaderboards/111222333444555666/board_1",
  "write": {
    "endpoint": "/v1/boards/board_1/matches",
    "requires": [
      "team1",
      "team2",
      "winner"
    ],
    "rejects": [
      "team1_score",
      "team2_score",
      "score"
    ],
    "operator": "elo",
    "k_factor": 24,
    "start_rating": 1000
  },
  "validation_window_hours": 24,
  "auto_applies": false
}
उदाहरण अनुरोध
curl 'https://api.scoreboards.dev/v1/boards/board_1' \
  -H 'Authorization: Bearer sk_live_...'

Entries

Ranked standings — one row per participant.

get/v1/boards/{board}/entries

List ranked standings

The leaderboard, best first, cursor-paginated. rank is correct on every page, including a page resumed from a cursor.

ELO boards carry elo; every other type carries score. Rating boards have no ranked entries in v0 (they store one row per submission, not per player) and return a 422 board_type_mismatch.

Requires the entries:read scope.

पैरामीटर
नामस्थानप्रकारविवरण
boardआवश्यकpathstring

The board id — metadata.game_name, e.g. board_1. Immutable, and never the display name. Older boards may carry a free-form (even non-ASCII) name, so URL-encode it.

limitवैकल्पिकqueryinteger

Page size. Default 50, maximum 200. Out of range is a 422.

cursorवैकल्पिकquerystring

Opaque cursor. Pass the previous page's next_cursor back verbatim, or omit it to start at the top. Cursors are composite (value, tie-breaker) so a page boundary inside a block of tied scores resumes mid-tie. A malformed cursor is a 400; cursors are NOT signed, so a hand-built one is accepted and silently starts you at an arbitrary position. Never synthesize one.

प्रतिक्रियाएँ
स्थितिविवरण
200

A page of standings.

400

invalid_request at the transport level: a body that is not JSON, a missing or unusable Idempotency-Key, a malformed cursor, or a player id that is not one this API issues. A body that parsed but was semantically wrong is a 422 instead.

401

Missing, malformed, unknown or revoked API key. Present the key as Authorization: Bearer sk_live_.... Authentication runs before the rate limiter, so this response carries no RateLimit-* headers.

403

The key authenticated but may not do this: it is missing the scope the operation needs, or it is a sk_test_ key, which is read-only and is never granted a write scope.

404

No such resource for this key's owner. A board that exists but belongs to somebody else returns exactly this, indistinguishable from one that does not exist — confirming existence would let a caller enumerate other people's boards.

422

The request was understood and refused. code says which rule: invalid_request (schema, including a .strict() body naming the unrecognized key), board_type_mismatch, team_size_mismatch, duplicate_participant or unknown_player.

429

Per-key token bucket: 600 reads and 60 writes per minute, tracked as separate buckets so a burst of writes cannot starve the polling that watches for their result. Rate limiting is evaluated BEFORE idempotency, so a 429 is never a replay.

500

Something failed on our side. The detail is deliberately generic — quote request_id, which joins your report to our log line.

फ़ील्डप्रकारविवरण
dataEntry[]
has_moreboolean

True when another page exists. Do not infer it from a short page — a page can be short and still have more.

next_cursorstring | null

Pass back as ?cursor=. null on the last page. Opaque: never parse it, never build one.

उदाहरण प्रतिक्रिया · 200
{
  "data": [
    {
      "rank": 1,
      "player_id": "discord:198374652000000001",
      "player_name": "Ava",
      "last_sub": "2026-07-20T12:00:00.000Z",
      "elo": 1450,
      "wins": 9,
      "draws": 2,
      "losses": 1
    },
    {
      "rank": 2,
      "player_id": "discord:198374652000000002",
      "player_name": "Ben",
      "last_sub": "2026-07-21T12:00:00.000Z",
      "elo": 1200,
      "wins": 4,
      "draws": 1,
      "losses": 4
    }
  ],
  "has_more": true,
  "next_cursor": "eyJzIjoxMjAwLCJwIjoiMTk4Mzc0NjUyMDAwMDAwMDAyIn0"
}
उदाहरण अनुरोध
curl 'https://api.scoreboards.dev/v1/boards/board_1/entries?cursor=eyJzIjoxMjAwLCJwIjoiMTk4Mzc0NjUyMDAwMDAwMDAyIn0' \
  -H 'Authorization: Bearer sk_live_...'
get/v1/boards/{board}/entries/{player_id}

Get one participant's standing

One row of the leaderboard, with its live rank. Use a player_id exactly as an entries response returned it; a bare Discord snowflake also works.

A participant with no row on this board is a 404 — a player who has never submitted has no standing to report.

Requires the entries:read scope.

पैरामीटर
नामस्थानप्रकारविवरण
boardआवश्यकpathstring

The board id — metadata.game_name, e.g. board_1. Immutable, and never the display name. Older boards may carry a free-form (even non-ASCII) name, so URL-encode it.

player_idआवश्यकpathstring

A namespaced player id as returned by the entries endpoints: discord:<snowflake>, custom:<name>, role:<id> or team:<id>. A bare Discord snowflake is also accepted, so a caller can paste one straight in. Anything else is a 400.

प्रतिक्रियाएँ
स्थितिविवरण
200

The standing.

400

invalid_request at the transport level: a body that is not JSON, a missing or unusable Idempotency-Key, a malformed cursor, or a player id that is not one this API issues. A body that parsed but was semantically wrong is a 422 instead.

401

Missing, malformed, unknown or revoked API key. Present the key as Authorization: Bearer sk_live_.... Authentication runs before the rate limiter, so this response carries no RateLimit-* headers.

403

The key authenticated but may not do this: it is missing the scope the operation needs, or it is a sk_test_ key, which is read-only and is never granted a write scope.

404

No such resource for this key's owner. A board that exists but belongs to somebody else returns exactly this, indistinguishable from one that does not exist — confirming existence would let a caller enumerate other people's boards.

422

The request was understood and refused. code says which rule: invalid_request (schema, including a .strict() body naming the unrecognized key), board_type_mismatch, team_size_mismatch, duplicate_participant or unknown_player.

429

Per-key token bucket: 600 reads and 60 writes per minute, tracked as separate buckets so a burst of writes cannot starve the polling that watches for their result. Rate limiting is evaluated BEFORE idempotency, so a 429 is never a replay.

500

Something failed on our side. The detail is deliberately generic — quote request_id, which joins your report to our log line.

फ़ील्डप्रकारविवरण
rankinteger

1-based, and correct on every page — a resumed page derives it with a COUNT rather than numbering from 1.

player_idstring

Namespaced: discord:<snowflake>, custom:<name>, role:<id> or team:<id>. Pass it back verbatim to /entries/{player_id} or ?player=.

player_namestring
scoreवैकल्पिकnumber | null
eloवैकल्पिकnumber | null
winsवैकल्पिकinteger | null
drawsवैकल्पिकinteger | null
lossesवैकल्पिकinteger | null
submissionsवैकल्पिकinteger | null
last_substring | null

RFC 3339 UTC. null when the participant has never submitted.

उदाहरण प्रतिक्रिया · 200
{
  "rank": 1,
  "player_id": "discord:198374652000000001",
  "player_name": "Ava",
  "last_sub": "2026-07-20T12:00:00.000Z",
  "elo": 1450,
  "wins": 9,
  "draws": 2,
  "losses": 1
}
उदाहरण अनुरोध
curl 'https://api.scoreboards.dev/v1/boards/board_1/entries/discord:198374652000000001' \
  -H 'Authorization: Bearer sk_live_...'

Matches

Match history on ELO and League boards, and the asynchronous endpoint that records one. The write returns a handle, not a result.

get/v1/boards/{board}/matches

List match history

Recorded matches, newest first. Only ELO and League boards record matches; on any other type this is a 422 board_type_mismatch pointing you at /entries.

Every participant carries the elo they held when the match was submitted, not when it was approved — so a tournament pushed as ten back-to-back matches shows pre-tournament ratings on all ten.

Requires the matches:read scope.

पैरामीटर
नामस्थानप्रकारविवरण
boardआवश्यकpathstring

The board id — metadata.game_name, e.g. board_1. Immutable, and never the display name. Older boards may carry a free-form (even non-ASCII) name, so URL-encode it.

limitवैकल्पिकqueryinteger

Page size. Default 50, maximum 200. Out of range is a 422.

cursorवैकल्पिकquerystring

Opaque cursor. Pass the previous page's next_cursor back verbatim, or omit it to start at the top. Cursors are composite (value, tie-breaker) so a page boundary inside a block of tied scores resumes mid-tie. A malformed cursor is a 400; cursors are NOT signed, so a hand-built one is accepted and silently starts you at an arbitrary position. Never synthesize one.

playerवैकल्पिकquerystring

Only matches this participant took part in. Same namespaced form as Entry.player_id; a bare snowflake is accepted. An unusable value is a 400, not an empty list.

statusवैकल्पिकquery"pending" | "approved" | "rejected" | "adjusted" | "set"

Only matches in this review state. adjusted and set are moderator edits made in Discord.

प्रतिक्रियाएँ
स्थितिविवरण
200

A page of matches.

400

invalid_request at the transport level: a body that is not JSON, a missing or unusable Idempotency-Key, a malformed cursor, or a player id that is not one this API issues. A body that parsed but was semantically wrong is a 422 instead.

401

Missing, malformed, unknown or revoked API key. Present the key as Authorization: Bearer sk_live_.... Authentication runs before the rate limiter, so this response carries no RateLimit-* headers.

403

The key authenticated but may not do this: it is missing the scope the operation needs, or it is a sk_test_ key, which is read-only and is never granted a write scope.

404

No such resource for this key's owner. A board that exists but belongs to somebody else returns exactly this, indistinguishable from one that does not exist — confirming existence would let a caller enumerate other people's boards.

422

The request was understood and refused. code says which rule: invalid_request (schema, including a .strict() body naming the unrecognized key), board_type_mismatch, team_size_mismatch, duplicate_participant or unknown_player.

429

Per-key token bucket: 600 reads and 60 writes per minute, tracked as separate buckets so a burst of writes cannot starve the polling that watches for their result. Rate limiting is evaluated BEFORE idempotency, so a 429 is never a replay.

500

Something failed on our side. The detail is deliberately generic — quote request_id, which joins your report to our log line.

फ़ील्डप्रकारविवरण
dataMatch[]
has_moreboolean

True when another page exists. Do not infer it from a short page — a page can be short and still have more.

next_cursorstring | null

Pass back as ?cursor=. null on the last page. Opaque: never parse it, never build one.

उदाहरण प्रतिक्रिया · 200
{
  "data": [
    {
      "id": 2,
      "board": "board_1",
      "team_size": 3,
      "team1": [
        {
          "player_id": "discord:198374652000000001",
          "player_name": "Ava",
          "elo": 1450
        },
        {
          "player_id": "discord:198374652000000002",
          "player_name": "Ben",
          "elo": 1200
        },
        {
          "player_id": "custom:demo_1",
          "player_name": "Demo Player",
          "elo": 1050
        }
      ],
      "team2": [
        {
          "player_id": "discord:198374652000000003",
          "player_name": "Cal",
          "elo": 1200
        },
        {
          "player_id": "discord:198374652000000004",
          "player_name": "Dee",
          "elo": 900
        },
        {
          "player_id": "custom:Ava Custom",
          "player_name": "Ava Custom",
          "elo": 1100
        }
      ],
      "winner": "team2",
      "status": "pending",
      "applied": false,
      "submitted_at": "2026-07-25T10:00:00.000Z",
      "submitted_by": "api"
    },
    {
      "id": 1,
      "board": "board_1",
      "team_size": 1,
      "team1": [
        {
          "player_id": "discord:198374652000000001",
          "player_name": "Ava",
          "elo": 1450
        }
      ],
      "team2": [
        {
          "player_id": "discord:198374652000000002",
          "player_name": "Ben",
          "elo": 1200
        }
      ],
      "winner": "team1",
      "status": "approved",
      "applied": true,
      "submitted_at": "2026-07-24T10:00:00.000Z",
      "submitted_by": "api"
    }
  ],
  "has_more": false,
  "next_cursor": null
}
उदाहरण अनुरोध
curl 'https://api.scoreboards.dev/v1/boards/board_1/matches?cursor=eyJzIjoxMjAwLCJwIjoiMTk4Mzc0NjUyMDAwMDAwMDAyIn0&player=discord:198374652000000001&status=approved' \
  -H 'Authorization: Bearer sk_live_...'
post/v1/boards/{board}/matches

Record an ELO or League match (asynchronous)

Returns 202 Accepted and a handle, not a rank. The match is enqueued for the bot that owns the scoring; on a board with a validation window it then sits in the Discord validation channel until a moderator clicks Approve. Poll GET /submissions/{handle} to learn the outcome.

201 Created happens only on an auto-applying board (auto_applies: true) whose worker finished inside the ~3s wait budget. A timeout still returns 202. Handle both.

The body depends on the board type, and each rejects the other's fields with a 422 naming the offending key:

  • ELO takes team1, team2 and winner (team1 | team2 | draw). It has no score field.
  • League takes team1, team2, team1_score and team2_score, and DERIVES the winner from the scoreline. Sending winner is refused.

Each roster must carry exactly the board's team_size participants — except on a board with fixed_teams: true, where each side is exactly ONE team_id and the match is between the two team entities rather than their members. Anything else is a 422 team_size_mismatch.

Ratings are snapshotted when the match is created, not when it is approved.

Requires the matches:write scope and an Idempotency-Key header. sk_test_ keys are read-only.

पैरामीटर
नामस्थानप्रकारविवरण
boardआवश्यकpathstring

The board id — metadata.game_name, e.g. board_1. Immutable, and never the display name. Older boards may carry a free-form (even non-ASCII) name, so URL-encode it.

Idempotency-Keyआवश्यकheaderstring

Required on every POST. A value you generate per logical write (a UUID is ideal) and reuse when you retry. Same key + same body replays the stored response byte for byte; same key + a DIFFERENT body is a 409, so a caller who edits and retries never silently receives the old result. Records are kept for at least 24h — that is a floor, not an expiry, so treat a key as permanently spent rather than recycling one. Omitting the header is a 400 — retrying without one risks a duplicate match in someone's validation channel.

अनुरोध का बॉडी application/json

An ELO match or a League match — whichever the board is. The two shapes are mutually exclusive.

इनमें से ठीक एक ही रूप भेजें — वही जो बोर्ड से मेल खाता हो:

EloMatchBody
फ़ील्डप्रकारविवरण
team1Participant[]
min items 1 · max items 8
team2Participant[]
min items 1 · max items 8
winner"team1" | "team2" | "draw"

Words, not codes. draw is a legal outcome and applies the zero-sum ELO delta for a tie.

LeagueMatchBody
फ़ील्डप्रकारविवरण
team1Participant[]
min items 1 · max items 8
team2Participant[]
min items 1 · max items 8
team1_scoreinteger
min 0 · max 9007199254740991
team2_scoreinteger
min 0 · max 9007199254740991
ELO, 3v3 (board_1)

Exactly `team_size` participants per side. Mixed forms are fine: members, a custom player, a role.

{
  "team1": [
    {
      "discord_id": "198374652000000001"
    },
    {
      "discord_id": "198374652000000002"
    },
    {
      "name": "Demo Player",
      "custom": true
    }
  ],
  "team2": [
    {
      "discord_id": "198374652000000003"
    },
    {
      "discord_id": "198374652000000004"
    },
    {
      "role_id": "role_998877"
    }
  ],
  "winner": "team1"
}
League, 1v1 (board_2)

Both scores required, integers >= 0. The winner is derived; sending one is a 422.

{
  "team1": [
    {
      "discord_id": "198374652000000001"
    }
  ],
  "team2": [
    {
      "discord_id": "198374652000000002"
    }
  ],
  "team1_score": 3,
  "team2_score": 1
}
ELO on a fixed-teams board

One team entity per side, regardless of `team_size`. A draw is a legal outcome.

{
  "team1": [
    {
      "team_id": "team_5"
    }
  ],
  "team2": [
    {
      "team_id": "team_6"
    }
  ],
  "winner": "draw"
}
प्रतिक्रियाएँ
स्थितिविवरण
201

Applied. Only ever returned by a board with auto_applies: true whose worker finished inside the wait budget — applied is true and match is present.

202

Queued. Nothing has changed on the leaderboard. applied is false and stays false until the submission is approved. This is the normal response.

400

invalid_request at the transport level: a body that is not JSON, a missing or unusable Idempotency-Key, a malformed cursor, or a player id that is not one this API issues. A body that parsed but was semantically wrong is a 422 instead.

401

Missing, malformed, unknown or revoked API key. Present the key as Authorization: Bearer sk_live_.... Authentication runs before the rate limiter, so this response carries no RateLimit-* headers.

403

The key authenticated but may not do this: it is missing the scope the operation needs, or it is a sk_test_ key, which is read-only and is never granted a write scope.

404

No such resource for this key's owner. A board that exists but belongs to somebody else returns exactly this, indistinguishable from one that does not exist — confirming existence would let a caller enumerate other people's boards.

409

The Idempotency-Key was already used for a request with a DIFFERENT body, or an identical request is still in flight (that variant carries Retry-After). Use a new key for a new request, or resend the original body byte for byte.

413

/v1 accepts at most 64 KB per request. The largest legal body — an 8v8 match — is well under a kilobyte.

422

The request was understood and refused. code says which rule: invalid_request (schema, including a .strict() body naming the unrecognized key), board_type_mismatch, team_size_mismatch, duplicate_participant or unknown_player.

429

Per-key token bucket: 600 reads and 60 writes per minute, tracked as separate buckets so a burst of writes cannot starve the polling that watches for their result. Rate limiting is evaluated BEFORE idempotency, so a 429 is never a replay.

500

Something failed on our side. The detail is deliberately generic — quote request_id, which joins your report to our log line.

फ़ील्डप्रकारविवरण
handlestring

Poll GET /submissions/{handle} with this. Resolves for 30 days, then 404s.

pattern ^sub_\d+$
boardstring
status"queued" | "processing" | "pending_review" | "approved" | "rejected" | "failed"

On a 202 this is queued (or, rarely, failed — the worker ran and threw inside the wait budget); approved only on a 201. pending_review never appears here: it is what the HANDLE reports once the worker has posted the submission for review. Poll the handle for that.

appliedboolean

True only when the result is already live on the leaderboard. False on every 202.

queued_atstring

RFC 3339 UTC, when the write was enqueued. A replayed response repeats the ORIGINAL value.

matchवैकल्पिकMatchRef | null

Present once the worker has created the match. Absent on a plain 202, which is the normal case.

उदाहरण प्रतिक्रिया · 201
{
  "handle": "sub_88214",
  "board": "board_2",
  "status": "approved",
  "applied": true,
  "queued_at": "2026-07-26T12:00:02.881Z",
  "match": {
    "id": 2,
    "url": "https://scoreboards.dev/leaderboards/111222333444555666/board_2",
    "applied": true
  }
}
उदाहरण अनुरोध
curl -X POST 'https://api.scoreboards.dev/v1/boards/board_1/matches' \
  -H 'Authorization: Bearer sk_live_...' \
  -H 'Idempotency-Key: 8f14e45f-ea6a-4e2b-9c1a-77c0e4d51a10' \
  -H 'Content-Type: application/json' \
  -d '{"team1":[{"discord_id":"198374652000000001"},{"discord_id":"198374652000000002"},{"name":"Demo Player","custom":true}],"team2":[{"discord_id":"198374652000000003"},{"discord_id":"198374652000000004"},{"role_id":"role_998877"}],"winner":"team1"}'
get/v1/boards/{board}/matches/{match_id}

Get one match with its rosters

One match by its per-board id, with both full rosters. League matches carry team1_score and team2_score; ELO matches have no scoreline and omit both.

Requires the matches:read scope.

पैरामीटर
नामस्थानप्रकारविवरण
boardआवश्यकpathstring

The board id — metadata.game_name, e.g. board_1. Immutable, and never the display name. Older boards may carry a free-form (even non-ASCII) name, so URL-encode it.

match_idआवश्यकpathinteger

The per-board match number (Match.id). Not globally unique.

प्रतिक्रियाएँ
स्थितिविवरण
200

The match.

401

Missing, malformed, unknown or revoked API key. Present the key as Authorization: Bearer sk_live_.... Authentication runs before the rate limiter, so this response carries no RateLimit-* headers.

403

The key authenticated but may not do this: it is missing the scope the operation needs, or it is a sk_test_ key, which is read-only and is never granted a write scope.

404

No such resource for this key's owner. A board that exists but belongs to somebody else returns exactly this, indistinguishable from one that does not exist — confirming existence would let a caller enumerate other people's boards.

422

The request was understood and refused. code says which rule: invalid_request (schema, including a .strict() body naming the unrecognized key), board_type_mismatch, team_size_mismatch, duplicate_participant or unknown_player.

429

Per-key token bucket: 600 reads and 60 writes per minute, tracked as separate buckets so a burst of writes cannot starve the polling that watches for their result. Rate limiting is evaluated BEFORE idempotency, so a 429 is never a replay.

500

Something failed on our side. The detail is deliberately generic — quote request_id, which joins your report to our log line.

फ़ील्डप्रकारविवरण
idinteger

Per-board match number. Not globally unique; always address it under its board.

boardstring
team_sizeinteger
team1MatchParticipant[]
team2MatchParticipant[]
winner"team1" | "team2" | "draw" | null

On a League board this is DERIVED from the scoreline, never supplied by the caller.

team1_scoreवैकल्पिकnumber | null

League boards only. Absent on ELO boards, which have no scoreline.

team2_scoreवैकल्पिकnumber | null

League boards only. Absent on ELO boards, which have no scoreline.

status"pending" | "approved" | "rejected" | "adjusted" | "set"

pending until reviewed. adjusted and set are moderator edits made in Discord.

appliedboolean

True only once the result is live on the leaderboard (approved, adjusted or set).

submitted_atstring | null

RFC 3339 UTC, when the match was submitted — not when it was approved.

submitted_byवैकल्पिकstring | null

The Discord user who submitted it, or api for a submission made through this API.

उदाहरण प्रतिक्रिया · 200
{
  "id": 2,
  "board": "board_1",
  "team_size": 3,
  "team1": [
    {
      "player_id": "discord:198374652000000001",
      "player_name": "Ava",
      "elo": 1450
    },
    {
      "player_id": "discord:198374652000000002",
      "player_name": "Ben",
      "elo": 1200
    },
    {
      "player_id": "custom:demo_1",
      "player_name": "Demo Player",
      "elo": 1050
    }
  ],
  "team2": [
    {
      "player_id": "discord:198374652000000003",
      "player_name": "Cal",
      "elo": 1200
    },
    {
      "player_id": "discord:198374652000000004",
      "player_name": "Dee",
      "elo": 900
    },
    {
      "player_id": "custom:Ava Custom",
      "player_name": "Ava Custom",
      "elo": 1100
    }
  ],
  "winner": "team2",
  "status": "pending",
  "applied": false,
  "submitted_at": "2026-07-25T10:00:00.000Z",
  "submitted_by": "api"
}
उदाहरण अनुरोध
curl 'https://api.scoreboards.dev/v1/boards/board_1/matches/2' \
  -H 'Authorization: Bearer sk_live_...'

Submissions

Score submissions on Classic, Highscore and Time boards, and resolving the handle that any write returns.

post/v1/boards/{board}/scores

Submit a score to a Classic, Highscore or Time board (asynchronous)

Returns 202 Accepted and a handle, not a new rank. Like every /v1 write it enqueues, and on a board with a validation window the score waits for a moderator. Poll GET /submissions/{handle}.

Time boards take MILLISECONDS as an integer1:30 is 90000. This is the most likely integration bug on the whole API; the board's write.score_unit says so too.

What the score does on approval is fixed by the board and is not a caller choice: Classic adds it to the running total, Highscore keeps the higher value, Time keeps the lower one.

ELO and League boards take matches, not scores, and answer 422 board_type_mismatch here.

Requires the scores:write scope and an Idempotency-Key header. sk_test_ keys are read-only.

पैरामीटर
नामस्थानप्रकारविवरण
boardआवश्यकpathstring

The board id — metadata.game_name, e.g. board_1. Immutable, and never the display name. Older boards may carry a free-form (even non-ASCII) name, so URL-encode it.

Idempotency-Keyआवश्यकheaderstring

Required on every POST. A value you generate per logical write (a UUID is ideal) and reuse when you retry. Same key + same body replays the stored response byte for byte; same key + a DIFFERENT body is a 409, so a caller who edits and retries never silently receives the old result. Records are kept for at least 24h — that is a floor, not an expiry, so treat a key as permanently spent rather than recycling one. Omitting the header is a 400 — retrying without one risks a duplicate match in someone's validation channel.

अनुरोध का बॉडी application/json

One participant and one integer score.

फ़ील्डप्रकारविवरण
playerParticipant

Exactly one of the four forms. Anything else is a 422 unknown_player.

scoreinteger

Integer. On a Time board this is MILLISECONDS: 1:30 is 90000, not 90 and not 1.5.

min -9007199254740991 · max 9007199254740991
A Discord member
{
  "player": {
    "discord_id": "198374652000000001"
  },
  "score": 145530
}
A Time board — milliseconds

A run of 2 minutes 25.530 seconds. Sending `145.53` seconds would record 145 ms.

{
  "player": {
    "name": "Ava",
    "custom": true
  },
  "score": 145530
}
प्रतिक्रियाएँ
स्थितिविवरण
201

Applied. Only ever returned by a board with auto_applies: true whose worker finished inside the wait budget — applied is true and match points at the stored submission.

202

Queued. Nothing has changed on the leaderboard. The score waits in the Discord validation channel until a moderator approves it. This is the normal response.

400

invalid_request at the transport level: a body that is not JSON, a missing or unusable Idempotency-Key, a malformed cursor, or a player id that is not one this API issues. A body that parsed but was semantically wrong is a 422 instead.

401

Missing, malformed, unknown or revoked API key. Present the key as Authorization: Bearer sk_live_.... Authentication runs before the rate limiter, so this response carries no RateLimit-* headers.

403

The key authenticated but may not do this: it is missing the scope the operation needs, or it is a sk_test_ key, which is read-only and is never granted a write scope.

404

No such resource for this key's owner. A board that exists but belongs to somebody else returns exactly this, indistinguishable from one that does not exist — confirming existence would let a caller enumerate other people's boards.

409

The Idempotency-Key was already used for a request with a DIFFERENT body, or an identical request is still in flight (that variant carries Retry-After). Use a new key for a new request, or resend the original body byte for byte.

413

/v1 accepts at most 64 KB per request. The largest legal body — an 8v8 match — is well under a kilobyte.

422

The request was understood and refused. code says which rule: invalid_request (schema, including a .strict() body naming the unrecognized key), board_type_mismatch, team_size_mismatch, duplicate_participant or unknown_player.

429

Per-key token bucket: 600 reads and 60 writes per minute, tracked as separate buckets so a burst of writes cannot starve the polling that watches for their result. Rate limiting is evaluated BEFORE idempotency, so a 429 is never a replay.

500

Something failed on our side. The detail is deliberately generic — quote request_id, which joins your report to our log line.

फ़ील्डप्रकारविवरण
handlestring

Poll GET /submissions/{handle} with this. Resolves for 30 days, then 404s.

pattern ^sub_\d+$
boardstring
status"queued" | "processing" | "pending_review" | "approved" | "rejected" | "failed"

On a 202 this is queued (or, rarely, failed — the worker ran and threw inside the wait budget); approved only on a 201. pending_review never appears here: it is what the HANDLE reports once the worker has posted the submission for review. Poll the handle for that.

appliedboolean

True only when the result is already live on the leaderboard. False on every 202.

queued_atstring

RFC 3339 UTC, when the write was enqueued. A replayed response repeats the ORIGINAL value.

matchवैकल्पिकMatchRef | null

Present once the worker has created the match. Absent on a plain 202, which is the normal case.

उदाहरण प्रतिक्रिया · 201
{
  "handle": "sub_88216",
  "board": "board_7",
  "status": "approved",
  "applied": true,
  "queued_at": "2026-07-26T12:00:04.017Z",
  "match": {
    "id": 118,
    "url": "https://scoreboards.dev/leaderboards/111222333444555666/board_7",
    "applied": true
  }
}
उदाहरण अनुरोध
curl -X POST 'https://api.scoreboards.dev/v1/boards/board_1/scores' \
  -H 'Authorization: Bearer sk_live_...' \
  -H 'Idempotency-Key: 8f14e45f-ea6a-4e2b-9c1a-77c0e4d51a10' \
  -H 'Content-Type: application/json' \
  -d '{"player":{"discord_id":"198374652000000001"},"score":145530}'
get/v1/submissions/{handle}

Resolve a write handle

The only correct way to learn what happened to a write. status moves queuedprocessingpending_reviewapproved | rejected, or failed.

The answer is read from the live match or submission row, not just from the queue, so it keeps up with a moderator approving hours later. Once the row exists, match.id links to it and match.applied says whether it is live on the leaderboard.

Handles resolve for 30 days, then 404. Another owner's handle is an indistinguishable 404, so sequential handles cannot be probed across tenants.

Requires the boards:read scope.

पैरामीटर
नामस्थानप्रकारविवरण
handleआवश्यकpathstring

The write handle returned by a POST, e.g. sub_88213. Resolves for 30 days.

प्रतिक्रियाएँ
स्थितिविवरण
200

The submission state.

401

Missing, malformed, unknown or revoked API key. Present the key as Authorization: Bearer sk_live_.... Authentication runs before the rate limiter, so this response carries no RateLimit-* headers.

403

The key authenticated but may not do this: it is missing the scope the operation needs, or it is a sk_test_ key, which is read-only and is never granted a write scope.

404

No such resource for this key's owner. A board that exists but belongs to somebody else returns exactly this, indistinguishable from one that does not exist — confirming existence would let a caller enumerate other people's boards.

422

The request was understood and refused. code says which rule: invalid_request (schema, including a .strict() body naming the unrecognized key), board_type_mismatch, team_size_mismatch, duplicate_participant or unknown_player.

429

Per-key token bucket: 600 reads and 60 writes per minute, tracked as separate buckets so a burst of writes cannot starve the polling that watches for their result. Rate limiting is evaluated BEFORE idempotency, so a 429 is never a replay.

500

Something failed on our side. The detail is deliberately generic — quote request_id, which joins your report to our log line.

फ़ील्डप्रकारविवरण
handlestring
pattern ^sub_\d+$
status"queued" | "processing" | "pending_review" | "approved" | "rejected" | "failed"
boardstring
matchMatchRef | null
उदाहरण प्रतिक्रिया · 200
{
  "handle": "sub_88213",
  "status": "approved",
  "board": "board_1",
  "match": {
    "id": 3,
    "url": "https://scoreboards.dev/leaderboards/111222333444555666/board_1",
    "applied": true
  }
}
उदाहरण अनुरोध
curl 'https://api.scoreboards.dev/v1/submissions/sub_88213' \
  -H 'Authorization: Bearer sk_live_...'

डेटा प्रकार

ऊपर की प्रतिक्रियाएँ जिन वस्तुओं से बनी हैं। हर फ़ील्ड नाम और विवरण उन्हीं स्कीमा से आता है जिनसे हैंडलर सत्यापन करते हैं, इसलिए वे इस बात से अलग नहीं हो सकते कि API वास्तव में क्या स्वीकार और वापस करता है।

Problem

Every /v1 failure, as application/problem+json (RFC 9457). Branch on code, never on title or detail — those are English prose for humans and may be reworded. The API is English-only and ignores Accept-Language.

फ़ील्डप्रकारविवरण
typestring (uri)

A stable URI for this error class, e.g. https://scoreboards.dev/errors/board-type-mismatch.

titlestring

Short human summary. Not machine-readable.

statusinteger

Repeats the HTTP status code.

min 400 · max 599
detailstring

What went wrong with THIS request, naming the offending field where there is one.

instancestring

The path that failed, e.g. /v1/boards/board_1/matches.

code"invalid_request" | "authentication_failed" | "permission_denied" | "not_found" | "idempotency_conflict" | "rate_limited" | "board_type_mismatch" | "team_size_mismatch" | "duplicate_participant" | "unknown_player" | "board_locked" | "internal_error"

The machine-readable contract. Stable across rewordings.

request_idstring

Correlation id, also returned as X-Request-Id. Quote it to support.

Board

A leaderboard, plus the derived contract for writing to it. id is the immutable game_name slug (board_123), not the display name — renaming a board never changes it.

फ़ील्डप्रकारविवरण
idstring

Immutable public id. Use it in every path; it never changes, even when display_name does.

display_namestring
type"Classic" | "Highscore" | "Time" | "ELO" | "League" | "Rating"

Decides which write endpoint applies. ELO and League take matches; Classic, Highscore and Time take scores; Rating takes neither in v0.

sort"desc" | "asc"
team_sizeinteger

Participants per side on a match board. Each roster must carry exactly this many — unless fixed_teams is true, in which case each side is exactly ONE team entity.

fixed_teamsboolean

True when the board plays fixed team entities against each other. A match then names two team_ids, not 2 × team_size players.

urlstring
writeWriteContract | null

What to POST. null on Rating boards, which have no v0 write endpoint.

validation_window_hoursinteger

Hours a submission waits for a moderator. 0 auto-applies; 999 means manual review with no countdown.

auto_appliesboolean

True only when validation_window_hours is 0. When false, a write returns 202 and NOTHING changes on the leaderboard until a human clicks Approve in Discord.

WriteContract

What this board accepts, derived from its type and sort. operator is read-only — it is fixed when the board is created and cannot be overridden per submission.

फ़ील्डप्रकारविवरण
endpointstring
requiresstring[]

Fields that must be present in the write body.

rejectsstring[]

Fields this board type refuses. Sending one is a 422 naming the offending key.

operator"elo" | "league_points" | "accumulate" | "keep_highest" | "keep_lowest"

How an approved submission is applied. Derived from the board type and sort; never a caller input.

score_unitवैकल्पिकstring

Present on Time boards only. Scores are integer MILLISECONDS — 1:30 is 90000.

k_factorवैकल्पिकinteger
start_ratingवैकल्पिकinteger
points_winवैकल्पिकinteger
points_drawवैकल्पिकinteger
points_lossवैकल्पिकinteger

Entry

One participant's standing. elo is present on ELO boards and score on every other type; wins/draws/losses on ELO and League, submissions on Classic, Highscore and Time.

फ़ील्डप्रकारविवरण
rankinteger

1-based, and correct on every page — a resumed page derives it with a COUNT rather than numbering from 1.

player_idstring

Namespaced: discord:<snowflake>, custom:<name>, role:<id> or team:<id>. Pass it back verbatim to /entries/{player_id} or ?player=.

player_namestring
scoreवैकल्पिकnumber | null
eloवैकल्पिकnumber | null
winsवैकल्पिकinteger | null
drawsवैकल्पिकinteger | null
lossesवैकल्पिकinteger | null
submissionsवैकल्पिकinteger | null
last_substring | null

RFC 3339 UTC. null when the participant has never submitted.

MatchParticipant

फ़ील्डप्रकारविवरण
player_idstring
player_namestring
eloवैकल्पिकnumber | null

The rating this participant held when the match was SUBMITTED, not when it was approved. Ten matches pushed back to back all carry pre-tournament ratings.

Match

One recorded match on an ELO or League board. id is old_id — per-board, so match URLs are always board-nested.

फ़ील्डप्रकारविवरण
idinteger

Per-board match number. Not globally unique; always address it under its board.

boardstring
team_sizeinteger
team1MatchParticipant[]
team2MatchParticipant[]
winner"team1" | "team2" | "draw" | null

On a League board this is DERIVED from the scoreline, never supplied by the caller.

team1_scoreवैकल्पिकnumber | null

League boards only. Absent on ELO boards, which have no scoreline.

team2_scoreवैकल्पिकnumber | null

League boards only. Absent on ELO boards, which have no scoreline.

status"pending" | "approved" | "rejected" | "adjusted" | "set"

pending until reviewed. adjusted and set are moderator edits made in Discord.

appliedboolean

True only once the result is live on the leaderboard (approved, adjusted or set).

submitted_atstring | null

RFC 3339 UTC, when the match was submitted — not when it was approved.

submitted_byवैकल्पिकstring | null

The Discord user who submitted it, or api for a submission made through this API.

MatchRef

The match a write produced, once the worker has created it.

फ़ील्डप्रकारविवरण
idinteger
urlstring
appliedboolean

DiscordParticipant

A real Discord member. Must be 17-20 digits: a shorter id is stored as a CUSTOM player of that name rather than as the member, so it is refused here instead of creating a row nobody owns.

फ़ील्डप्रकारविवरण
discord_idstring
pattern ^\d{17,20}$

CustomParticipant

A player who is not a Discord member. custom: true is required and explicit — it is what stops a Discord id typed into name from creating a lookalike row. The internal key is built for you.

फ़ील्डप्रकारविवरण
namestring
min length 1 · max length 100
customboolean

TeamParticipant

A fixed team entity. Valid only on a board with fixed_teams: true, one per side.

फ़ील्डप्रकारविवरण
team_idstring
pattern ^team_\d+$

RoleParticipant

A Discord role competing as a single entity. Guild-owned boards only.

फ़ील्डप्रकारविवरण
role_idstring
pattern ^role_\d+$

Participant

Exactly one of the four forms. Anything else is a 422 unknown_player.

BoardList

Cursor-paginated. Pass next_cursor back as ?cursor= for the next page.

फ़ील्डप्रकारविवरण
dataBoard[]
has_moreboolean

True when another page exists. Do not infer it from a short page — a page can be short and still have more.

next_cursorstring | null

Pass back as ?cursor=. null on the last page. Opaque: never parse it, never build one.

EntryList

Cursor-paginated on the composite (score, player_id), so a page boundary that falls inside a block of tied scores resumes mid-tie instead of skipping everyone on that score.

फ़ील्डप्रकारविवरण
dataEntry[]
has_moreboolean

True when another page exists. Do not infer it from a short page — a page can be short and still have more.

next_cursorstring | null

Pass back as ?cursor=. null on the last page. Opaque: never parse it, never build one.

MatchList

Cursor-paginated, newest match first.

फ़ील्डप्रकारविवरण
dataMatch[]
has_moreboolean

True when another page exists. Do not infer it from a short page — a page can be short and still have more.

next_cursorstring | null

Pass back as ?cursor=. null on the last page. Opaque: never parse it, never build one.

EloMatchBody

The body an ELO board takes. An ELO board has no score field, so team1_score, team2_score and score are refused with a 422 naming the key. Each roster carries exactly the board's team_size — or exactly one team_id when fixed_teams is true.

फ़ील्डप्रकारविवरण
team1Participant[]
min items 1 · max items 8
team2Participant[]
min items 1 · max items 8
winner"team1" | "team2" | "draw"

Words, not codes. draw is a legal outcome and applies the zero-sum ELO delta for a tie.

LeagueMatchBody

The body a League board takes. League DERIVES the winner from the scoreline, so a caller-supplied winner is refused with a 422 — accepting it would let the caller contradict their own scores. Points come from the board's points_win/points_draw/points_loss.

फ़ील्डप्रकारविवरण
team1Participant[]
min items 1 · max items 8
team2Participant[]
min items 1 · max items 8
team1_scoreinteger
min 0 · max 9007199254740991
team2_scoreinteger
min 0 · max 9007199254740991

ScoreSubmissionBody

The body a Classic, Highscore or Time board takes. On a Time board score is integer MILLISECONDS — 1:30 is 90000. Sending seconds is the single most likely integration bug on this API. What happens on approval is fixed by the board: Classic accumulates, Highscore keeps the maximum, Time keeps the minimum.

फ़ील्डप्रकारविवरण
playerParticipant

Exactly one of the four forms. Anything else is a 422 unknown_player.

scoreinteger

Integer. On a Time board this is MILLISECONDS: 1:30 is 90000, not 90 and not 1.5.

min -9007199254740991 · max 9007199254740991

WriteAccepted

What a POST returns. It is a receipt, not a result: applied is false on every board with a validation window, and stays false until a moderator approves the submission in Discord.

फ़ील्डप्रकारविवरण
handlestring

Poll GET /submissions/{handle} with this. Resolves for 30 days, then 404s.

pattern ^sub_\d+$
boardstring
status"queued" | "processing" | "pending_review" | "approved" | "rejected" | "failed"

On a 202 this is queued (or, rarely, failed — the worker ran and threw inside the wait budget); approved only on a 201. pending_review never appears here: it is what the HANDLE reports once the worker has posted the submission for review. Poll the handle for that.

appliedboolean

True only when the result is already live on the leaderboard. False on every 202.

queued_atstring

RFC 3339 UTC, when the write was enqueued. A replayed response repeats the ORIGINAL value.

matchवैकल्पिकMatchRef | null

Present once the worker has created the match. Absent on a plain 202, which is the normal case.

Submission

The state of a write handle, read from the LIVE row rather than the queue — so it keeps up with a moderator approving or rejecting the match hours after the queue entry finished.

फ़ील्डप्रकारविवरण
handlestring
pattern ^sub_\d+$
status"queued" | "processing" | "pending_review" | "approved" | "rejected" | "failed"
boardstring
matchMatchRef | null

त्रुटियाँ

इस संदर्भ के किसी भी एंडपॉइंट की हर विफलता application/problem+json के रूप में दिया गया RFC 9457 समस्या दस्तावेज़ होती है। code के आधार पर शाखा बनाएँ: यही अनुबंध का स्थिर हिस्सा है, जबकि title और detail लोगों के लिए लिखे गए हैं और बदले जा सकते हैं। एक अपवाद ध्यान में रखें: जो URL किसी भी रूट से मेल नहीं खाता, उसका जवाब API नहीं बल्कि प्लेटफ़ॉर्म देता है, इसलिए ग़लत लिखे गए पथ पर भेजे गए प्रमाणित अनुरोध को सादे टेक्स्ट में 404 मिलता है — त्रुटि बॉडी पार्स करने से पहले कंटेंट-टाइप जाँच लें।

API केवल अंग्रेज़ी में है और Accept-Language को अनदेखा करता है। यह जानबूझकर है: जो त्रुटि संदेश वातावरण बदलने पर भाषा बदल दे, उसे खोजना आसान नहीं बल्कि कठिन हो जाता है। यह दस्तावेज़ अनूदित है; API नहीं।

हर प्रतिक्रिया में X-Request-Id होता है। समस्या बताते समय उसका उल्लेख करें — वही आपकी रिपोर्ट को हमारी लॉग पंक्ति से जोड़ता है।

{
  "type": "https://scoreboards.dev/errors/invalid-request",
  "title": "Invalid request",
  "status": 422,
  "detail": "team1_score, team2_score: not allowed on this request",
  "instance": "/v1/boards/board_1/matches",
  "code": "invalid_request",
  "request_id": "req_8f2a1c4d6b90"
}
कोडस्थितियह कब मिलता है
invalid_request400 · 413 · 422कोई बॉडी, क्वेरी पैरामीटर या कर्सर स्कीमा से मेल नहीं खाया; विवरण में ग़लत फ़ील्ड का नाम होता है। 64 KB से बड़ी बॉडी पर भी यही मिलता है।
authentication_failed401कुंजी अनुपस्थित, ग़लत रूप में, अज्ञात या रद्द की गई।
permission_denied403कुंजी के पास वह स्कोप नहीं है — या यह परीक्षण कुंजी है और स्कोप लेखन का है।
not_found404इस कुंजी के स्वामी के लिए ऐसा कोई बोर्ड, प्रविष्टि, मैच या handle नहीं है। किसी और का संसाधन और न मौजूद संसाधन एक जैसे दिखते हैं।
idempotency_conflict409वही Idempotency-Key अलग बॉडी के साथ दोबारा इस्तेमाल हुई, या वैसा ही अनुरोध अभी चल रहा है।
rate_limited429कोटा ख़त्म। Retry-After में दिए सेकंड तक प्रतीक्षा करें।
board_type_mismatch422एंडपॉइंट सही, बोर्ड ग़लत: मैच बोर्ड पर स्कोर भेजा गया, स्कोर बोर्ड पर मैच भेजा गया, या Rating बोर्ड पर कुछ भी भेजा गया।
team_size_mismatch422किसी पक्ष में बोर्ड का team_size ठीक-ठीक नहीं है — या निश्चित टीम वाले बोर्ड का पक्ष ठीक एक टीम के अलावा कुछ और बताता है।
duplicate_participant422वही प्रतिभागी दो बार आया है। जाँच आईडी हल होने के बाद होती है, इसलिए role_998877 और सादा snowflake 998877 एक ही इकाई गिने जाते हैं।
unknown_player422कोई प्रतिभागी अनुपयोगी है: 17 अंकों से छोटा snowflake, Discord सर्वर रहित बोर्ड पर कोई भूमिका, निश्चित टीमों के बिना बोर्ड पर कोई टीम, या custom: true के बिना भेजा गया कस्टम खिलाड़ी।
board_locked409बोर्ड अभी लेखन स्वीकार नहीं कर रहा।
internal_error500हमारी ओर से कुछ गड़बड़ हुआ। दोबारा कोशिश करें, और बार-बार हो तो request_id बताएँ।

दर सीमाएँ

प्रति कुंजी प्रति मिनट 600 पठन और 60 लेखन, दो अलग token bucket के रूप में — लेखन की झड़ी कभी उस पोलिंग का कोटा नहीं खा सकती जो उनके परिणाम की प्रतीक्षा कर रही है। बकेट लगातार भरते रहते हैं, इसलिए छोटी झड़ी चल जाती है और निरंतर दर मापी जाती है।

RateLimit-Reset अभी से कितने सेकंड, यह बताता है; X-RateLimit-Reset एक Unix टाइमस्टैम्प है। दोनों एक ही क्षण को अलग इकाइयों में बताते हैं, और एक को दूसरा समझ लेने पर क्लाइंट या तो API पर हथौड़े बरसाता है या दशकों तक सोता रहता है।

प्रमाणीकरण के बाद की हर प्रतिक्रिया पर दोनों हेडर परिवार भेजे जाते हैं।

हेडरविवरण
RateLimit-Limit

Requests allowed per minute for this key: 600 read, 60 write. Read and write quotas are separate buckets.

RateLimit-Remaining

Whole requests left in the current bucket.

RateLimit-Reset

DELTA-SECONDS until the quota is whole again. A duration, not a timestamp (IETF draft semantics).

X-RateLimit-Limit

Legacy spelling of RateLimit-Limit, same value.

X-RateLimit-Remaining

Legacy spelling of RateLimit-Remaining, same value.

X-RateLimit-Reset

The same instant as RateLimit-Reset, as a UNIX TIMESTAMP in seconds. Not a delay (legacy semantics).

Retry-After

Delta-seconds to wait before retrying. Sent on 429, and on the 409 that means an identical request is still in flight.

X-Request-Id

Correlation id for this request, echoed on every response including errors. An inbound X-Request-Id matching [A-Za-z0-9._-]{1,64} is honoured.

X-API-Lifecycle

Always beta today. Sent on EVERY /v1 response — including a 401 and a 404 — so a client learns the contract is provisional on its first call, without reading any documentation. The day it stops saying beta, the surface has been frozen and breaking changes will require a new version prefix; treat a change in this value as the signal to re-read the changelog.

Idempotent-Replayed

true when this response was replayed from a stored idempotency record rather than executed. Only set on POST responses.

कुछ छूट रहा है?

बताइए आप क्या बना रहे हैं। v0 जानबूझकर पठन और तीन लेखन मार्ग ही देता है — बोर्ड बनाना, सीज़न, बाहरी webhooks और मैच वापस लेना, सब तब तक टाले गए हैं जब तक कोई असली उपयोगकर्ता न माँगे, और वह माँग हमारी योजना से अधिक मूल्यवान है। बीटा पहुँच यहाँ नहीं माँगी जाती: वह आपके डैशबोर्ड के API सेक्शन में होती है।

हमारे Discord में पूछें