### List Folder Replays via GET Source: https://replay.mrhosthaxball.com/docs Retrieves a paginated list of replays within a specific folder, with optional sorting. ```bash curl "https://replay.mrhosthaxball.com/api/v1/folders/a1b2c3d4e5f6/replays?page=1&limit=10" \ -H "Authorization: Bearer mrr_your_token" ``` ```json { "success": true, "data": { "replays": [ { "replayId": "7a4fdd2cef6e", "title": "Colombia vs Brasil", "duration": 312.5, "scoreRed": 3, "scoreBlue": 2, "playerCount": 10, "folderId": "a1b2c3d4e5f6" } ], "total": 1, "page": 1, "limit": 10, "totalPages": 1 } } ``` -------------------------------- ### GET /folders Source: https://replay.mrhosthaxball.com/docs Lists all folders owned by the authenticated bot account. ```APIDOC ## GET /folders ### Description List all folders owned by the authenticated bot account. ### Method GET ### Endpoint https://replay.mrhosthaxball.com/api/v1/folders ### Request Example curl "https://replay.mrhosthaxball.com/api/v1/folders" \ -H "Authorization: Bearer mrr_your_token" ### Response #### Success Response (200) - **success** (boolean) - Indicates success. - **data** (object) - Contains folders list. - **folders** (array) - List of folder objects. - **folderId** (string) - Folder ID. - **name** (string) - Folder name. - **parentId** (string or null) - Parent folder ID. - **visibility** (string) - Visibility setting. - **color** (string or null) - Hex color code. - **iconUrl** (string or null) - Icon URL. - **createdAt** (string) - Creation timestamp. #### Response Example { "success": true, "data": { "folders": [ { "folderId": "a1b2c3d4e5f6", "name": "Tournament Replays", "parentId": null, "visibility": "public", "color": "#c9952a", "iconUrl": null, "createdAt": "2026-03-12T04:00:00.000Z" } ] } } ``` -------------------------------- ### GET /replays/:id/file Source: https://replay.mrhosthaxball.com/docs Download the original .hbr2 binary file. Returns the raw binary with Content-Disposition header for the original filename. ```APIDOC ## GET /replays/:id/file ### Description Download the original .hbr2 binary file. Returns the raw binary with Content-Disposition header for the original filename. ### Method GET ### Endpoint https://replay.mrhosthaxball.com/api/v1/replays/:id/file ### Parameters #### Path Parameters - **id** (string) - Required - 12-character hex replay or folder ID. ### Request Example curl -OJ "https://replay.mrhosthaxball.com/api/v1/replays/7a4fdd2cef6e/file" \ -H "Authorization: Bearer mrr_your_token" ### Response #### Success Response (200) - **body** (binary) - The raw .hbr2 file. - **Content-Type** (string) - application/octet-stream. - **Content-Disposition** (string) - attachment; filename="match.hbr2" #### Response Example Binary .hbr2 file Content-Type: application/octet-stream Content-Disposition: attachment; filename="match.hbr2" ``` -------------------------------- ### GET /replays Source: https://replay.mrhosthaxball.com/docs List all replays uploaded by the authenticated bot account. Supports pagination and sorting. ```APIDOC ## GET /replays ### Description List all replays uploaded by the authenticated bot account. Supports pagination and sorting. ### Method GET ### Endpoint https://replay.mrhosthaxball.com/api/v1/replays ### Parameters #### Query Parameters - **page** (integer) - Optional - Page number (default: 1). - **limit** (integer) - Optional - Results per page, 1-100 (default: 24). - **sort** (string) - Optional - newest, oldest, longest, shortest, most-viewed, most-liked. ### Request Example curl "https://replay.mrhosthaxball.com/api/v1/replays?page=1&limit=10&sort=newest" \ -H "Authorization: Bearer mrr_your_token" ### Response #### Success Response (200 OK) - **success** (boolean) - Indicates success. - **data** (object) - Contains replay list and pagination info. - **replays** (array) - List of replay objects. - **replayId** (string) - Unique replay ID. - **title** (string) - Replay title. - **visibility** (string) - Visibility setting. - **duration** (number) - Duration in seconds. - **scoreRed** (integer) - Red team score. - **scoreBlue** (integer) - Blue team score. - **playerCount** (integer) - Number of players. - **matchCount** (integer) - Number of matches. - **roomName** (string) - Room name. - **likeCount** (integer) - Number of likes. - **viewCount** (integer) - Number of views. - **createdAt** (string) - Creation timestamp. - **total** (integer) - Total number of replays. - **page** (integer) - Current page. - **limit** (integer) - Results per page. - **totalPages** (integer) - Total number of pages. #### Response Example { "success": true, "data": { "replays": [ { "replayId": "7a4fdd2cef6e", "title": "Colombia vs Brasil", "visibility": "public", "duration": 312.5, "scoreRed": 3, "scoreBlue": 2, "playerCount": 10, "matchCount": 1, "roomName": "🔴⚪🔵 MrHOST - 1 - Miami 🔵⚪🔴", "likeCount": 5, "viewCount": 42, "createdAt": "2026-03-12T04:00:00.000Z" } ], "total": 1, "page": 1, "limit": 10, "totalPages": 1 } } ``` -------------------------------- ### List Folders GET Request Source: https://replay.mrhosthaxball.com/docs Retrieves a list of all folders owned by the authenticated account. ```curl curl "https://replay.mrhosthaxball.com/api/v1/folders" \ -H "Authorization: Bearer mrr_your_token" ``` -------------------------------- ### GET /folders/:id/replays Source: https://replay.mrhosthaxball.com/docs Lists all replays inside a specific folder. Supports pagination and sorting. ```APIDOC ## GET /folders/:id/replays ### Description List all replays inside a specific folder. Supports pagination and sorting. ### Method GET ### Endpoint https://replay.mrhosthaxball.com/api/v1/folders/:id/replays ### Parameters #### Path Parameters - **id** (string) - Required - 12-character hex replay or folder ID. #### Query Parameters - **page** (integer) - Optional - Page number (default: 1). - **limit** (integer) - Optional - Results per page, 1-100 (default: 24). - **sort** (string) - Optional - newest, oldest, longest, shortest, most-viewed, most-liked. ### Request Example No request body required. ### Response #### Success Response (200) - **success** (boolean) - Indicates success. - **data** (object) - Contains replay list and pagination info. - **replays** (array) - List of replay objects. - **replayId** (string) - Replay ID. - **title** (string) - Replay title. - **duration** (number) - Duration in seconds. - **scoreRed** (integer) - Red team score. - **scoreBlue** (integer) - Blue team score. - **playerCount** (integer) - Number of players. - **folderId** (string) - Folder ID. - **total** (integer) - Total number of replays. - **page** (integer) - Current page. - **limit** (integer) - Results per page. - **totalPages** (integer) - Total number of pages. #### Response Example { "success": true, "data": { "replays": [ { "replayId": "7a4fdd2cef6e", "title": "Colombia vs Brasil", "duration": 312.5, "scoreRed": 3, "scoreBlue": 2, "playerCount": 10, "folderId": "a1b2c3d4e5f6" } ], "total": 1, "page": 1, "limit": 10, "totalPages": 1 } } ``` -------------------------------- ### GET /replays/:id/analysis Source: https://replay.mrhosthaxball.com/docs Get the full analysis data for a replay including player stats, goals, events, heatmaps, shotmaps, and chat messages. ```APIDOC ## GET /replays/:id/analysis ### Description Get the full analysis data for a replay including player stats, goals, events, heatmaps, shotmaps, and chat messages. ### Method GET ### Endpoint https://replay.mrhosthaxball.com/api/v1/replays/:id/analysis ### Parameters #### Path Parameters - **id** (string) - Required - 12-character hex replay or folder ID. ### Request Example curl "https://replay.mrhosthaxball.com/api/v1/replays/7a4fdd2cef6e/analysis" \ -H "Authorization: Bearer mrr_your_token" ### Response #### Success Response (200) - **success** (boolean) - Indicates if the request was successful. - **data** (object) - Contains analysis data. - **header** (object) - Header information with version, totalFrames, duration. - **playerList** (array) - List of players. - **matches** (array) - Array of match objects, each containing players, goals, heatmaps, shotmaps. - **chatMessages** (array) - Chat messages. - **events** (array) - Events. - **combined** (object) - Combined score information. #### Response Example { "success": true, "data": { "header": { "version": 3, "totalFrames": 18750, "duration": 312.5 }, "playerList": [...], "matches": [ { "players": [...], "goals": [...], "heatmaps": { "combined": "/api/replay/.../image/..." }, "shotmaps": { "combined": "/api/replay/.../image/..." } } ], "chatMessages": [...], "events": [...], "combined": { "scoreRed": 3, "scoreBlue": 2, ... } } } ``` -------------------------------- ### GET /replays/:id Source: https://replay.mrhosthaxball.com/docs Get full metadata for a specific replay. Private replays are only accessible by the owner. ```APIDOC ## GET /replays/:id ### Description Get full metadata for a specific replay. Private replays are only accessible by the owner. ### Method GET ### Endpoint https://replay.mrhosthaxball.com/api/v1/replays/:id ### Parameters #### Path Parameters - **id** (string) - Required - 12-character hex replay or folder ID. ### Request Example curl "https://replay.mrhosthaxball.com/api/v1/replays/7a4fdd2cef6e" \ -H "Authorization: Bearer mrr_your_token" ### Response #### Success Response (200) - **success** (boolean) - Indicates if the request was successful. - **data** (object) - Contains replay metadata. - **replayId** (string) - The replay ID. - **url** (string) - URL to the replay. - **title** (string) - Title of the replay. - **originalFileName** (string) - Original file name. - **visibility** (string) - Visibility status (e.g., public). - **duration** (number) - Duration in seconds. - **totalFrames** (number) - Total number of frames. - **scoreRed** (number) - Red team score. - **scoreBlue** (number) - Blue team score. - **playerCount** (number) - Number of players. - **matchCount** (number) - Number of matches. - **roomName** (string) - Room name. - **stadiumName** (string) - Stadium name. - **likeCount** (number) - Number of likes. - **viewCount** (number) - Number of views. - **createdAt** (string) - Creation timestamp. - **updatedAt** (string) - Last update timestamp. #### Response Example { "success": true, "data": { "replayId": "7a4fdd2cef6e", "url": "https://replay.mrhosthaxball.com/replay/7a4fdd2cef6e", "title": "Colombia vs Brasil", "originalFileName": "match.hbr2", "visibility": "public", "duration": 312.5, "totalFrames": 18750, "scoreRed": 3, "scoreBlue": 2, "playerCount": 10, "matchCount": 1, "roomName": "🔴⚪🔵 MrHOST - 1 - Miami 🔵⚪🔴", "stadiumName": "Futsal x3 by Hax", "likeCount": 5, "viewCount": 42, "createdAt": "2026-03-12T04:00:00.000Z", "updatedAt": "2026-03-12T04:00:00.000Z" } } ``` -------------------------------- ### Get Replay Metadata Response Source: https://replay.mrhosthaxball.com/docs The JSON response structure for a successful replay metadata retrieval. ```json { "success": true, "data": { "replayId": "7a4fdd2cef6e", "url": "https://replay.mrhosthaxball.com/replay/7a4fdd2cef6e", "title": "Colombia vs Brasil", "originalFileName": "match.hbr2", "visibility": "public", "duration": 312.5, "totalFrames": 18750, "scoreRed": 3, "scoreBlue": 2, "playerCount": 10, "matchCount": 1, "roomName": "🔴⚪🔵 MrHOST - 1 - Miami 🔵⚪🔴", "stadiumName": "Futsal x3 by Hax", "likeCount": 5, "viewCount": 42, "createdAt": "2026-03-12T04:00:00.000Z", "updatedAt": "2026-03-12T04:00:00.000Z" } } ``` -------------------------------- ### Get Replay Analysis Response Source: https://replay.mrhosthaxball.com/docs The JSON response structure for a successful replay analysis request. ```json { "success": true, "data": { "header": { "version": 3, "totalFrames": 18750, "duration": 312.5 }, "playerList": [...], "matches": [ { "players": [...], "goals": [...], "heatmaps": { "combined": "/api/replay/.../image/..." }, "shotmaps": { "combined": "/api/replay/.../image/..." } } ], "chatMessages": [...], "events": [...], "combined": { "scoreRed": 3, "scoreBlue": 2, ... } } } ``` -------------------------------- ### Get Replay Analysis Source: https://replay.mrhosthaxball.com/docs Retrieves comprehensive analysis data for a replay, including player stats, goals, events, heatmaps, shotmaps, and chat messages. ```bash curl "https://replay.mrhosthaxball.com/api/v1/replays/7a4fdd2cef6e/analysis" \ -H "Authorization: Bearer mrr_your_token" ``` -------------------------------- ### Get Replay Metadata Source: https://replay.mrhosthaxball.com/docs Retrieves full metadata for a specific replay using its 12-character hex ID. Private replays are restricted to the owner. ```bash curl "https://replay.mrhosthaxball.com/api/v1/replays/7a4fdd2cef6e" \ -H "Authorization: Bearer mrr_your_token" ``` -------------------------------- ### Create Folder POST Request Source: https://replay.mrhosthaxball.com/docs Creates a new folder for organizing replays. ```curl curl -X POST https://replay.mrhosthaxball.com/api/v1/folders \ -H "Authorization: Bearer mrr_your_token" \ -H "Content-Type: application/json" \ -d '{"name": "Tournament Replays", "visibility": "public"}' ``` -------------------------------- ### Create Folder Response Source: https://replay.mrhosthaxball.com/docs The JSON response containing the details of the newly created folder. ```json { "success": true, "data": { "folderId": "a1b2c3d4e5f6", "name": "Tournament Replays", "parentId": null, "visibility": "public", "color": null, "iconUrl": null, "createdAt": "2026-03-12T04:00:00.000Z", "updatedAt": "2026-03-12T04:00:00.000Z" } } ``` -------------------------------- ### POST /folders Source: https://replay.mrhosthaxball.com/docs Creates a new folder to organize replays. Supports nested folders via parentId, custom colors, and icon URLs. ```APIDOC ## POST /folders ### Description Create a new folder to organize replays. Supports nested folders via parentId, custom colors, and icon URLs. ### Method POST ### Endpoint https://replay.mrhosthaxball.com/api/v1/folders ### Parameters #### Request Body - **name** (string) - Required - Folder name (1-100 characters). - **parentId** (string) - Optional - Parent folder ID for nesting (12-char hex). Omit for root. - **visibility** (string) - Optional - "public" or "private". Defaults to "public". - **color** (string) - Optional - Hex color code (e.g. "#c9952a"). - **iconUrl** (string) - Optional - URL to folder icon image (http/https only, max 2048 chars). ### Request Example curl -X POST https://replay.mrhosthaxball.com/api/v1/folders \ -H "Authorization: Bearer mrr_your_token" \ -H "Content-Type: application/json" \ -d '{"name": "Tournament Replays", "visibility": "public"}' ### Response #### Success Response (201) - **success** (boolean) - Indicates success. - **data** (object) - Contains created folder details. - **folderId** (string) - Folder ID. - **name** (string) - Folder name. - **parentId** (string or null) - Parent folder ID. - **visibility** (string) - Visibility setting. - **color** (string or null) - Hex color code. - **iconUrl** (string or null) - Icon URL. - **createdAt** (string) - Creation timestamp. - **updatedAt** (string) - Last update timestamp. #### Response Example { "success": true, "data": { "folderId": "a1b2c3d4e5f6", "name": "Tournament Replays", "parentId": null, "visibility": "public", "color": null, "iconUrl": null, "createdAt": "2026-03-12T04:00:00.000Z", "updatedAt": "2026-03-12T04:00:00.000Z" } } ``` -------------------------------- ### POST /replays Source: https://replay.mrhosthaxball.com/docs Upload and analyze a .hbr2 replay file. The file is validated, analyzed for statistics, heatmaps, and shotmaps, then stored. Returns replay metadata on success. ```APIDOC ## POST /replays ### Description Upload and analyze a .hbr2 replay file. The file is validated (magic number, size, extension), analyzed for statistics, heatmaps, and shotmaps, then stored. Returns replay metadata on success. ### Method POST ### Endpoint https://replay.mrhosthaxball.com/api/v1/replays ### Parameters #### Form Data - **file** (File) - Required - .hbr2 replay file (max 10 MB) - **title** (string) - Optional - Replay title (max 200 chars). Defaults to filename. - **visibility** (string) - Optional - "public" or "private". Defaults to "public". - **teamRedName** (string) - Optional - Custom red team name (max 50 chars). - **teamBlueName** (string) - Optional - Custom blue team name (max 50 chars). - **teamRedLogoUrl** (string) - Optional - URL to red team logo image (http/https only). - **teamBlueLogoUrl** (string) - Optional - URL to blue team logo image (http/https only). - **folderId** (string) - Optional - 12-char hex folder ID to file the replay into. ### Request Example curl -X POST https://replay.mrhosthaxball.com/api/v1/replays \ -H "Authorization: Bearer mrr_your_token" \ -F "file=@match.hbr2" \ -F "title=Colombia vs Brasil" \ -F "visibility=public" ### Response #### Success Response (201 Created) - **success** (boolean) - Indicates success. - **data** (object) - Contains replay metadata. - **replayId** (string) - Unique replay ID. - **url** (string) - URL to the replay. - **title** (string) - Replay title. - **duration** (number) - Duration in seconds. - **scoreRed** (integer) - Red team score. - **scoreBlue** (integer) - Blue team score. - **playerCount** (integer) - Number of players. - **matchCount** (integer) - Number of matches. - **roomName** (string) - Room name. - **stadiumName** (string) - Stadium name. #### Response Example { "success": true, "data": { "replayId": "7a4fdd2cef6e", "url": "https://replay.mrhosthaxball.com/replay/7a4fdd2cef6e", "title": "Colombia vs Brasil", "duration": 312.5, "scoreRed": 3, "scoreBlue": 2, "playerCount": 10, "matchCount": 1, "roomName": "🔴⚪🔵 MrHOST - 1 - Miami 🔵⚪🔴", "stadiumName": "Futsal x3 by Hax" } } ``` -------------------------------- ### List Replays Request Source: https://replay.mrhosthaxball.com/docs List all replays uploaded by the authenticated bot account with support for pagination and sorting. ```bash curl "https://replay.mrhosthaxball.com/api/v1/replays?page=1&limit=10&sort=newest" \ -H "Authorization: Bearer mrr_your_token" ``` -------------------------------- ### Upload Replay Request Source: https://replay.mrhosthaxball.com/docs Upload and analyze a .hbr2 replay file using a POST request. The file is validated and analyzed for statistics upon upload. ```bash curl -X POST https://replay.mrhosthaxball.com/api/v1/replays \ -H "Authorization: Bearer mrr_your_token" \ -F "file=@match.hbr2" \ -F "title=Colombia vs Brasil" \ -F "visibility=public" ``` -------------------------------- ### Download Replay File Source: https://replay.mrhosthaxball.com/docs Downloads the original .hbr2 binary file. The response includes a Content-Disposition header for the original filename. ```bash curl -OJ "https://replay.mrhosthaxball.com/api/v1/replays/7a4fdd2cef6e/file" \ -H "Authorization: Bearer mrr_your_token" ``` -------------------------------- ### Download Replay File Response Source: https://replay.mrhosthaxball.com/docs The response headers and content type for a binary file download. ```text Binary .hbr2 file Content-Type: application/octet-stream Content-Disposition: attachment; filename="match.hbr2" ``` -------------------------------- ### List Folders Response Source: https://replay.mrhosthaxball.com/docs The JSON response containing the list of folders. ```json { "success": true, "data": { "folders": [ { "folderId": "a1b2c3d4e5f6", "name": "Tournament Replays", "parentId": null, "visibility": "public", "color": "#c9952a", "iconUrl": null, "createdAt": "2026-03-12T04:00:00.000Z" } ] } } ``` -------------------------------- ### POST /replays/batch-move Source: https://replay.mrhosthaxball.com/docs Moves multiple replays to a folder in a single request (max 50). Set folderId to null to unfile replays. ```APIDOC ## POST /replays/batch-move ### Description Move multiple replays to a folder in a single request (max 50). Set folderId to null to unfile replays. ### Method POST ### Endpoint https://replay.mrhosthaxball.com/api/v1/replays/batch-move ### Parameters #### Request Body - **replayIds** (string[]) - Required - Array of 1-50 replay IDs (12-char hex each). - **folderId** (string or null) - Required - 12-char hex folder ID to file the replay into. ### Request Example curl -X POST "https://replay.mrhosthaxball.com/api/v1/replays/batch-move" \ -H "Authorization: Bearer mrr_your_token" \ -H "Content-Type: application/json" \ -d '{"replayIds": ["7a4fdd2cef6e", "b2c3d4e5f6a7"], "folderId": "a1b2c3d4e5f6"}' ### Response #### Success Response (200) - **success** (boolean) - Indicates success. - **data** (object) - Contains modification details. - **modified** (number) - Number of replays moved. - **folderId** (string or null) - Target folder ID. #### Response Example { "success": true, "data": { "modified": 2, "folderId": "a1b2c3d4e5f6" } } ``` -------------------------------- ### List Replays Response Source: https://replay.mrhosthaxball.com/docs The 200 OK response returned when listing replays. ```json { "success": true, "data": { "replays": [ { "replayId": "7a4fdd2cef6e", "title": "Colombia vs Brasil", "visibility": "public", "duration": 312.5, "scoreRed": 3, "scoreBlue": 2, "playerCount": 10, "matchCount": 1, "roomName": "🔴⚪🔵 MrHOST - 1 - Miami 🔵⚪🔴", "likeCount": 5, "viewCount": 42, "createdAt": "2026-03-12T04:00:00.000Z" } ], "total": 1, "page": 1, "limit": 10, "totalPages": 1 } } ``` -------------------------------- ### POST /api/v1/replays Source: https://replay.mrhosthaxball.com/docs Uploads a HaxBall replay file (.hbr2) for analysis. The replay is automatically analyzed for statistics, heatmaps, shotmaps, player profiles, and chat messages. The response includes the full replay URL and match details. ```APIDOC ## POST /api/v1/replays ### Description Uploads a HaxBall replay file (.hbr2) for analysis. The replay is automatically analyzed for statistics, heatmaps, shotmaps, player profiles, and chat messages. The response includes the full replay URL and match details. ### Method POST ### Endpoint https://replay.mrhosthaxball.com/api/v1/replays ### Parameters #### Request Body - **file** (file) - Required - The HaxBall replay file (.hbr2) to upload. - **title** (string) - Required - The title of the replay. - **visibility** (string) - Required - The visibility of the replay (e.g., "public"). ### Request Example ```javascript const form = new FormData(); form.append("file", new Blob([recording]), "match.hbr2"); form.append("title", room.getRoomName() + " — " + new Date().toLocaleString()); form.append("visibility", "public"); fetch(API_URL, { method: "POST", headers: { Authorization: "Bearer " + TOKEN }, body: form, }) .then((res) => res.json()) .then((data) => { if (data.success) { const d = data.data; room.sendAnnouncement( "Replay: " + d.url + " | " + d.scoreRed + "-" + d.scoreBlue + " | " + d.playerCount + " players", null, 0xc9952a, "bold" ); } }) .catch(() => {}); ``` ### Response #### Success Response (200) - **success** (boolean) - Indicates if the upload was successful. - **data** (object) - Contains the uploaded replay data. - **url** (string) - The full replay URL. - **scoreRed** (number) - The red team's score. - **scoreBlue** (number) - The blue team's score. - **playerCount** (number) - The number of players in the replay. #### Response Example ```json { "success": true, "data": { "url": "https://replay.mrhosthaxball.com/replays/123", "scoreRed": 3, "scoreBlue": 2, "playerCount": 10 } } ``` ### Authentication Bearer token (SHA-256 hashed) required. Include in the Authorization header as "Bearer ". ``` -------------------------------- ### POST /folders/:id/icon Source: https://replay.mrhosthaxball.com/docs Uploads a binary image file as the folder's icon. Accepted formats: PNG, JPEG, WebP, GIF (max 2 MB). Replaces any existing icon. ```APIDOC ## POST /folders/:id/icon ### Description Upload a binary image file as the folder's icon. Accepted formats: PNG, JPEG, WebP, GIF (max 2 MB). Replaces any existing icon. ### Method POST ### Endpoint https://replay.mrhosthaxball.com/api/v1/folders/:id/icon ### Parameters #### Path Parameters - **id** (string) - Required - 12-character hex replay or folder ID. #### Form Data - **icon** (file) - Required - Image file (PNG, JPEG, WebP, or GIF, max 2 MB). ### Request Example Use multipart/form-data with the icon file. ### Response #### Success Response (201) - **success** (boolean) - Indicates success. - **data** (object) - Contains icon upload details. - **folderId** (string) - The folder ID. - **iconUrl** (string) - URL to the uploaded icon. #### Response Example { "success": true, "data": { "folderId": "a1b2c3d4e5f6", "iconUrl": "https://replay.mrhosthaxball.com/api/folder-icon/a1b2c3d4e5f6" } } ``` -------------------------------- ### Batch Move Replays POST Request Source: https://replay.mrhosthaxball.com/docs Moves multiple replays to a specified folder in a single request. ```curl curl -X POST "https://replay.mrhosthaxball.com/api/v1/replays/batch-move" \ -H "Authorization: Bearer mrr_your_token" \ -H "Content-Type: application/json" \ -d '{"replayIds": ["7a4fdd2cef6e", "b2c3d4e5f6a7"], "folderId": "a1b2c3d4e5f6"}' ``` -------------------------------- ### Upload Folder Icon via POST Source: https://replay.mrhosthaxball.com/docs Uploads a binary image file (PNG, JPEG, WebP, or GIF) as the folder icon. ```bash curl -X POST "https://replay.mrhosthaxball.com/api/v1/folders/a1b2c3d4e5f6/icon" \ -H "Authorization: Bearer mrr_your_token" \ -F "icon=@folder-icon.png" ``` ```json { "success": true, "data": { "folderId": "a1b2c3d4e5f6", "iconUrl": "https://replay.mrhosthaxball.com/api/folder-icon/a1b2c3d4e5f6" } } ``` -------------------------------- ### Upload Replay Response Source: https://replay.mrhosthaxball.com/docs The 201 Created response returned after a successful replay upload. ```json { "success": true, "data": { "replayId": "7a4fdd2cef6e", "url": "https://replay.mrhosthaxball.com/replay/7a4fdd2cef6e", "title": "Colombia vs Brasil", "duration": 312.5, "scoreRed": 3, "scoreBlue": 2, "playerCount": 10, "matchCount": 1, "roomName": "🔴⚪🔵 MrHOST - 1 - Miami 🔵⚪🔴", "stadiumName": "Futsal x3 by Hax" } } ``` -------------------------------- ### Batch Move Replays Response Source: https://replay.mrhosthaxball.com/docs The JSON response confirming the number of modified replays. ```json { "success": true, "data": { "modified": 2, "folderId": "a1b2c3d4e5f6" } } ``` -------------------------------- ### Upload HaxBall Replay from Headless Bot Source: https://replay.mrhosthaxball.com/docs Integrate this code into a HaxBall Headless bot to automatically record matches and upload them to the MrREPLAY API upon game completion. Requires an API token from the dashboard. ```javascript const API_URL = "https://replay.mrhosthaxball.com/api/v1/replays"; const TOKEN = "mrr_your_token"; room.onGameStart = function () { room.startRecording(); }; room.onGameStop = function () { const recording = room.stopRecording(); if (!recording) return; const form = new FormData(); form.append("file", new Blob([recording]), "match.hbr2"); form.append("title", room.getRoomName() + " — " + new Date().toLocaleString()); form.append("visibility", "public"); fetch(API_URL, { method: "POST", headers: { Authorization: "Bearer " + TOKEN }, body: form, }) .then((res) => res.json()) .then((data) => { if (data.success) { const d = data.data; room.sendAnnouncement( "Replay: " + d.url + " | " + d.scoreRed + "-" + d.scoreBlue + " | " + d.playerCount + " players", null, 0xc9952a, "bold" ); } }) .catch(() => {}); }; ``` -------------------------------- ### Authenticate API Request Source: https://replay.mrhosthaxball.com/docs All API requests require a Bearer token in the Authorization header. Tokens are generated in the API dashboard. ```bash curl https://replay.mrhosthaxball.com/api/v1/replays \ -H "Authorization: Bearer mrr_your_token_here" ``` -------------------------------- ### Update Replay Response Source: https://replay.mrhosthaxball.com/docs The JSON response returned after a successful replay update. ```json { "success": true, "data": { "replayId": "7a4fdd2cef6e", "url": "https://replay.mrhosthaxball.com/replay/7a4fdd2cef6e", "title": "Finals - Colombia vs Brasil", "visibility": "public", "duration": 312.5, "scoreRed": 3, "scoreBlue": 2, "playerCount": 10, "teamRedName": "Colombia", "teamBlueName": "Brasil", "folderId": null, "updatedAt": "2026-03-12T06:00:00.000Z" } } ``` -------------------------------- ### PATCH /replays/:id Source: https://replay.mrhosthaxball.com/docs Updates a replay's title, visibility, team names, logos, or folder assignment. Only send fields to change; set logo URLs to null to remove them. ```APIDOC ## PATCH /replays/:id ### Description Update a replay's title, visibility, team names, logos, or folder assignment. Only send the fields you want to change. Set logo URLs to null to remove them. ### Method PATCH ### Endpoint https://replay.mrhosthaxball.com/api/v1/replays/:id ### Parameters #### Path Parameters - **id** (string) - Required - 12-character hex replay or folder ID. #### Query Parameters - **title** (string) - Optional - Replay title (max 200 chars). Defaults to filename. - **visibility** (string) - Optional - "public" or "private". Defaults to "public". - **teamRedName** (string) - Optional - Custom red team name (max 50 chars). - **teamBlueName** (string) - Optional - Custom blue team name (max 50 chars). - **teamRedLogoUrl** (string) - Optional - URL to red team logo image (http/https only). - **teamBlueLogoUrl** (string) - Optional - URL to blue team logo image (http/https only). - **folderId** (string) - Optional - 12-char hex folder ID to file the replay into. ### Request Example curl -X PATCH "https://replay.mrhosthaxball.com/api/v1/replays/7a4fdd2cef6e" \ -H "Authorization: Bearer mrr_your_token" \ -H "Content-Type: application/json" \ -d '{"title": "Finals - Colombia vs Brasil", "visibility": "public"}' ### Response #### Success Response (200) - **success** (boolean) - Indicates success. - **data** (object) - Contains updated replay details. - **replayId** (string) - Replay ID. - **url** (string) - URL to the replay. - **title** (string) - Updated title. - **visibility** (string) - Visibility setting. - **duration** (number) - Duration in seconds. - **scoreRed** (number) - Red team score. - **scoreBlue** (number) - Blue team score. - **playerCount** (number) - Number of players. - **teamRedName** (string) - Red team name. - **teamBlueName** (string) - Blue team name. - **folderId** (string or null) - Folder ID if filed. - **updatedAt** (string) - Timestamp of update. #### Response Example { "success": true, "data": { "replayId": "7a4fdd2cef6e", "url": "https://replay.mrhosthaxball.com/replay/7a4fdd2cef6e", "title": "Finals - Colombia vs Brasil", "visibility": "public", "duration": 312.5, "scoreRed": 3, "scoreBlue": 2, "playerCount": 10, "teamRedName": "Colombia", "teamBlueName": "Brasil", "folderId": null, "updatedAt": "2026-03-12T06:00:00.000Z" } } ``` -------------------------------- ### Update Folder via PATCH Source: https://replay.mrhosthaxball.com/docs Updates folder properties like name, visibility, color, or icon. Only provided fields are modified. ```bash curl -X PATCH "https://replay.mrhosthaxball.com/api/v1/folders/a1b2c3d4e5f6" \ -H "Authorization: Bearer mrr_your_token" \ -H "Content-Type: application/json" \ -d '{"name": "Season 2 Finals", "visibility": "private"}' ``` ```json { "success": true, "data": { "folderId": "a1b2c3d4e5f6", "name": "Season 2 Finals", "parentId": null, "visibility": "private", "color": "#c9952a", "iconUrl": null, "createdAt": "2026-03-12T04:00:00.000Z", "updatedAt": "2026-03-12T05:00:00.000Z" } } ``` -------------------------------- ### CORS Source: https://replay.mrhosthaxball.com/docs All API responses include Access-Control-Allow-Origin: * headers, allowing calls from any domain, including browser-side JavaScript. ```APIDOC ## CORS All API responses include Access-Control-Allow-Origin: * headers. You can call the API from any domain, including browser-side JavaScript. ``` -------------------------------- ### Delete Folder via DELETE Source: https://replay.mrhosthaxball.com/docs Deletes a folder and its subfolders. Replays within the deleted folder are marked as unfiled. ```bash curl -X DELETE "https://replay.mrhosthaxball.com/api/v1/folders/a1b2c3d4e5f6" \ -H "Authorization: Bearer mrr_your_token" ``` ```json { "success": true, "data": { "deleted": true, "folderId": "a1b2c3d4e5f6", "foldersDeleted": 1 } } ``` -------------------------------- ### Update Replay PATCH Request Source: https://replay.mrhosthaxball.com/docs Updates replay metadata such as title or visibility using a PATCH request. ```curl curl -X PATCH "https://replay.mrhosthaxball.com/api/v1/replays/7a4fdd2cef6e" \ -H "Authorization: Bearer mrr_your_token" \ -H "Content-Type: application/json" \ -d '{"title": "Finals - Colombia vs Brasil", "visibility": "public"}' ```