Skip to content

rework api.md and add public facing endpoints - #4833

Open
ryanbarlow97 wants to merge 13 commits into
mainfrom
updateapi
Open

rework api.md and add public facing endpoints#4833
ryanbarlow97 wants to merge 13 commits into
mainfrom
updateapi

Conversation

@ryanbarlow97

Copy link
Copy Markdown
Contributor

Description:

better document player facing endpoints

Please complete the following:

  • I have added screenshots for all UI updates
  • I process any text displayed to the user through translateText() and I've added it to the en.json file
  • I have added relevant tests to the test directory

Please put your Discord username so you can be contacted if a bug or regression is found:

w.o.n

@ryanbarlow97 ryanbarlow97 added this to the v33 milestone Aug 2, 2026
@ryanbarlow97 ryanbarlow97 self-assigned this Aug 2, 2026
Copilot AI review requested due to automatic review settings August 2, 2026 17:45
@ryanbarlow97
ryanbarlow97 requested a review from a team as a code owner August 2, 2026 17:45
@ryanbarlow97 ryanbarlow97 added the approved Approved for a PR, if you assigned to the issue. label Aug 2, 2026
@coderabbitai

coderabbitai Bot commented Aug 2, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review

Walkthrough

The legacy API guide was replaced with a comprehensive reference. It documents HTTP conventions, authentication, public and authenticated endpoints, account and commerce operations, and matchmaking WebSocket behavior.

Changes

API reference documentation

Layer / File(s) Summary
API conventions and authentication
docs/API.md
Adds base URLs, headers, response formats, pagination rules, session actions, OAuth, magic-link, platform-login, and Google-linking documentation.
Public and social endpoint contracts
docs/API.md
Documents public game, player, clan, feed, health, asset, friend, and authenticated clan operations, including validation, permissions, pagination, and mutation errors.
Account, commerce, and matchmaking contracts
docs/API.md
Documents account updates, rewards, purchases, subscriptions, billing portals, and matchmaking WebSocket messages and failure codes.

Estimated code review effort: 2 (Simple) | ~15 minutes

Poem

Endpoints line up,
Tokens open session doors,
Clans share their state,
Rewards fill the shop,
Matches join the stream.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Title check ✅ Passed The title clearly identifies the API documentation rewrite and addition of public-facing endpoints.
Description check ✅ Passed The description states that the pull request improves documentation for player-facing endpoints.

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@docs/API.md`:
- Around line 1425-1428: Update the WebSocket close-code documentation near the
existing policy and verification codes to describe replacement behavior: when
the same JWT connects through a newer socket, close the previous socket with
code 1000 and reason "Replaced by newer connection", and state that only the
newest socket remains active.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: ae088b55-74e7-4483-a0b2-c12a51f6a4d8

📥 Commits

Reviewing files that changed from the base of the PR and between 753c66e and 319b61f.

📒 Files selected for processing (1)
  • docs/API.md

Comment thread docs/API.md Outdated

This comment was marked as resolved.

chatgpt-codex-connector[bot]

This comment was marked as resolved.

chatgpt-codex-connector[bot]

This comment was marked as resolved.

coderabbitai[bot]
coderabbitai Bot previously approved these changes Aug 2, 2026
chatgpt-codex-connector[bot]

This comment was marked as resolved.

coderabbitai[bot]
coderabbitai Bot previously approved these changes Aug 2, 2026
chatgpt-codex-connector[bot]

This comment was marked as resolved.

coderabbitai[bot]
coderabbitai Bot previously approved these changes Aug 2, 2026
chatgpt-codex-connector[bot]

This comment was marked as resolved.

coderabbitai[bot]
coderabbitai Bot previously approved these changes Aug 2, 2026
@ryanbarlow97 ryanbarlow97 changed the title rework and add public facing endpoints rework api.md and add public facing endpoints Aug 2, 2026
chatgpt-codex-connector[bot]

This comment was marked as resolved.

coderabbitai[bot]
coderabbitai Bot previously approved these changes Aug 2, 2026
chatgpt-codex-connector[bot]

This comment was marked as resolved.

coderabbitai[bot]
coderabbitai Bot previously approved these changes Aug 2, 2026

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: f830d0ea44

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread docs/API.md
Comment on lines +167 to +168
- aggregated stats, including wins, losses, total games, and nested
FFA/team/Humans-vs-Nations/ranked counters

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Remove the nonexistent Humans-vs-Nations stats bucket

Integrations cannot retrieve the advertised Humans-vs-Nations counters from this response: PlayerStatsTreeSchema allows the public/private/singleplayer trees to contain only the Free For All and Team modes, while ranked statistics are split into 1v1 and 2v2; there is no Humans-vs-Nations leaf. Clients modeled on this description may therefore look for a bucket that valid profiles never expose.

Useful? React with 👍 / 👎.

Comment thread docs/API.md
Comment on lines +409 to +410
"accountUsername": "Player",
"username": "Player"

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Do not promise username in ranked entries

A ranked response is not required to contain this username field: RankedLeaderboardEntrySchema defines accountUsername and public_id but deliberately drops the legacy username, and the canonical leaderboard fixtures omit it. The shipped list also falls back directly from accountUsername to public_id, so integrations relying on this documented fallback can receive undefined; remove the field or mark it as non-contractual legacy data.

Useful? React with 👍 / 👎.

Comment thread docs/API.md
Comment on lines +3 to +5
This is the public HTTP and WebSocket API exposed by the OpenFront API
worker. It documents endpoints intended for the game client, public websites,
and player integrations. It is kept aligned with the route registry and

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Document the matchmaking WebSocket

This claims to document the public WebSocket API used by the game client, but the reference contains no WebSocket route at all. The shipped ranked flow in src/client/Matchmaking.ts connects to /matchmaking/join with instance_id and mode, then authenticates through an initial JWT-bearing message, and tests/matchmaking treats that handshake as the integration contract; omitting it leaves integrations unable to reproduce the game's matchmaking flow.

Useful? React with 👍 / 👎.

Comment thread docs/API.md
Comment on lines +181 to 183
Returns the player's recorded sessions. A result has this shape:

```json
{
"results": [
{

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Show the sessions response array

The endpoint returns a list of recorded sessions, but this example shows only a bare session object and never defines the top-level response as an array. An integration modeled on the example can attempt to parse the wire response as one object, or invent a results envelope like the neighboring game-history endpoint, so wrap the item in the actual array response.

Useful? React with 👍 / 👎.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Approved for a PR, if you assigned to the issue.

Projects

Status: Development

Development

Successfully merging this pull request may close these issues.

2 participants