{
    "openapi": "3.1.2",
    "info": {
        "title": "REST API",
        "version": "1.0"
    },
    "servers": [
        {
            "url": "https:\/\/api.bemvp.net\/"
        }
    ],
    "tags": [
        {
            "name": "Players"
        },
        {
            "name": "Games"
        },
        {
            "name": "Link kit"
        },
        {
            "name": "Account"
        }
    ],
    "security": [
        {
            "http": []
        }
    ],
    "paths": {
        "\/v1\/account": {
            "get": {
                "operationId": "account.show",
                "description": "The tariff, the delivery status with the suspension if there is one, the balance and, on the free tariff,\nthe page with the BeMVP link and its last check. Answers while deliveries are suspended, so an integration\n(the Flute module) can tell the site admin what is wrong.",
                "summary": "Get the partner's account",
                "tags": [
                    "Account"
                ],
                "responses": {
                    "200": {
                        "description": "`Account`",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "$ref": "#\/components\/schemas\/Account"
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#\/components\/responses\/AuthenticationException"
                    }
                }
            }
        },
        "\/v1\/players\/{steamId}\/games": {
            "get": {
                "operationId": "game.index",
                "summary": "List player games",
                "tags": [
                    "Games"
                ],
                "parameters": [
                    {
                        "name": "steamId",
                        "in": "path",
                        "required": true,
                        "description": "SteamID64",
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "page[size]",
                        "in": "query",
                        "schema": {
                            "type": "integer",
                            "default": 15
                        }
                    },
                    {
                        "name": "page[number]",
                        "in": "query",
                        "schema": {
                            "type": "integer",
                            "default": 1
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Paginated set of `Game`",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "$ref": "#\/components\/schemas\/Game"
                                            }
                                        },
                                        "links": {
                                            "type": "object",
                                            "properties": {
                                                "first": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "last": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "prev": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "next": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                }
                                            },
                                            "required": [
                                                "first",
                                                "last",
                                                "prev",
                                                "next"
                                            ]
                                        },
                                        "meta": {
                                            "type": "object",
                                            "properties": {
                                                "current_page": {
                                                    "type": "integer",
                                                    "minimum": 1
                                                },
                                                "from": {
                                                    "type": [
                                                        "integer",
                                                        "null"
                                                    ],
                                                    "minimum": 1
                                                },
                                                "last_page": {
                                                    "type": "integer",
                                                    "minimum": 1
                                                },
                                                "links": {
                                                    "type": "array",
                                                    "description": "Generated paginator links.",
                                                    "items": {
                                                        "type": "object",
                                                        "properties": {
                                                            "url": {
                                                                "type": [
                                                                    "string",
                                                                    "null"
                                                                ]
                                                            },
                                                            "label": {
                                                                "type": "string"
                                                            },
                                                            "active": {
                                                                "type": "boolean"
                                                            }
                                                        },
                                                        "required": [
                                                            "url",
                                                            "label",
                                                            "active"
                                                        ]
                                                    }
                                                },
                                                "path": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ],
                                                    "description": "Base path for paginator generated URLs."
                                                },
                                                "per_page": {
                                                    "type": "integer",
                                                    "description": "Number of items shown per page.",
                                                    "minimum": 0
                                                },
                                                "to": {
                                                    "type": [
                                                        "integer",
                                                        "null"
                                                    ],
                                                    "description": "Number of the last item in the slice.",
                                                    "minimum": 1
                                                },
                                                "total": {
                                                    "type": "integer",
                                                    "description": "Total number of items being paginated.",
                                                    "minimum": 0
                                                }
                                            },
                                            "required": [
                                                "current_page",
                                                "from",
                                                "last_page",
                                                "links",
                                                "path",
                                                "per_page",
                                                "to",
                                                "total"
                                            ]
                                        }
                                    },
                                    "required": [
                                        "data",
                                        "links",
                                        "meta"
                                    ]
                                }
                            }
                        }
                    },
                    "404": {
                        "$ref": "#\/components\/responses\/ModelNotFoundException"
                    },
                    "401": {
                        "$ref": "#\/components\/responses\/AuthenticationException"
                    },
                    "402": {
                        "description": "Deliveries are suspended: the balance does not cover the charges",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "description": "Error overview."
                                        },
                                        "reason": {
                                            "type": "string",
                                            "description": "Why the API is refused.",
                                            "enum": [
                                                "balance"
                                            ]
                                        }
                                    },
                                    "required": [
                                        "message",
                                        "reason"
                                    ]
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "No tariff is chosen, or deliveries are suspended: the BeMVP link is missing",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "description": "Error overview."
                                        },
                                        "reason": {
                                            "type": "string",
                                            "description": "Why the API is refused.",
                                            "enum": [
                                                "no_tariff",
                                                "no_link"
                                            ]
                                        }
                                    },
                                    "required": [
                                        "message",
                                        "reason"
                                    ]
                                }
                            }
                        }
                    }
                }
            }
        },
        "\/v1\/games\/{game}": {
            "get": {
                "operationId": "game.show",
                "summary": "Show game details",
                "tags": [
                    "Games"
                ],
                "parameters": [
                    {
                        "name": "game",
                        "in": "path",
                        "required": true,
                        "description": "The game ID",
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "`Game`",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "$ref": "#\/components\/schemas\/Game"
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                }
                            }
                        }
                    },
                    "404": {
                        "$ref": "#\/components\/responses\/ModelNotFoundException"
                    },
                    "401": {
                        "$ref": "#\/components\/responses\/AuthenticationException"
                    },
                    "402": {
                        "description": "Deliveries are suspended: the balance does not cover the charges",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "description": "Error overview."
                                        },
                                        "reason": {
                                            "type": "string",
                                            "description": "Why the API is refused.",
                                            "enum": [
                                                "balance"
                                            ]
                                        }
                                    },
                                    "required": [
                                        "message",
                                        "reason"
                                    ]
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "No tariff is chosen, or deliveries are suspended: the BeMVP link is missing",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "description": "Error overview."
                                        },
                                        "reason": {
                                            "type": "string",
                                            "description": "Why the API is refused.",
                                            "enum": [
                                                "no_tariff",
                                                "no_link"
                                            ]
                                        }
                                    },
                                    "required": [
                                        "message",
                                        "reason"
                                    ]
                                }
                            }
                        }
                    }
                }
            }
        },
        "\/v1\/link-kit": {
            "get": {
                "operationId": "linkKit.show",
                "description": "The ready links to bemvp.net with the partner's ref code: plain text, the logo and the badge, to the CS2 stats\nor to the home page. The free tariff requires one of them on the public page given in the cabinet. Answers\nwhile deliveries are suspended, so the link can be put back.",
                "summary": "Get the BeMVP link kit",
                "tags": [
                    "Link kit"
                ],
                "responses": {
                    "200": {
                        "description": "`LinkKit`",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "$ref": "#\/components\/schemas\/LinkKit"
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#\/components\/responses\/AuthenticationException"
                    }
                }
            }
        },
        "\/v1\/players": {
            "get": {
                "operationId": "player.index",
                "summary": "List players",
                "tags": [
                    "Players"
                ],
                "parameters": [
                    {
                        "name": "page[size]",
                        "in": "query",
                        "schema": {
                            "type": "integer",
                            "default": 15
                        }
                    },
                    {
                        "name": "page[number]",
                        "in": "query",
                        "schema": {
                            "type": "integer",
                            "default": 1
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Paginated set of `Player`",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "$ref": "#\/components\/schemas\/Player"
                                            }
                                        },
                                        "links": {
                                            "type": "object",
                                            "properties": {
                                                "first": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "last": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "prev": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "next": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                }
                                            },
                                            "required": [
                                                "first",
                                                "last",
                                                "prev",
                                                "next"
                                            ]
                                        },
                                        "meta": {
                                            "type": "object",
                                            "properties": {
                                                "current_page": {
                                                    "type": "integer",
                                                    "minimum": 1
                                                },
                                                "from": {
                                                    "type": [
                                                        "integer",
                                                        "null"
                                                    ],
                                                    "minimum": 1
                                                },
                                                "last_page": {
                                                    "type": "integer",
                                                    "minimum": 1
                                                },
                                                "links": {
                                                    "type": "array",
                                                    "description": "Generated paginator links.",
                                                    "items": {
                                                        "type": "object",
                                                        "properties": {
                                                            "url": {
                                                                "type": [
                                                                    "string",
                                                                    "null"
                                                                ]
                                                            },
                                                            "label": {
                                                                "type": "string"
                                                            },
                                                            "active": {
                                                                "type": "boolean"
                                                            }
                                                        },
                                                        "required": [
                                                            "url",
                                                            "label",
                                                            "active"
                                                        ]
                                                    }
                                                },
                                                "path": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ],
                                                    "description": "Base path for paginator generated URLs."
                                                },
                                                "per_page": {
                                                    "type": "integer",
                                                    "description": "Number of items shown per page.",
                                                    "minimum": 0
                                                },
                                                "to": {
                                                    "type": [
                                                        "integer",
                                                        "null"
                                                    ],
                                                    "description": "Number of the last item in the slice.",
                                                    "minimum": 1
                                                },
                                                "total": {
                                                    "type": "integer",
                                                    "description": "Total number of items being paginated.",
                                                    "minimum": 0
                                                }
                                            },
                                            "required": [
                                                "current_page",
                                                "from",
                                                "last_page",
                                                "links",
                                                "path",
                                                "per_page",
                                                "to",
                                                "total"
                                            ]
                                        }
                                    },
                                    "required": [
                                        "data",
                                        "links",
                                        "meta"
                                    ]
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#\/components\/responses\/AuthenticationException"
                    },
                    "402": {
                        "description": "Deliveries are suspended: the balance does not cover the charges",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "description": "Error overview."
                                        },
                                        "reason": {
                                            "type": "string",
                                            "description": "Why the API is refused.",
                                            "enum": [
                                                "balance"
                                            ]
                                        }
                                    },
                                    "required": [
                                        "message",
                                        "reason"
                                    ]
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "No tariff is chosen, or deliveries are suspended: the BeMVP link is missing",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "description": "Error overview."
                                        },
                                        "reason": {
                                            "type": "string",
                                            "description": "Why the API is refused.",
                                            "enum": [
                                                "no_tariff",
                                                "no_link"
                                            ]
                                        }
                                    },
                                    "required": [
                                        "message",
                                        "reason"
                                    ]
                                }
                            }
                        }
                    }
                }
            }
        },
        "\/v1\/players\/{steamId}": {
            "get": {
                "operationId": "player.show",
                "summary": "Show player details",
                "tags": [
                    "Players"
                ],
                "parameters": [
                    {
                        "name": "steamId",
                        "in": "path",
                        "required": true,
                        "description": "SteamID64",
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "`Player`",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "$ref": "#\/components\/schemas\/Player"
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                }
                            }
                        }
                    },
                    "404": {
                        "$ref": "#\/components\/responses\/ModelNotFoundException"
                    },
                    "401": {
                        "$ref": "#\/components\/responses\/AuthenticationException"
                    },
                    "402": {
                        "description": "Deliveries are suspended: the balance does not cover the charges",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "description": "Error overview."
                                        },
                                        "reason": {
                                            "type": "string",
                                            "description": "Why the API is refused.",
                                            "enum": [
                                                "balance"
                                            ]
                                        }
                                    },
                                    "required": [
                                        "message",
                                        "reason"
                                    ]
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "No tariff is chosen, or deliveries are suspended: the BeMVP link is missing",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "description": "Error overview."
                                        },
                                        "reason": {
                                            "type": "string",
                                            "description": "Why the API is refused.",
                                            "enum": [
                                                "no_tariff",
                                                "no_link"
                                            ]
                                        }
                                    },
                                    "required": [
                                        "message",
                                        "reason"
                                    ]
                                }
                            }
                        }
                    }
                }
            },
            "put": {
                "operationId": "player.upsert",
                "summary": "Create or update a player",
                "tags": [
                    "Players"
                ],
                "parameters": [
                    {
                        "name": "steamId",
                        "in": "path",
                        "required": true,
                        "description": "SteamID64",
                        "schema": {
                            "type": "integer",
                            "minimum": 76561197960265729,
                            "maximum": 76561202255233023
                        }
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application\/json": {
                            "schema": {
                                "$ref": "#\/components\/schemas\/UpsertPlayerRequest"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "`Player`",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "$ref": "#\/components\/schemas\/Player"
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "An error",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "description": "Error overview.",
                                            "examples": [
                                                "Too many players verified with Steam in the last hour. Retry later."
                                            ]
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "503": {
                        "description": "An error\n\nService unavailable",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "anyOf": [
                                        {
                                            "type": "object",
                                            "properties": {
                                                "message": {
                                                    "type": "string",
                                                    "description": "Error overview.",
                                                    "examples": [
                                                        "Steam API is temporarily unavailable, so the player cannot be verified. Retry later."
                                                    ]
                                                }
                                            },
                                            "required": [
                                                "message"
                                            ]
                                        },
                                        {
                                            "type": "object",
                                            "properties": {
                                                "message": {
                                                    "type": "string",
                                                    "description": "Error overview."
                                                }
                                            },
                                            "required": [
                                                "message"
                                            ]
                                        }
                                    ]
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#\/components\/responses\/AuthenticationException"
                    },
                    "422": {
                        "$ref": "#\/components\/responses\/ValidationException"
                    },
                    "402": {
                        "description": "Deliveries are suspended: the balance does not cover the charges",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "description": "Error overview."
                                        },
                                        "reason": {
                                            "type": "string",
                                            "description": "Why the API is refused.",
                                            "enum": [
                                                "balance"
                                            ]
                                        }
                                    },
                                    "required": [
                                        "message",
                                        "reason"
                                    ]
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "No tariff is chosen, or deliveries are suspended: the BeMVP link is missing",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "description": "Error overview."
                                        },
                                        "reason": {
                                            "type": "string",
                                            "description": "Why the API is refused.",
                                            "enum": [
                                                "no_tariff",
                                                "no_link"
                                            ]
                                        }
                                    },
                                    "required": [
                                        "message",
                                        "reason"
                                    ]
                                }
                            }
                        }
                    }
                }
            },
            "delete": {
                "operationId": "player.destroy",
                "summary": "Delete a player",
                "tags": [
                    "Players"
                ],
                "parameters": [
                    {
                        "name": "steamId",
                        "in": "path",
                        "required": true,
                        "description": "SteamID64",
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "204": {
                        "description": "No content"
                    },
                    "404": {
                        "$ref": "#\/components\/responses\/ModelNotFoundException"
                    },
                    "401": {
                        "$ref": "#\/components\/responses\/AuthenticationException"
                    }
                }
            }
        }
    },
    "components": {
        "securitySchemes": {
            "http": {
                "type": "http",
                "scheme": "bearer"
            }
        },
        "schemas": {
            "Account": {
                "type": "object",
                "properties": {
                    "tariff": {
                        "anyOf": [
                            {
                                "description": "Null until the partner chooses a tariff in the cabinet.\n| |\n|---|\n| `free` <br\/> A visible BeMVP link on the partner's public page, players public on bemvp.net. No charges. |\n| `paid` <br\/> Prepaid balance: a charge per unique game and per active player-day. |\n| `internal` <br\/> bemvp.net and the owner's own accounts: never charged, never suspended, set only in the admin panel. |",
                                "$ref": "#\/components\/schemas\/Tariff"
                            },
                            {
                                "type": "null"
                            }
                        ]
                    },
                    "delivery_status": {
                        "description": "`active` and `warned` deliver webhooks and answer the API; `delivery_stopped` holds webhooks but keeps\ncollecting games; `collecting_stopped` and `no_tariff` collect nothing.",
                        "$ref": "#\/components\/schemas\/DeliveryStatus"
                    },
                    "suspension": {
                        "type": [
                            "object",
                            "null"
                        ],
                        "description": "Null when the partner is not suspended.",
                        "properties": {
                            "reason": {
                                "anyOf": [
                                    {
                                        "$ref": "#\/components\/schemas\/SuspensionReason"
                                    },
                                    {
                                        "type": "null"
                                    }
                                ]
                            },
                            "suspended_at": {
                                "type": [
                                    "string",
                                    "null"
                                ],
                                "format": "date-time"
                            },
                            "delivery_stops_at": {
                                "type": [
                                    "string",
                                    "null"
                                ],
                                "format": "date-time",
                                "description": "When webhooks stop: at once for `balance`, after the grace days for `no_link`."
                            },
                            "collecting_stops_at": {
                                "type": [
                                    "string",
                                    "null"
                                ],
                                "format": "date-time",
                                "description": "When polling of the partner's players stops."
                            }
                        },
                        "required": [
                            "reason",
                            "suspended_at",
                            "delivery_stops_at",
                            "collecting_stops_at"
                        ]
                    },
                    "balance": {
                        "type": "object",
                        "description": "Amounts in kopecks. Bonus money is spent first.",
                        "properties": {
                            "real": {
                                "type": "integer",
                                "examples": [
                                    12345
                                ]
                            },
                            "bonus": {
                                "type": "integer",
                                "examples": [
                                    3000
                                ]
                            },
                            "total": {
                                "type": "integer",
                                "examples": [
                                    15345
                                ]
                            },
                            "currency": {
                                "type": "string",
                                "examples": [
                                    "RUB"
                                ]
                            }
                        },
                        "required": [
                            "real",
                            "bonus",
                            "total",
                            "currency"
                        ]
                    },
                    "link": {
                        "type": [
                            "object",
                            "null"
                        ],
                        "description": "The page that must show the BeMVP link. Set only on the free tariff.",
                        "properties": {
                            "page_url": {
                                "type": [
                                    "string",
                                    "null"
                                ],
                                "examples": [
                                    "https:\/\/cs2zombies.ru\/"
                                ]
                            },
                            "last_check": {
                                "type": [
                                    "object",
                                    "null"
                                ],
                                "description": "Null until the page is checked for the first time.",
                                "properties": {
                                    "outcome": {
                                        "$ref": "#\/components\/schemas\/LinkCheckOutcome"
                                    },
                                    "checked_at": {
                                        "type": "string",
                                        "format": "date-time"
                                    }
                                },
                                "required": [
                                    "outcome",
                                    "checked_at"
                                ]
                            }
                        },
                        "required": [
                            "page_url",
                            "last_check"
                        ]
                    },
                    "ref_code": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "description": "The partner's code in the `ref` query parameter of the BeMVP links, null until the link kit is first\nopened.",
                        "examples": [
                            "k7m2x9qa"
                        ]
                    }
                },
                "required": [
                    "tariff",
                    "delivery_status",
                    "suspension",
                    "balance",
                    "link",
                    "ref_code"
                ],
                "title": "Account"
            },
            "DeliveryStatus": {
                "type": "string",
                "description": "Where the partner is in the suspension. Computed from the timestamps on the partner's row, so the phases follow one another without a scheduled job: Active \u2192 (suspension starts) \u2192 Warned for the grace days of the reason \u2192 DeliveryStopped for `billing.suspension.collecting_days` \u2192 CollectingStopped, until the reason is fixed and everything resumes.  | status            | webhooks | API   | polling of the partner's players | |-------------------|----------|-------|----------------------------------| | Active, Warned    | sent     | works | yes                              | | DeliveryStopped   | held     | error | yes, games are collected         | | CollectingStopped | held     | error | no, data is kept                 | | NoTariff          | held     | error | no                               |\n",
                "enum": [
                    "active",
                    "warned",
                    "delivery_stopped",
                    "collecting_stopped",
                    "no_tariff"
                ],
                "title": "DeliveryStatus"
            },
            "Game": {
                "type": "object",
                "properties": {
                    "id": {
                        "type": "string",
                        "description": "UUID of the game at our system",
                        "examples": [
                            "550e8400-e29b-41d4-a716-446655440000"
                        ]
                    },
                    "state": {
                        "type": "string",
                        "examples": [
                            "parsed"
                        ]
                    },
                    "map": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "examples": [
                            "de_dust2"
                        ]
                    },
                    "duration": {
                        "type": [
                            "integer",
                            "null"
                        ],
                        "description": "Match duration in seconds",
                        "examples": [
                            1200
                        ]
                    },
                    "score_team1": {
                        "type": [
                            "integer",
                            "null"
                        ],
                        "description": "Team 1 score",
                        "examples": [
                            16
                        ]
                    },
                    "score_team2": {
                        "type": [
                            "integer",
                            "null"
                        ],
                        "description": "Team 2 score",
                        "examples": [
                            14
                        ]
                    },
                    "demo_url": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "description": "Demo URL",
                        "examples": [
                            "http:\/\/replay274.valve.net\/730\/003770878548122796482_2018491851.dem.bz2"
                        ]
                    },
                    "players": {
                        "type": "array",
                        "items": {
                            "$ref": "#\/components\/schemas\/GamePlayer"
                        }
                    },
                    "played_at": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "description": "Datetime in ISO 8601 format",
                        "examples": [
                            "2025-02-08T08:35:57.000000Z"
                        ]
                    },
                    "created_at": {
                        "type": "string",
                        "description": "Datetime in ISO 8601 format",
                        "examples": [
                            "2025-02-08T08:35:57.000000Z"
                        ]
                    },
                    "updated_at": {
                        "type": "string",
                        "description": "Datetime in ISO 8601 format",
                        "examples": [
                            "2025-02-08T08:35:57.000000Z"
                        ]
                    },
                    "game_mode": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "description": "Matchmaking mode detected by the demo parser: \"premier\" and \"competitive\" are 5\u00d75, \"wingman\" is 2\u00d72.\n\"unknown\" when the parser could not tell the mode. Null for games parsed before 2026-11-29 and games\nthat are not parsed yet. More values may be added: treat an unfamiliar one as \"unknown\".",
                        "enum": [
                            "premier",
                            "competitive",
                            "wingman",
                            "casual",
                            "unknown",
                            null
                        ],
                        "examples": [
                            "premier"
                        ]
                    },
                    "rounds": {
                        "type": [
                            "integer",
                            "null"
                        ],
                        "description": "Rounds played in the match: score_team1 + score_team2. Null while either score is unknown.",
                        "examples": [
                            23
                        ]
                    }
                },
                "required": [
                    "id",
                    "state",
                    "map",
                    "duration",
                    "score_team1",
                    "score_team2",
                    "demo_url",
                    "players",
                    "played_at",
                    "created_at",
                    "updated_at",
                    "game_mode",
                    "rounds"
                ],
                "title": "Game"
            },
            "GamePlayer": {
                "type": "object",
                "properties": {
                    "steam_id": {
                        "type": "integer",
                        "description": "SteamID64",
                        "examples": [
                            76561197960265728
                        ]
                    },
                    "nickname": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "description": "Player game nickname",
                        "examples": [
                            "player | myproject"
                        ]
                    },
                    "team": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "description": "Player team\nPossible values: \"team1\", \"team2\"",
                        "examples": [
                            "team1"
                        ]
                    },
                    "kills": {
                        "type": [
                            "integer",
                            "null"
                        ],
                        "description": "Number of kills",
                        "examples": [
                            15
                        ]
                    },
                    "deaths": {
                        "type": [
                            "integer",
                            "null"
                        ],
                        "description": "Number of deaths",
                        "examples": [
                            10
                        ]
                    },
                    "assists": {
                        "type": [
                            "integer",
                            "null"
                        ],
                        "description": "Number of assists",
                        "examples": [
                            5
                        ]
                    },
                    "mvps": {
                        "type": [
                            "integer",
                            "null"
                        ],
                        "description": "Number of MVPs",
                        "examples": [
                            3
                        ]
                    },
                    "headshots": {
                        "type": [
                            "integer",
                            "null"
                        ],
                        "description": "Number of headshots",
                        "examples": [
                            7
                        ]
                    },
                    "score": {
                        "type": [
                            "integer",
                            "null"
                        ],
                        "description": "Player score",
                        "examples": [
                            42
                        ]
                    },
                    "clan_tag": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "description": "Clan tag shown next to the nickname in the match. Null when the player had no tag, and for games parsed\nbefore 2026-11-29 (their game_mode is null).",
                        "examples": [
                            "BeMVP"
                        ]
                    },
                    "connected_rounds": {
                        "type": [
                            "integer",
                            "null"
                        ],
                        "description": "In how many rounds the player was in the game at the end of freeze time. Null for games parsed before\n2026-11-29.",
                        "examples": [
                            23
                        ]
                    },
                    "rank": {
                        "type": [
                            "object",
                            "null"
                        ],
                        "description": "Matchmaking rank of the player, null when the demo has no rank data for them. mode: \"premier\" (value is\nthe CS Rating), \"competitive\" (value is the skill group 0..18, 0 = no rank), \"wingman\" (value is the\nWingman skill group) or \"unknown\" (a rank type the platform does not know). value is the rank before the\nmatch, value_after the rank reported at its end, wins the number of wins in this mode (for competitive,\non this map).",
                        "examples": [
                            {
                                "mode": "premier",
                                "value": 18750,
                                "value_after": 18802,
                                "wins": 312
                            }
                        ],
                        "properties": {
                            "mode": {
                                "type": "string",
                                "enum": [
                                    "premier",
                                    "competitive",
                                    "wingman",
                                    "unknown"
                                ]
                            },
                            "value": {
                                "type": [
                                    "integer",
                                    "null"
                                ]
                            },
                            "value_after": {
                                "type": [
                                    "integer",
                                    "null"
                                ]
                            },
                            "wins": {
                                "type": [
                                    "integer",
                                    "null"
                                ]
                            }
                        },
                        "required": [
                            "mode",
                            "value",
                            "value_after",
                            "wins"
                        ]
                    },
                    "finished": {
                        "type": [
                            "boolean",
                            "null"
                        ],
                        "description": "Whether the player finished the match: true when connected_rounds >= rounds of the game\n(score_team1 + score_team2), false when fewer. Null while either number is unknown. A player who left\nearly, joined late or missed rounds while reconnecting gets false.",
                        "examples": [
                            true
                        ]
                    }
                },
                "required": [
                    "steam_id",
                    "nickname",
                    "team",
                    "kills",
                    "deaths",
                    "assists",
                    "mvps",
                    "headshots",
                    "score",
                    "clan_tag",
                    "connected_rounds",
                    "rank",
                    "finished"
                ],
                "title": "GamePlayer"
            },
            "LinkCheckOutcome": {
                "type": "string",
                "description": "What one look at the partner's page showed.\n| |\n|---|\n| `found` <br\/> The page has a visible link to bemvp.net. |\n| `missing` <br\/> The page loaded as 2xx HTML and has no visible link to bemvp.net. |\n| `unreachable` <br\/> The page could not be judged: a network error or timeout, a non-2xx answer, not HTML, an anti-bot challenge, or an address we do not open. Never counts as a missing link on its own. |",
                "enum": [
                    "found",
                    "missing",
                    "unreachable"
                ],
                "title": "LinkCheckOutcome"
            },
            "LinkKit": {
                "type": "object",
                "properties": {
                    "ref_code": {
                        "type": "string",
                        "description": "The partner's code in the `ref` query parameter of every link. Stable: it never changes.",
                        "examples": [
                            "k7m2x9qa"
                        ]
                    },
                    "links": {
                        "type": "array",
                        "description": "Every variant for every target.",
                        "items": {
                            "$ref": "#\/components\/schemas\/LinkKitLink"
                        }
                    }
                },
                "required": [
                    "ref_code",
                    "links"
                ],
                "title": "LinkKit"
            },
            "LinkKitLink": {
                "type": "object",
                "properties": {
                    "variant": {
                        "description": "How the link looks: plain text, the logo or the badge. \u00ablight\u00bb and \u00abdark\u00bb name the background\nof the page the image is made for.\n| |\n|---|\n| `text` <br\/> Plain text: takes the font and the colour of the partner's site. |\n| `logo_light` <br\/> The BeMVP logo with dark text, for a light background. |\n| `logo_dark` <br\/> The BeMVP logo with light text, for a dark background. |\n| `badge_light` <br\/> The badge \u00ab\u0421\u0442\u0430\u0442\u0438\u0441\u0442\u0438\u043a\u0430 CS2 \u00b7 BeMVP\u00bb on a light plate. |\n| `badge_dark` <br\/> The badge \u00ab\u0421\u0442\u0430\u0442\u0438\u0441\u0442\u0438\u043a\u0430 CS2 \u00b7 BeMVP\u00bb on a dark plate. |",
                        "examples": [
                            "badge_dark"
                        ],
                        "$ref": "#\/components\/schemas\/LinkVariant"
                    },
                    "target": {
                        "description": "Where the link leads: the CS2 stats or the home page of bemvp.net.\n| |\n|---|\n| `stats` <br\/> The CS2 stats on bemvp.net. |\n| `home` <br\/> The bemvp.net home page. |",
                        "examples": [
                            "stats"
                        ],
                        "$ref": "#\/components\/schemas\/LinkTarget"
                    },
                    "url": {
                        "type": "string",
                        "description": "The target with the partner's ref code.",
                        "examples": [
                            "https:\/\/bemvp.net\/ru\/stats?ref=k7m2x9qa"
                        ]
                    },
                    "image_url": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "description": "The image of the link, null for the text link.",
                        "examples": [
                            "https:\/\/partners.bemvp.net\/link-kit\/badge-dark.png"
                        ]
                    },
                    "html": {
                        "type": "string",
                        "description": "The ready HTML to put on the page as is.",
                        "examples": [
                            "<a href=\"https:\/\/bemvp.net\/ru\/stats?ref=k7m2x9qa\" rel=\"nofollow\" target=\"_blank\"><img src=\"https:\/\/partners.bemvp.net\/link-kit\/badge-dark.png\" alt=\"\u0421\u0442\u0430\u0442\u0438\u0441\u0442\u0438\u043a\u0430 CS2 \u043d\u0430 BeMVP\" width=\"160\" height=\"52\"><\/a>"
                        ]
                    }
                },
                "required": [
                    "variant",
                    "target",
                    "url",
                    "image_url",
                    "html"
                ],
                "title": "LinkKitLink"
            },
            "LinkTarget": {
                "type": "string",
                "description": "Where a link of the kit leads.\n| |\n|---|\n| `stats` <br\/> The CS2 stats on bemvp.net. |\n| `home` <br\/> The bemvp.net home page. |",
                "enum": [
                    "stats",
                    "home"
                ],
                "title": "LinkTarget"
            },
            "LinkVariant": {
                "type": "string",
                "description": "How a link of the kit looks. \u00abLight\u00bb and \u00abdark\u00bb name the background of the partner's page the image is made for.\n| |\n|---|\n| `text` <br\/> Plain text: takes the font and the colour of the partner's site. |\n| `logo_light` <br\/> The BeMVP logo with dark text, for a light background. |\n| `logo_dark` <br\/> The BeMVP logo with light text, for a dark background. |\n| `badge_light` <br\/> The badge \u00ab\u0421\u0442\u0430\u0442\u0438\u0441\u0442\u0438\u043a\u0430 CS2 \u00b7 BeMVP\u00bb on a light plate. |\n| `badge_dark` <br\/> The badge \u00ab\u0421\u0442\u0430\u0442\u0438\u0441\u0442\u0438\u043a\u0430 CS2 \u00b7 BeMVP\u00bb on a dark plate. |",
                "enum": [
                    "text",
                    "logo_light",
                    "logo_dark",
                    "badge_light",
                    "badge_dark"
                ],
                "title": "LinkVariant"
            },
            "Player": {
                "type": "object",
                "properties": {
                    "state": {
                        "type": "string",
                        "examples": [
                            "active"
                        ]
                    },
                    "auth_code": {
                        "type": "string",
                        "examples": [
                            "1FT2-LK9NE-640G"
                        ]
                    },
                    "last_known_code": {
                        "type": "string",
                        "description": "The most recent processed match sharing code. Partners tracking the same steam_id and auth_code\nshare it, so it may be newer than the code sent with the player.",
                        "examples": [
                            "CSGO-GADqf-jjyJ8-cSP2r-smZRo-TO2xK"
                        ]
                    },
                    "steam_id": {
                        "type": "integer",
                        "description": "SteamID64",
                        "examples": [
                            76561197960265728
                        ]
                    },
                    "created_at": {
                        "type": "string",
                        "description": "Datetime in ISO 8601 format",
                        "examples": [
                            "2025-02-08T08:35:57.000000Z"
                        ]
                    },
                    "updated_at": {
                        "type": "string",
                        "description": "Datetime in ISO 8601 format",
                        "examples": [
                            "2025-02-08T08:35:57.000000Z"
                        ]
                    }
                },
                "required": [
                    "state",
                    "auth_code",
                    "last_known_code",
                    "steam_id",
                    "created_at",
                    "updated_at"
                ],
                "title": "Player"
            },
            "SuspensionReason": {
                "type": "string",
                "description": "Why the partner's deliveries are suspended. The suspension is one state whatever the reason, see {@see DeliveryStatus}.\n| |\n|---|\n| `balance` <br\/> A charge did not go through: delivery stops at once. |\n| `no_link` <br\/> The BeMVP link is missing from the partner's page: delivery stops after a grace period. |",
                "enum": [
                    "balance",
                    "no_link"
                ],
                "title": "SuspensionReason"
            },
            "Tariff": {
                "type": "string",
                "description": "What the partner pays with. Chosen in the cabinet before the first API token and kept on the partner's account, not on the token.\n| |\n|---|\n| `free` <br\/> A visible BeMVP link on the partner's public page, players public on bemvp.net. No charges. |\n| `paid` <br\/> Prepaid balance: a charge per unique game and per active player-day. |\n| `internal` <br\/> bemvp.net and the owner's own accounts: never charged, never suspended, set only in the admin panel. |",
                "enum": [
                    "free",
                    "paid",
                    "internal"
                ],
                "title": "Tariff"
            },
            "UpsertPlayerRequest": {
                "type": "object",
                "properties": {
                    "auth_code": {
                        "type": "string",
                        "pattern": "^[A-Za-z0-9]{4}-[A-Za-z0-9]{5}-[A-Za-z0-9]{4}$",
                        "examples": [
                            "1FT2-LK9NE-640G"
                        ]
                    },
                    "last_known_code": {
                        "type": "string",
                        "description": "The match sharing code you want to start tracking from",
                        "pattern": "^CSGO(-[ABCDEFGHJKLMNOPQRSTUVWXYZabcdefhijkmnopqrstuvwxyz23456789]{5}){5}$",
                        "examples": [
                            "CSGO-GADqf-jjyJ8-cSP2r-smZRo-TO2xK"
                        ]
                    }
                },
                "required": [
                    "auth_code",
                    "last_known_code"
                ],
                "title": "UpsertPlayerRequest"
            }
        },
        "responses": {
            "AuthenticationException": {
                "description": "Unauthenticated",
                "content": {
                    "application\/json": {
                        "schema": {
                            "type": "object",
                            "properties": {
                                "message": {
                                    "type": "string",
                                    "description": "Error overview."
                                }
                            },
                            "required": [
                                "message"
                            ]
                        }
                    }
                }
            },
            "ModelNotFoundException": {
                "description": "Not found",
                "content": {
                    "application\/json": {
                        "schema": {
                            "type": "object",
                            "properties": {
                                "message": {
                                    "type": "string",
                                    "description": "Error overview."
                                }
                            },
                            "required": [
                                "message"
                            ]
                        }
                    }
                }
            },
            "ValidationException": {
                "description": "Validation error",
                "content": {
                    "application\/json": {
                        "schema": {
                            "type": "object",
                            "properties": {
                                "message": {
                                    "type": "string",
                                    "description": "Errors overview."
                                },
                                "errors": {
                                    "type": "object",
                                    "description": "A detailed description of each field that failed validation.",
                                    "additionalProperties": {
                                        "type": "array",
                                        "items": {
                                            "type": "string"
                                        }
                                    }
                                }
                            },
                            "required": [
                                "message",
                                "errors"
                            ]
                        }
                    }
                }
            }
        }
    }
}