# GENERATED by cmd/tools/openapi-merge from admin-base.yaml + admin-*.yaml — edit those, not this.
components:
    parameters:
        Actor:
            description: |
                The admin making the change: required on POST/PUT/DELETE, optional on GET.
                At most 128 letters, digits, spaces and `@._+-:`. Recorded in the audit log as
                `integration:<client>:<actor>`.
            in: header
            name: X-Actor
            required: false
            schema:
                example: jane@yourplatform.com
                maxLength: 128
                type: string
        SiteId:
            description: A site the key holds (see GET /sites).
            in: path
            name: siteId
            required: true
            schema:
                example: brand-a
                type: string
    responses:
        Error:
            content:
                application/json:
                    schema:
                        $ref: '#/components/schemas/ErrorEnvelope'
            description: An error envelope.
    schemas:
        BetBuilder:
            properties:
                enabled:
                    type: boolean
                inherited:
                    description: The site has no policy of its own
                    type: boolean
                marginPerLeg:
                    type: number
                maxLegs:
                    type: integer
                maxOdd:
                    type: number
                minOdd:
                    type: number
                tolerance:
                    type: number
                updatedAt:
                    format: date-time
                    type:
                        - string
                        - "null"
            type: object
        BetBuilderInput:
            additionalProperties: false
            properties:
                enabled:
                    type: boolean
                marginPerLeg:
                    maximum: 0.25
                    minimum: 0
                    type: number
                maxLegs:
                    maximum: 30
                    minimum: 2
                    type: integer
                maxOdd:
                    description: Above minOdd
                    maximum: 100000
                    type: number
                minOdd:
                    maximum: 1000
                    minimum: 1.01
                    type: number
                tolerance:
                    maximum: 0.2
                    minimum: 0
                    type: number
            required:
                - enabled
                - marginPerLeg
                - maxLegs
                - minOdd
                - maxOdd
                - tolerance
            type: object
        BetDelayLevel:
            description: market = market type id; default requires entityId 0.
            enum:
                - market
                - tournament
                - category
                - sport
                - default
            type: string
        BetDelayRequest:
            additionalProperties: false
            properties:
                delayMs:
                    description: Omitted = 0.
                    maximum: 60000
                    minimum: 0
                    type: integer
                entityId:
                    description: '> 0; exactly 0 for level=default.'
                    format: int64
                    minimum: 0
                    type: integer
                level:
                    $ref: '#/components/schemas/BetDelayLevel'
            required:
                - level
                - entityId
                - delayMs
            type: object
        BetDelayRule:
            properties:
                delayMs:
                    example: 5000
                    maximum: 60000
                    minimum: 0
                    type: integer
                entityId:
                    example: 1
                    format: int64
                    type: integer
                level:
                    $ref: '#/components/schemas/BetDelayLevel'
                siteId:
                    description: '"" for platform rules.'
                    example: site-42
                    type: string
            required:
                - siteId
                - level
                - entityId
                - delayMs
            type: object
        BetDelays:
            properties:
                platform:
                    items:
                        $ref: '#/components/schemas/BetDelayRule'
                    type: array
                site:
                    items:
                        $ref: '#/components/schemas/BetDelayRule'
                    type: array
            required:
                - site
                - platform
            type: object
        BetTypeReport:
            properties:
                betType:
                    enum:
                        - single
                        - combo
                        - system
                        - betbuilder
                    type: string
                currency:
                    type: string
                ggr:
                    type: number
                payout:
                    type: number
                stake:
                    type: number
                tickets:
                    type: integer
            required:
                - betType
                - currency
                - tickets
                - stake
                - payout
                - ggr
            type: object
        BonusTemplate:
            properties:
                createdAt:
                    format: date-time
                    type: string
                currency:
                    example: EUR
                    type: string
                id:
                    example: "4"
                    type: string
                minOddLimit:
                    example: "1.3"
                    type: string
                name:
                    example: Combi boost EUR
                    type: string
                siteId:
                    example: site-42
                    type: string
                tiers:
                    items:
                        $ref: '#/components/schemas/BonusTier'
                    type: array
                updatedAt:
                    format: date-time
                    type: string
            required:
                - id
                - siteId
                - name
                - currency
                - minOddLimit
                - tiers
                - createdAt
                - updatedAt
            type: object
        BonusTemplateRequest:
            additionalProperties: false
            properties:
                createdAt:
                    description: Tolerated, ignored.
                    type: string
                currency:
                    description: 3 letters; must be one of the site's currencies.
                    example: EUR
                    type: string
                id:
                    description: Tolerated, ignored.
                    type: string
                minOddLimit:
                    allOf:
                        - $ref: '#/components/schemas/Decimal'
                    description: 1 … 1000, at most 4 decimals.
                name:
                    maxLength: 100
                    minLength: 1
                    type: string
                siteId:
                    description: Tolerated, ignored (path site wins).
                    type: string
                siteName:
                    description: Tolerated, ignored.
                    type: string
                tiers:
                    description: Bands must not overlap.
                    items:
                        $ref: '#/components/schemas/BonusTierRequest'
                    maxItems: 50
                    minItems: 1
                    type: array
                updatedAt:
                    description: Tolerated, ignored.
                    type: string
            required:
                - name
                - currency
                - minOddLimit
                - tiers
            type: object
        BonusTier:
            properties:
                bonus:
                    description: Payout multiplier.
                    example: "1.05"
                    type: string
                firstMatchCount:
                    example: 3
                    type: integer
                id:
                    example: "11"
                    type: string
                lastMatchCount:
                    example: 4
                    type: integer
            required:
                - id
                - firstMatchCount
                - lastMatchCount
                - bonus
            type: object
        BonusTierRequest:
            additionalProperties: false
            properties:
                bonus:
                    allOf:
                        - $ref: '#/components/schemas/Decimal'
                    description: 0 … 100, at most 4 decimals.
                firstMatchCount:
                    maximum: 100
                    minimum: 0
                    type: integer
                id:
                    description: Tolerated, ignored (tiers are replaced).
                    type: string
                lastMatchCount:
                    description: '>= firstMatchCount.'
                    maximum: 100
                    minimum: 0
                    type: integer
            required:
                - firstMatchCount
                - lastMatchCount
                - bonus
            type: object
        CashoutOffer:
            properties:
                available:
                    type: boolean
                reason:
                    type: string
                time:
                    type: string
                value:
                    type: number
            required:
                - time
                - value
                - available
                - reason
            type: object
        CashoutPolicy:
            properties:
                autoEnabled:
                    type: boolean
                coefficient:
                    description: Share of fair value paid; null = inherit platformCoefficient. Stored value (after clamping).
                    example: 0.97
                    type:
                        - number
                        - "null"
                coefficientMax:
                    example: 0.98
                    readOnly: true
                    type: number
                coefficientMin:
                    example: 0.9
                    readOnly: true
                    type: number
                enabled:
                    description: Site kill switch for all cashout.
                    type: boolean
                liveDelaySeconds:
                    type: integer
                minPartialValue:
                    description: 0 = no minimum.
                    type: number
                partialEnabled:
                    type: boolean
                platformCoefficient:
                    example: 0.95
                    readOnly: true
                    type: number
                platformEnabled:
                    description: false = cashout off on every site.
                    readOnly: true
                    type: boolean
                siteId:
                    type: string
            required:
                - siteId
                - enabled
                - partialEnabled
                - autoEnabled
                - coefficient
                - minPartialValue
                - liveDelaySeconds
                - platformCoefficient
                - coefficientMin
                - coefficientMax
                - platformEnabled
            type: object
        CashoutPolicyInput:
            additionalProperties: false
            description: Full replacement — send every field.
            properties:
                autoEnabled:
                    type: boolean
                coefficient:
                    description: null = inherit; otherwise in (0, 1], then clamped into [coefficientMin, coefficientMax].
                    exclusiveMinimum: 0
                    maximum: 1
                    type:
                        - number
                        - "null"
                enabled:
                    type: boolean
                liveDelaySeconds:
                    minimum: 0
                    type: integer
                minPartialValue:
                    minimum: 0
                    type: number
                partialEnabled:
                    type: boolean
            required:
                - enabled
                - partialEnabled
                - autoEnabled
                - coefficient
                - minPartialValue
                - liveDelaySeconds
            type: object
        CatalogCategory:
            allOf:
                - $ref: '#/components/schemas/CatalogSport'
                - properties:
                    sportId:
                        example: 1
                        format: int64
                        type:
                            - integer
                            - "null"
                  required:
                    - sportId
                  type: object
        CatalogSport:
            properties:
                enabled:
                    description: false = hidden from players on every site.
                    type: boolean
                featured:
                    type: boolean
                id:
                    example: 1
                    format: int64
                    type: integer
                name:
                    description: Default (English) name.
                    example: Football
                    type: string
                slug:
                    description: '"" when unset.'
                    example: football
                    type: string
                sortOrder:
                    description: 0 when unset.
                    type: integer
            required:
                - id
                - name
                - slug
                - enabled
                - featured
                - sortOrder
            type: object
        CatalogTournament:
            allOf:
                - $ref: '#/components/schemas/CatalogSport'
                - properties:
                    categoryId:
                        example: 795
                        format: int64
                        type:
                            - integer
                            - "null"
                  required:
                    - categoryId
                  type: object
        ClientSites:
            properties:
                client:
                    example: yourplatform
                    type: string
                scopes:
                    description: Sorted.
                    items:
                        type: string
                    type: array
                sites:
                    items:
                        $ref: '#/components/schemas/SiteInfo'
                    type: array
            required:
                - client
                - scopes
                - sites
            type: object
        CurrencyReport:
            properties:
                currency:
                    type: string
                ggr:
                    type: number
                margin:
                    description: Percent.
                    type: number
                open:
                    type: integer
                payout:
                    description: WON potentialWin + VOID stake; cashed-out tickets count 0.
                    type: number
                sites:
                    items:
                        $ref: '#/components/schemas/SiteReport'
                    type: array
                stake:
                    type: number
                tickets:
                    type: integer
            required:
                - currency
                - stake
                - payout
                - ggr
                - margin
                - tickets
                - open
                - sites
            type: object
        DailyPoint:
            properties:
                date:
                    description: UTC day.
                    example: "2026-11-19"
                    format: date
                    type: string
                ggr:
                    type: number
                open:
                    type: integer
                payout:
                    type: number
                stake:
                    type: number
                tickets:
                    type: integer
            required:
                - date
                - stake
                - payout
                - ggr
                - tickets
                - open
            type: object
        Decimal:
            description: Decimal, sent preferably as a string ("1.25"). Responses always use strings.
            oneOf:
                - pattern: ^-?[0-9]+(\.[0-9]+)?$
                  type: string
                - type: number
        DisplayOverride:
            properties:
                disabled:
                    type: boolean
                entityId:
                    format: int64
                    type: integer
                entityType:
                    enum:
                        - sport
                        - category
                        - tournament
                        - match
                        - market
                    type: string
                siteId:
                    type: string
                updatedAt:
                    format: date-time
                    type: string
            type: object
        EnumValue:
            properties:
                code:
                    description: The numeric code
                    type: integer
                    where the value is stored or sent as a number.: null
                label:
                    description: English label
                    type: string
                    where there is one.: null
                value:
                    description: The wire value.
                    type: string
            required:
                - value
            type: object
        Enums:
            description: |
                ticketStatuses 0 PENDING, 1 WALLET_FAILED, 2 OPEN, 3 SETTLING, 4 WON, 5 LOST,
                6 CANCELLED, 7 ROLLBACK_PENDING, 8 CASHED_OUT (label CASHOUT), 9 VOID ·
                betTypes 0 single, 1 combo, 2 system, 3 betbuilder · selectionStatuses 0 OPEN,
                1 WON, 2 LOST, 3 POSTPONED, 4 CANCELLED · matchStatuses 0 PREMATCH, 1 LIVE,
                2 SUSPENDED, 3 ENDED, 4 SETTLED, 5 ARCHIVED, 6 CANCELLED, 7 POSTPONED ·
                marketStatuses 0 ACTIVE, 1 SUSPENDED, 2 CLOSED, 3 SETTLED · channels iframe ·
                betDelayLevels default, sport, category, tournament, market · riskNodeLevels
                sport, category, tournament · riskRejectCodes 50152 cannot_play_bet,
                50111 below_min_bet_size, 50112 above_max_bet_size, 50001 no_limit_data,
                50188 stake_exceeds_max, 50128 below_min_stake, 50110 payout_exceeds_max,
                50197 payout_exceeds_combination · scopes (value + label).
            properties:
                betDelayLevels:
                    items:
                        $ref: '#/components/schemas/EnumValue'
                    type: array
                betTypes:
                    items:
                        $ref: '#/components/schemas/EnumValue'
                    type: array
                channels:
                    items:
                        $ref: '#/components/schemas/EnumValue'
                    type: array
                marketStatuses:
                    items:
                        $ref: '#/components/schemas/EnumValue'
                    type: array
                matchStatuses:
                    items:
                        $ref: '#/components/schemas/EnumValue'
                    type: array
                riskNodeLevels:
                    items:
                        $ref: '#/components/schemas/EnumValue'
                    type: array
                riskRejectCodes:
                    items:
                        $ref: '#/components/schemas/EnumValue'
                    type: array
                scopes:
                    items:
                        $ref: '#/components/schemas/EnumValue'
                    type: array
                selectionStatuses:
                    items:
                        $ref: '#/components/schemas/EnumValue'
                    type: array
                ticketStatuses:
                    items:
                        $ref: '#/components/schemas/EnumValue'
                    type: array
            required:
                - ticketStatuses
                - betTypes
                - selectionStatuses
                - matchStatuses
                - marketStatuses
                - channels
                - betDelayLevels
                - riskNodeLevels
                - riskRejectCodes
                - scopes
            type: object
        Envelope:
            properties:
                code:
                    const: ok
                    type: string
                data:
                    description: The payload; its schema is given per operation.
                meta:
                    properties:
                        total:
                            description: Unpaged count of a list.
                            type: integer
                    type: object
                success:
                    const: true
                    type: boolean
            required:
                - success
                - code
                - data
            type: object
        ErrorEnvelope:
            properties:
                code:
                    description: Stable machine code — branch on this.
                    examples:
                        - integration.invalid_key
                        - integration.missing_scope
                        - integration.site_not_allowed
                        - integration.actor_required
                        - validation.bad_body
                        - not_found
                        - db_unavailable
                        - internal_error
                    type: string
                data:
                    type: "null"
                error:
                    description: English message for logs; not stable.
                    type: string
                success:
                    const: false
                    type: boolean
            required:
                - success
                - code
                - error
                - data
            type: object
        FeaturedEvent:
            properties:
                featured:
                    description: true = pinned
                    false = excluded: null
                    type: boolean
                match:
                    oneOf:
                        - $ref: '#/components/schemas/Match'
                        - type: "null"
                matchId:
                    format: int64
                    type: integer
                sortOrder:
                    type:
                        - integer
                        - "null"
                updatedAt:
                    format: date-time
                    type: string
            type: object
        FeaturedEventInput:
            additionalProperties: false
            properties:
                featured:
                    type: boolean
                sortOrder:
                    maximum: 10000
                    minimum: 0
                    type:
                        - integer
                        - "null"
            required:
                - featured
            type: object
        FrontendVersion:
            properties:
                latest:
                    type: boolean
                publishedAt:
                    format: date-time
                    type: string
                remoteEntry:
                    example: https://core.oddyne.com/lib/v/0.1.0-aa8de86/remoteEntry.js
                    format: uri
                    type: string
                version:
                    example: 0.1.0-aa8de86
                    type: string
            type: object
        GroupPlayer:
            properties:
                canPlayBet:
                    type: boolean
                currency:
                    type: string
                externalRef:
                    type: string
            type: object
        LaunchKey:
            properties:
                apiKey:
                    description: The new player launch key — shown only this once.
                    example: sk_3q2-Vb7xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
                    type: string
            required:
                - apiKey
            type: object
        LaunchKeyStatus:
            properties:
                hasApiKey:
                    type: boolean
            required:
                - hasApiKey
            type: object
        LimitSide:
            description: null = no limit at this level
            properties:
                maxPayout:
                    minimum: 0
                    type:
                        - number
                        - "null"
                maxStake:
                    minimum: 0
                    type:
                        - number
                        - "null"
                minStake:
                    minimum: 0
                    type:
                        - number
                        - "null"
            type: object
        ListMeta:
            properties:
                total:
                    description: Total matching rows (ignoring limit/offset on paged lists).
                    type: integer
            type: object
        LiveBet:
            properties:
                liveBetEnabled:
                    type: boolean
            required:
                - liveBetEnabled
            type: object
        LiveBetInput:
            additionalProperties: false
            properties:
                liveBetEnabled:
                    description: Required — an absent value is refused (422)
                    never read as false.: null
                    type: boolean
            required:
                - liveBetEnabled
            type: object
        MarketDisplayNameRequest:
            additionalProperties: false
            properties:
                displayName:
                    description: Non-empty = override; null or "" = clear.
                    type:
                        - string
                        - "null"
            type: object
        MarketGroupSport:
            properties:
                markets:
                    description: Number of market types the sport offers.
                    example: 412
                    type: integer
                name:
                    example: Soccer
                    type: string
                sportId:
                    example: 1
                    format: int64
                    type: integer
            required:
                - sportId
                - name
                - markets
            type: object
        MarketSetting:
            properties:
                displayName:
                    description: '"" = no override.'
                    type: string
                enabled:
                    description: false = hidden on the site (display only).
                    type: boolean
                marketType:
                    example: 18
                    format: int64
                    type: integer
                settings:
                    description: Layout document managed by Oddyne; {} for config-only rows. Read-only here.
                    type: object
                siteId:
                    example: site-42
                    type: string
            required:
                - siteId
                - marketType
                - enabled
                - displayName
                - settings
            type: object
        MarketTypeView:
            properties:
                enabled:
                    description: What the site offers (platform AND site)
                    type: boolean
                marketName:
                    type: string
                marketType:
                    format: int64
                    type: integer
                platformEnabled:
                    type: boolean
                siteDisplayName:
                    type: string
                siteEnabled:
                    description: The site's override; null = none
                    type:
                        - boolean
                        - "null"
            type: object
        Match:
            properties:
                awayName:
                    example: Chelsea
                    type: string
                categoryName:
                    example: England
                    type: string
                homeName:
                    example: Arsenal
                    type: string
                id:
                    description: 'Our match id. 64-bit: parse big-int-safe in JavaScript.'
                    example: 41893377
                    format: int64
                    type: integer
                isLive:
                    description: status == 1.
                    type: boolean
                mapped:
                    type: boolean
                platformEnabled:
                    description: false = hidden from players on every site.
                    type: boolean
                refId:
                    description: Provider reference; "" when none.
                    example: sr:match:41893377
                    type: string
                source:
                    description: Provider the match is mapped from; "" when unmapped.
                    type: string
                sportName:
                    example: Football
                    type: string
                startTime:
                    description: 0001-01-01T00:00:00Z when unknown.
                    format: date-time
                    type: string
                status:
                    description: A matchStatuses code.
                    maximum: 7
                    minimum: 0
                    type: integer
                tournamentName:
                    example: Premier League
                    type: string
            required:
                - id
                - refId
                - source
                - sportName
                - categoryName
                - tournamentName
                - homeName
                - awayName
                - startTime
                - status
                - isLive
                - mapped
                - platformEnabled
            type: object
        MatchDetail:
            allOf:
                - $ref: '#/components/schemas/Match'
                - properties:
                    markets:
                        items:
                            $ref: '#/components/schemas/MatchMarket'
                        type: array
                  required:
                    - markets
                  type: object
        MatchMarket:
            properties:
                marketId:
                    description: A 64-bit hash, often above 2^53 — parse as a big integer.
                    example: -8775457417276844928
                    format: int64
                    type: integer
                marketName:
                    description: Default English name with the line filled in.
                    type: string
                outcomes:
                    items:
                        $ref: '#/components/schemas/MatchOutcome'
                    type: array
            required:
                - marketId
                - marketName
                - outcomes
            type: object
        MatchOutcome:
            properties:
                odd:
                    description: RAW price — no site margin.
                    type: number
                outcomeId:
                    format: int64
                    type: integer
                outcomeName:
                    type: string
            required:
                - outcomeId
                - outcomeName
                - odd
            type: object
        MatchReport:
            properties:
                currency:
                    type: string
                eventId:
                    type: string
                lastBetAt:
                    format: date-time
                    type: string
                open:
                    type: integer
                payout:
                    type: number
                profit:
                    description: stake − payout.
                    type: number
                siteId:
                    type: string
                stake:
                    description: Overlaps between matches.
                    type: number
                tickets:
                    type: integer
            required:
                - eventId
                - siteId
                - currency
                - tickets
                - stake
                - payout
                - profit
                - open
                - lastBetAt
            type: object
        PlayerReport:
            properties:
                avgStake:
                    type: number
                currency:
                    type: string
                ggr:
                    type: number
                lastBetAt:
                    format: date-time
                    type: string
                margin:
                    description: Percent.
                    type: number
                open:
                    type: integer
                payout:
                    type: number
                player:
                    type: string
                siteId:
                    type: string
                stake:
                    type: number
                tickets:
                    type: integer
            required:
                - player
                - siteId
                - currency
                - tickets
                - open
                - stake
                - payout
                - ggr
                - margin
                - avgStake
                - lastBetAt
            type: object
        PlayerRisk:
            properties:
                canPlayBet:
                    type: boolean
                currency:
                    type: string
                effectiveRiskGroupId:
                    description: The player's group
                    else the partner's: null
                    type:
                        - string
                        - "null"
                externalRef:
                    type: string
                known:
                    description: A player row exists
                    type: boolean
                partnerId:
                    type:
                        - string
                        - "null"
                riskGroupId:
                    type:
                        - string
                        - "null"
                siteId:
                    type: string
            type: object
        PlayerRiskInput:
            additionalProperties: false
            properties:
                canPlayBet:
                    type: boolean
                riskGroupId:
                    description: A risk group of this site
                    or null to clear: null
                    type:
                        - string
                        - integer
                        - "null"
            required:
                - riskGroupId
                - canPlayBet
            type: object
        ResolvedSelection:
            allOf:
                - $ref: '#/components/schemas/TicketSelection'
                - description: Names are absent when they cannot be resolved (e.g. the match left the recent window).
                  properties:
                    market:
                        example: 1x2
                        type: string
                    match:
                        example: Arsenal - Chelsea
                        type: string
                    outcome:
                        example: Arsenal
                        type: string
                    startTime:
                        format: date-time
                        type: string
                    tournament:
                        example: Premier League
                        type: string
                  type: object
        RiskGroup:
            properties:
                allowHigherPayout:
                    description: true = a ticket above the max payout is accepted with its payout clamped to the limit; false = rejected.
                    type: boolean
                currency:
                    example: EUR
                    pattern: ^[A-Z]{3}$
                    type: string
                id:
                    example: "9"
                    type: string
                name:
                    example: VIP EUR
                    type: string
                site_id:
                    example: site-42
                    type: string
            required:
                - id
                - site_id
                - name
                - currency
                - allowHigherPayout
            type: object
        RiskGroupRequest:
            additionalProperties: false
            properties:
                allowHigherPayout:
                    default: false
                    description: Omitted = false (also on PUT).
                    type: boolean
                currency:
                    description: 3 letters; trimmed and uppercased.
                    example: EUR
                    type: string
                id:
                    description: Tolerated on PUT, ignored.
                    type: string
                name:
                    description: Trimmed; must not be empty.
                    minLength: 1
                    type: string
                site_id:
                    description: Ignored (the path site is used).
                    type: string
            required:
                - name
                - currency
            type: object
        RiskLevel:
            enum:
                - sport
                - category
                - tournament
            type: string
        RiskLimitSet:
            additionalProperties: false
            description: Every field null = inherit. 0 is a literal limit (blocks), not unlimited.
            properties:
                maxBetSize:
                    description: Maximum number of selections on the ticket.
                    type:
                        - integer
                        - "null"
                maxPayout:
                    type:
                        - number
                        - "null"
                maxStake:
                    description: Cumulative max stake per match (minus open exposure).
                    type:
                        - number
                        - "null"
                minBetSize:
                    description: Minimum number of selections on the ticket.
                    type:
                        - integer
                        - "null"
                minStake:
                    type:
                        - number
                        - "null"
            type: object
        RiskMarket:
            properties:
                id:
                    description: Market type id.
                    example: "18"
                    type: string
                maxStakeL:
                    description: Live cap; null = inherit.
                    type:
                        - number
                        - "null"
                maxStakeP:
                    description: Prematch cap; null = inherit.
                    type:
                        - number
                        - "null"
                name:
                    example: Total
                    type: string
            required:
                - id
                - name
                - maxStakeP
                - maxStakeL
            type: object
        RiskMarketRequest:
            additionalProperties: false
            description: Both caps null removes the override.
            properties:
                categoryId:
                    maximum: 2147483647
                    minimum: 1
                    type:
                        - integer
                        - "null"
                level:
                    $ref: '#/components/schemas/RiskLevel'
                marketTypeId:
                    description: Must exist in the market registry.
                    maximum: 2147483647
                    minimum: 1
                    type: integer
                maxStakeL:
                    exclusiveMinimum: 0
                    type:
                        - number
                        - "null"
                maxStakeP:
                    exclusiveMinimum: 0
                    type:
                        - number
                        - "null"
                sportId:
                    maximum: 2147483647
                    minimum: 1
                    type:
                        - integer
                        - "null"
                tournamentId:
                    maximum: 2147483647
                    minimum: 1
                    type:
                        - integer
                        - "null"
            required:
                - level
                - marketTypeId
            type: object
        RiskNode:
            properties:
                active:
                    description: false closes prematch betting; null = inherit.
                    type:
                        - boolean
                        - "null"
                id:
                    description: Catalogue id of the sport/category/tournament.
                    example: "1"
                    type: string
                live:
                    $ref: '#/components/schemas/RiskLimitSet'
                liveActive:
                    description: false closes live betting; null = inherit.
                    type:
                        - boolean
                        - "null"
                name:
                    example: Soccer
                    type: string
                prematch:
                    $ref: '#/components/schemas/RiskLimitSet'
                tMaxStake:
                    description: Per-ticket stake cap.
                    type:
                        - number
                        - "null"
            required:
                - id
                - name
                - active
                - liveActive
                - prematch
                - live
                - tMaxStake
            type: object
        RiskNodeRequest:
            additionalProperties: false
            description: Full replace — omitted fields are stored as null (inherit).
            properties:
                active:
                    type:
                        - boolean
                        - "null"
                categoryId:
                    description: Required when level=category.
                    maximum: 2147483647
                    minimum: 1
                    type:
                        - integer
                        - "null"
                level:
                    $ref: '#/components/schemas/RiskLevel'
                live:
                    $ref: '#/components/schemas/RiskLimitSet'
                liveActive:
                    type:
                        - boolean
                        - "null"
                prematch:
                    $ref: '#/components/schemas/RiskLimitSet'
                sportId:
                    description: Required when level=sport.
                    maximum: 2147483647
                    minimum: 1
                    type:
                        - integer
                        - "null"
                tMaxStake:
                    type:
                        - number
                        - "null"
                tournamentId:
                    description: Required when level=tournament.
                    maximum: 2147483647
                    minimum: 1
                    type:
                        - integer
                        - "null"
            required:
                - level
            type: object
        RiskSeedResult:
            properties:
                seeded:
                    description: false = a base row already existed and was left unchanged.
                    type: boolean
                siteId:
                    example: site-42
                    type: string
            required:
                - siteId
                - seeded
            type: object
        SiteInfo:
            properties:
                channels:
                    example:
                        - iframe
                    items:
                        type: string
                    type: array
                currencies:
                    example:
                        - EUR
                        - USD
                    items:
                        type: string
                    type: array
                defaultCurrency:
                    description: '"" when unset.'
                    example: EUR
                    type: string
                name:
                    description: '"" when unset.'
                    example: Brand A
                    type: string
                siteId:
                    example: brand-a
                    type: string
                tenantId:
                    example: acme
                    type: string
            required:
                - siteId
                - tenantId
                - name
                - defaultCurrency
                - currencies
                - channels
            type: object
        SiteReport:
            properties:
                ggr:
                    type: number
                margin:
                    description: Percent.
                    type: number
                open:
                    type: integer
                payout:
                    type: number
                siteId:
                    type: string
                stake:
                    type: number
                tickets:
                    type: integer
            required:
                - siteId
                - stake
                - payout
                - ggr
                - margin
                - tickets
                - open
            type: object
        SiteSettings:
            properties:
                allowHigherPayout:
                    type: boolean
                betTypes:
                    description: null = every bet type offered
                    type:
                        - object
                        - "null"
                cancelBet:
                    type:
                        - object
                        - "null"
                cashout:
                    type:
                        - object
                        - "null"
                channels:
                    items:
                        type: string
                    type: array
                currencies:
                    items:
                        type: string
                    type: array
                defaultCurrency:
                    type: string
                defaultLanguage:
                    type: string
                domain:
                    type: string
                languages:
                    items:
                        type: string
                    type: array
                liveBetEnabled:
                    type: boolean
                name:
                    type: string
                oddsFormat:
                    description: ''''' = the player UI default (decimal)'
                    type: string
                showAsianLines:
                    type: boolean
                siteId:
                    type: string
                status:
                    type: string
                systemSettings:
                    type:
                        - object
                        - "null"
            type: object
        SiteSettingsPatch:
            additionalProperties: false
            properties:
                allowHigherPayout:
                    type: boolean
                betTypes:
                    additionalProperties: false
                    description: A type set to false is refused at bet (bet_type_disabled); a missing one is offered
                    properties:
                        betbuilder:
                            type: boolean
                        combi:
                            type: boolean
                        single:
                            type: boolean
                        system:
                            type: boolean
                    type:
                        - object
                        - "null"
                cancelBet:
                    additionalProperties: false
                    properties:
                        enabled:
                            type: boolean
                        windowMinutes:
                            maximum: 1440
                            minimum: 1
                            type: integer
                    type:
                        - object
                        - "null"
                cashout:
                    additionalProperties: false
                    properties:
                        enabled:
                            type: boolean
                        minPartialCashoutValue:
                            minimum: 0
                            type: number
                        partialEnabled:
                            type: boolean
                    required:
                        - enabled
                    type:
                        - object
                        - "null"
                currencies:
                    description: Currencies the platform carries
                    items:
                        pattern: ^[A-Z]{3}$
                        type: string
                    minItems: 1
                    type: array
                defaultCurrency:
                    description: One of currencies
                    type: string
                defaultLanguage:
                    description: One of languages
                    type: string
                languages:
                    description: Languages enabled on the platform
                    items:
                        type: string
                    minItems: 1
                    type: array
                oddsFormat:
                    enum:
                        - decimal
                        - fractional
                        - american
                        - hongkong
                        - indo
                        - malay
                        - null
                    type:
                        - string
                        - "null"
                showAsianLines:
                    type: boolean
                systemSettings:
                    description: Sections maintenance, cashout, odd, showCurrency, showLMT, noMoreBet only
                    type:
                        - object
                        - "null"
            type: object
        SportMarket:
            properties:
                marketType:
                    example: 18
                    format: int64
                    type: integer
                name:
                    example: Total
                    type: string
            required:
                - marketType
                - name
            type: object
        SportMarketGroups:
            properties:
                hidden:
                    description: Types the sport offers that are drawn in no tab.
                    items:
                        $ref: '#/components/schemas/SportMarket'
                    type: array
                sportId:
                    format: int64
                    type: integer
                tabs:
                    items:
                        $ref: '#/components/schemas/SportTab'
                    type: array
            required:
                - sportId
                - tabs
                - hidden
            type: object
        SportReport:
            properties:
                currency:
                    type: string
                ggr:
                    type: number
                margin:
                    description: Percent.
                    type: number
                open:
                    type: integer
                payout:
                    type: number
                sport:
                    description: Absent when the name cannot be resolved.
                    type: string
                sportId:
                    type: string
                stake:
                    description: Overlaps between sports.
                    type: number
                tickets:
                    type: integer
            required:
                - sportId
                - currency
                - tickets
                - open
                - stake
                - payout
                - ggr
                - margin
            type: object
        SportTab:
            properties:
                id:
                    format: int64
                    type: integer
                markets:
                    items:
                        $ref: '#/components/schemas/SportMarket'
                    type: array
                name:
                    example: Main
                    type: string
                slug:
                    description: '"other" is the catch-all tab.'
                    example: main
                    type: string
                sort:
                    type: integer
            required:
                - id
                - name
                - slug
                - sort
                - markets
            type: object
        StakeLimits:
            properties:
                live:
                    $ref: '#/components/schemas/LimitSide'
                prematch:
                    $ref: '#/components/schemas/LimitSide'
                set:
                    description: false = the site has no base limits
                    readOnly: true
                    type: boolean
            type: object
        Ticket:
            properties:
                betType:
                    enum:
                        - single
                        - combo
                        - system
                        - betbuilder
                    type: string
                currency:
                    type: string
                id:
                    description: 64-bit ticket id as a string.
                    example: "7391827364512301056"
                    type: string
                limitApplied:
                    description: The payout was cut to the payout limit at acceptance.
                    type: boolean
                limits:
                    description: The limits the bet was held to when accepted (absent before 2026-11-27). Unset limits are absent.
                    properties:
                        allow_higher_payout:
                            type: boolean
                        max_payout:
                            description: Payout headroom.
                            type: number
                        max_payout_ceiling:
                            type: number
                        max_selections:
                            type: integer
                        max_stake:
                            description: Remaining cap on the tightest match.
                            type: number
                        min_selections:
                            type: integer
                        min_stake:
                            type: number
                        payout_clamped:
                            type: boolean
                        requested_payout:
                            type: number
                        risk_group_id:
                            type: integer
                        ticket_max_stake:
                            type: number
                    type: object
                payout:
                    description: Absent while open. WON = potentialWin, LOST = 0, CASHED_OUT = cashout amount, VOID = stake for a one-bet ticket (absent otherwise).
                    type: number
                placedAt:
                    format: date-time
                    type: string
                player:
                    type: string
                potentialWin:
                    type: number
                selections:
                    items:
                        $ref: '#/components/schemas/TicketSelection'
                    type: array
                settledAt:
                    format: date-time
                    type: string
                settledBy:
                    type: string
                settlementReason:
                    type: string
                settlementSource:
                    description: e.g. auto, manual, rollback, cashout, player.
                    type: string
                shapes:
                    description: Combination sizes the ticket plays (1 = singles, n = accumulator, k = k/n system).
                    items:
                        type: integer
                    type: array
                siteId:
                    type: string
                stake:
                    description: Per bet.
                    type: number
                status:
                    enum:
                        - PENDING
                        - WALLET_FAILED
                        - OPEN
                        - SETTLING
                        - WON
                        - LOST
                        - CANCELLED
                        - ROLLBACK_PENDING
                        - CASHED_OUT
                        - VOID
                    type: string
                systemSize:
                    type: integer
                totalOdds:
                    type: number
            required:
                - id
                - siteId
                - player
                - placedAt
                - betType
                - stake
                - currency
                - status
                - totalOdds
                - potentialWin
                - systemSize
                - shapes
                - selections
            type: object
        TicketDetail:
            allOf:
                - $ref: '#/components/schemas/Ticket'
                - properties:
                    selections:
                        items:
                            $ref: '#/components/schemas/ResolvedSelection'
                        type: array
                  type: object
        TicketSelection:
            properties:
                eventId:
                    description: Match id as a string.
                    example: "41893377"
                    type: string
                marketId:
                    description: 64-bit market id as a string.
                    example: "-8775457417276844928"
                    type: string
                odds:
                    example: 2.05
                    type: number
                outcomeId:
                    example: "1"
                    type: string
                status:
                    description: Leg status; currently not populated.
                    type: string
            required:
                - eventId
                - marketId
                - outcomeId
                - odds
            type: object
        UiCopyInput:
            additionalProperties: false
            properties:
                text:
                    description: Not blank. Exactly the key's placeholders. Revert with DELETE, not "".
                    example: 'Maximum stake: {{limit}}'
                    minLength: 1
                    type: string
            required:
                - text
            type: object
        UiCopyRow:
            properties:
                default:
                    description: Oddyne's wording.
                    type: string
                effective:
                    description: What players see.
                    type: string
                key:
                    example: betslip.max_stake
                    type: string
                lang:
                    example: en
                    type: string
                override:
                    description: The site's wording; absent when none.
                    type: string
                updatedAt:
                    description: Of the override; absent when none.
                    format: date-time
                    type: string
                updatedBy:
                    description: Of the override, e.g. integration:<client>:<actor>.
                    type: string
                vars:
                    description: Placeholders ({{name}}) every override must carry exactly.
                    items:
                        type: string
                    type: array
            required:
                - key
                - lang
                - default
                - effective
                - vars
            type: object
        WalletEvent:
            properties:
                amount:
                    description: Absent when zero.
                    type: number
                attempts:
                    description: Retries so far.
                    type: integer
                callType:
                    description: The wallet v2 call the row is sent as.
                    enum:
                        - bet
                        - win
                        - cashout
                        - cashout_partial
                        - refund
                        - win_reversal
                        - uncancel
                        - resettle_adjust
                    type: string
                createdAt:
                    format: date-time
                    type: string
                currency:
                    type: string
                direction:
                    enum:
                        - debit
                        - credit
                    type: string
                id:
                    type: string
                lastError:
                    type: string
                status:
                    enum:
                        - PENDING
                        - PROCESSING
                        - DONE
                        - FAILED
                    type: string
                transactionRef:
                    type: string
                type:
                    description: 'The internal kind: wallet_bet, wallet_win, wallet_refund, wallet_rollback, wallet_cashout, wallet_uncancel, wallet_resettle, wallet_settle'
                    type: string
            required:
                - id
                - type
                - status
                - attempts
                - createdAt
            type: object
        WalletSigningKey:
            properties:
                algorithm:
                    enum:
                        - ed25519
                    type: string
                createdAt:
                    format: date-time
                    type: string
                createdBy:
                    type: string
                keyId:
                    description: Sent as X-Oddyne-Key-Id
                    type: string
                publicKey:
                    description: Base64 (standard
                    padded) of the 32-byte Ed25519 public key: null
                    type: string
                retiredAt:
                    format: date-time
                    nullable: true
                    type: string
                retiredBy:
                    nullable: true
                    type: string
                signing:
                    description: The key calls are signed with now (the newest active)
                    type: boolean
                siteId:
                    type: string
                status:
                    enum:
                        - active
                        - retired
                    type: string
            type: object
        WalletTestInput:
            additionalProperties: false
            properties:
                amount:
                    example: 1
                    exclusiveMinimum: 0
                    maximum: 100
                    type: number
                currency:
                    description: Upper-cased by the server.
                    example: EUR
                    type: string
                userId:
                    description: A test player on YOUR wallet — money moves on it.
                    example: qa-wallet-01
                    type: string
            required:
                - userId
                - currency
                - amount
            type: object
        WalletTestReport:
            properties:
                baseUrl:
                    type: string
                currency:
                    type: string
                failed:
                    type: integer
                ledgerDelta:
                    description: What the run left on your ledger; 0 is the only correct result.
                    type: number
                ledgerNote:
                    type: string
                passed:
                    type: integer
                runId:
                    type: string
                skipped:
                    type: integer
                steps:
                    items:
                        $ref: '#/components/schemas/WalletTestStep'
                    type: array
                warned:
                    type: integer
            required:
                - runId
                - baseUrl
                - steps
                - passed
                - warned
                - failed
                - skipped
                - ledgerDelta
                - ledgerNote
                - currency
            type: object
        WalletTestStep:
            properties:
                detail:
                    description: English explanation.
                    type: string
                errorCode:
                    type: string
                errorMessage:
                    type: string
                httpStatus:
                    type: integer
                key:
                    enum:
                        - bet
                        - bet_replay
                        - bet_rollback
                        - bet_rollback_replay
                        - win
                        - win_replay
                        - win_rollback
                    type: string
                latencyMs:
                    type: integer
                path:
                    enum:
                        - /bet
                        - /rollback
                        - /win
                    type: string
                request:
                    description: The exact JSON body that was sent.
                    type: object
                transactionId:
                    type: string
                transactionRef:
                    example: oddyne-probe:a1b2c3d4e5f6:bet
                    type: string
                verdict:
                    enum:
                        - pass
                        - warn
                        - fail
                        - skipped
                    type: string
                walletStatus:
                    type: string
            required:
                - key
                - path
                - verdict
                - detail
                - httpStatus
                - latencyMs
                - walletStatus
                - transactionId
                - errorCode
                - errorMessage
                - transactionRef
                - request
            type: object
        WalletUrl:
            additionalProperties: false
            description: On PUT, at least one field; a field left out is unchanged. GET and the PUT response return both.
            properties:
                settleLost:
                    description: Also send settlements that pay nothing (lost) to the wallet, as zero-amount calls. Default false.
                    example: false
                    type: boolean
                walletUrl:
                    description: Absolute http(s) URL with a host; "" clears it.
                    example: https://wallet.yourplatform.com/sportsbook
                    type: string
            type: object
    securitySchemes:
        apiKey:
            description: The same key, as a header.
            in: header
            name: X-Api-Key
            type: apiKey
        bearer:
            description: '`Authorization: Bearer <key>` — the client key issued by Oddyne.'
            scheme: bearer
            type: http
info:
    description: |
        Server-to-server management of the Oddyne online sportsbook for the sites a client
        holds: risk, bet delays, market settings, combine bonus, cashout, tickets, reports,
        translations, and the catalogue and matches they refer to.

        Every write needs `X-Actor` (the admin making the change; recorded in the audit log).
        The site in the path is the only site a call acts on; a site sent in the query or
        body is replaced by it. Responses are wrapped in an envelope
        (`{success, code, data, meta?}`); errors carry a stable `code`.

        Generated from docs-site/docs/public/openapi/admin-*.yaml by cmd/tools/openapi-merge.
    title: Oddyne Sportsbook — Admin API
    version: "1"
openapi: 3.1.0
paths:
    /catalog/categories:
        get:
            operationId: listCatalogCategories
            parameters:
                - description: Only this sport's categories; missing, 0 or unparseable = all.
                  in: query
                  name: sportId
                  required: false
                  schema:
                    format: int64
                    type: integer
                - description: Case-insensitive name substring.
                  in: query
                  name: q
                  required: false
                  schema:
                    type: string
                - description: Default 50, capped at 200.
                  in: query
                  name: limit
                  required: false
                  schema:
                    default: 50
                    maximum: 200
                    type: integer
                - in: query
                  name: offset
                  required: false
                  schema:
                    default: 0
                    minimum: 0
                    type: integer
            responses:
                "200":
                    content:
                        application/json:
                            schema:
                                allOf:
                                    - $ref: '#/components/schemas/Envelope'
                                    - properties:
                                        data:
                                            items:
                                                $ref: '#/components/schemas/CatalogCategory'
                                            type: array
                                      type: object
                    description: A page of categories.
                "401":
                    $ref: '#/components/responses/Error'
                "403":
                    $ref: '#/components/responses/Error'
                "503":
                    $ref: '#/components/responses/Error'
            summary: Categories, optionally of one sport
            tags:
                - Catalogue
            x-scope: catalog.view
    /catalog/sports:
        get:
            operationId: listCatalogSports
            parameters:
                - description: Case-insensitive name substring.
                  in: query
                  name: q
                  required: false
                  schema:
                    type: string
                - description: Default 50, capped at 200; <= 0 or unparseable = default.
                  in: query
                  name: limit
                  required: false
                  schema:
                    default: 50
                    maximum: 200
                    type: integer
                - in: query
                  name: offset
                  required: false
                  schema:
                    default: 0
                    minimum: 0
                    type: integer
            responses:
                "200":
                    content:
                        application/json:
                            schema:
                                allOf:
                                    - $ref: '#/components/schemas/Envelope'
                                    - properties:
                                        data:
                                            items:
                                                $ref: '#/components/schemas/CatalogSport'
                                            type: array
                                      type: object
                    description: A page of sports; meta.total is the unpaged count (0 when offset is past the end).
                "401":
                    $ref: '#/components/responses/Error'
                "403":
                    $ref: '#/components/responses/Error'
                "503":
                    $ref: '#/components/responses/Error'
            summary: Sports (disabled ones included)
            tags:
                - Catalogue
            x-scope: catalog.view
    /catalog/tournaments:
        get:
            operationId: listCatalogTournaments
            parameters:
                - description: Only this category's tournaments; missing, 0 or unparseable = all.
                  in: query
                  name: categoryId
                  required: false
                  schema:
                    format: int64
                    type: integer
                - description: Case-insensitive name substring.
                  in: query
                  name: q
                  required: false
                  schema:
                    type: string
                - description: Default 50, capped at 200.
                  in: query
                  name: limit
                  required: false
                  schema:
                    default: 50
                    maximum: 200
                    type: integer
                - in: query
                  name: offset
                  required: false
                  schema:
                    default: 0
                    minimum: 0
                    type: integer
            responses:
                "200":
                    content:
                        application/json:
                            schema:
                                allOf:
                                    - $ref: '#/components/schemas/Envelope'
                                    - properties:
                                        data:
                                            items:
                                                $ref: '#/components/schemas/CatalogTournament'
                                            type: array
                                      type: object
                    description: A page of tournaments.
                "401":
                    $ref: '#/components/responses/Error'
                "403":
                    $ref: '#/components/responses/Error'
                "503":
                    $ref: '#/components/responses/Error'
            summary: Tournaments, optionally of one category
            tags:
                - Catalogue
            x-scope: catalog.view
    /enums:
        get:
            operationId: getEnums
            responses:
                "200":
                    content:
                        application/json:
                            schema:
                                allOf:
                                    - $ref: '#/components/schemas/Envelope'
                                    - properties:
                                        data:
                                            $ref: '#/components/schemas/Enums'
                                      type: object
                    description: The dictionaries.
                "401":
                    $ref: '#/components/responses/Error'
            summary: Every code list the API uses
            tags:
                - Dictionaries
            x-scope: none
    /frontend-versions:
        get:
            operationId: listFrontendVersions
            responses:
                "200":
                    content:
                        application/json:
                            schema:
                                allOf:
                                    - $ref: '#/components/schemas/Envelope'
                                    - properties:
                                        data:
                                            items:
                                                $ref: '#/components/schemas/FrontendVersion'
                                            type: array
                                      type: object
                    description: Library builds; the first one is the latest
                default:
                    $ref: '#/components/responses/Error'
            summary: The frontend library builds a platform can pin, newest first
            tags:
                - Frontend library
            x-scope: catalog.view
    /matches:
        get:
            operationId: listMatches
            parameters:
                - description: A matchStatuses code (1 = live, 0 = prematch). Non-numeric is ignored.
                  in: query
                  name: status
                  required: false
                  schema:
                    maximum: 7
                    minimum: 0
                    type: integer
                - description: Case-insensitive substring of the sport's English NAME (not an id).
                  in: query
                  name: sport
                  required: false
                  schema:
                    type: string
                - description: Substring of home/away/tournament name, match id or provider ref.
                  in: query
                  name: q
                  required: false
                  schema:
                    type: string
                - description: Kickoff >= this (RFC 3339).
                  in: query
                  name: from
                  required: false
                  schema:
                    format: date-time
                    type: string
                - description: Kickoff <= this (RFC 3339
                  in: query
                  inclusive).: null
                  name: to
                  required: false
                  schema:
                    format: date-time
                    type: string
                - description: Default 50, capped at 200.
                  in: query
                  name: limit
                  required: false
                  schema:
                    default: 50
                    maximum: 200
                    type: integer
                - in: query
                  name: offset
                  required: false
                  schema:
                    default: 0
                    minimum: 0
                    type: integer
            responses:
                "200":
                    content:
                        application/json:
                            schema:
                                allOf:
                                    - $ref: '#/components/schemas/Envelope'
                                    - properties:
                                        data:
                                            items:
                                                $ref: '#/components/schemas/Match'
                                            type: array
                                      type: object
                    description: A page of matches.
                "401":
                    $ref: '#/components/responses/Error'
                "403":
                    $ref: '#/components/responses/Error'
                "422":
                    $ref: '#/components/responses/Error'
                    description: validation.bad_body — from/to is not RFC 3339.
                "503":
                    $ref: '#/components/responses/Error'
            summary: Matches, newest kickoff first (platform-disabled ones included)
            tags:
                - Matches
            x-scope: catalog.view
    /matches/{id}:
        get:
            operationId: getMatch
            parameters:
                - description: Our match id.
                  in: path
                  name: id
                  required: true
                  schema:
                    format: int64
                    type: integer
            responses:
                "200":
                    content:
                        application/json:
                            schema:
                                allOf:
                                    - $ref: '#/components/schemas/Envelope'
                                    - properties:
                                        data:
                                            $ref: '#/components/schemas/MatchDetail'
                                      type: object
                    description: The match detail.
                "401":
                    $ref: '#/components/responses/Error'
                "403":
                    $ref: '#/components/responses/Error'
                "404":
                    $ref: '#/components/responses/Error'
                "422":
                    $ref: '#/components/responses/Error'
                    description: validation.invalid_id — the id is not a number.
                "503":
                    $ref: '#/components/responses/Error'
            summary: One match with its markets and RAW odds (no site margin)
            tags:
                - Matches
            x-scope: catalog.view
    /sites:
        get:
            operationId: listSites
            responses:
                "200":
                    content:
                        application/json:
                            schema:
                                allOf:
                                    - $ref: '#/components/schemas/Envelope'
                                    - properties:
                                        data:
                                            $ref: '#/components/schemas/ClientSites'
                                      type: object
                    description: The client and its sites.
                "401":
                    $ref: '#/components/responses/Error'
                "503":
                    $ref: '#/components/responses/Error'
            summary: The client, its scopes and the sites the key holds
            tags:
                - Sites
            x-scope: none
    /sites/{siteId}:
        get:
            operationId: getSite
            parameters:
                - $ref: '#/components/parameters/SiteId'
            responses:
                "200":
                    content:
                        application/json:
                            schema:
                                allOf:
                                    - $ref: '#/components/schemas/Envelope'
                                    - properties:
                                        data:
                                            $ref: '#/components/schemas/SiteInfo'
                                      type: object
                    description: The site.
                "401":
                    $ref: '#/components/responses/Error'
                "403":
                    $ref: '#/components/responses/Error'
                    description: integration.site_not_allowed — the key does not hold the site (also for a site that does not exist).
            summary: One site the key holds
            tags:
                - Sites
            x-scope: none
    /sites/{siteId}/api-key:
        get:
            operationId: getLaunchKeyStatus
            parameters:
                - $ref: '#/components/parameters/SiteId'
            responses:
                "200":
                    content:
                        application/json:
                            schema:
                                allOf:
                                    - $ref: '#/components/schemas/Envelope'
                                    - properties:
                                        data:
                                            $ref: '#/components/schemas/LaunchKeyStatus'
                                      type: object
                    description: Whether a key is set.
                "401":
                    $ref: '#/components/responses/Error'
                "403":
                    $ref: '#/components/responses/Error'
            summary: Whether the site has a player launch key (never the key itself)
            tags:
                - Site settings
            x-scope: sportsbook.view
        post:
            description: |
                The key /api/launch authenticates — NOT the Admin API key. Only its hash is
                stored: this response is the only time the plaintext exists. The previous key
                stops working immediately. No request body.
            operationId: rotateLaunchKey
            parameters:
                - $ref: '#/components/parameters/SiteId'
                - $ref: '#/components/parameters/Actor'
            responses:
                "200":
                    content:
                        application/json:
                            schema:
                                allOf:
                                    - $ref: '#/components/schemas/Envelope'
                                    - properties:
                                        data:
                                            $ref: '#/components/schemas/LaunchKey'
                                      type: object
                    description: The new key, once.
                "400":
                    $ref: '#/components/responses/Error'
                "401":
                    $ref: '#/components/responses/Error'
                "403":
                    $ref: '#/components/responses/Error'
            summary: Rotate the player launch key (plaintext returned once; old key stops at once)
            tags:
                - Site settings
            x-scope: sportsbook.configure
    /sites/{siteId}/bet-builder:
        delete:
            operationId: resetBetBuilder
            parameters:
                - $ref: '#/components/parameters/Actor'
            responses:
                "200":
                    content:
                        application/json:
                            schema:
                                allOf:
                                    - $ref: '#/components/schemas/Envelope'
                                    - properties:
                                        data:
                                            $ref: '#/components/schemas/BetBuilder'
                    description: Policy now in force
                default:
                    $ref: '#/components/responses/Error'
            summary: Drop the site's own policy (the platform's applies)
            tags:
                - Site settings
            x-scope: sportsbook.configure
        get:
            operationId: getBetBuilder
            responses:
                "200":
                    content:
                        application/json:
                            schema:
                                allOf:
                                    - $ref: '#/components/schemas/Envelope'
                                    - properties:
                                        data:
                                            $ref: '#/components/schemas/BetBuilder'
                    description: Policy
                default:
                    $ref: '#/components/responses/Error'
            summary: The bet builder policy the bet path uses
            tags:
                - Site settings
            x-scope: sportsbook.view
        parameters:
            - $ref: '#/components/parameters/SiteId'
        put:
            operationId: setBetBuilder
            parameters:
                - $ref: '#/components/parameters/Actor'
            requestBody:
                content:
                    application/json:
                        schema:
                            $ref: '#/components/schemas/BetBuilderInput'
                required: true
            responses:
                "200":
                    content:
                        application/json:
                            schema:
                                allOf:
                                    - $ref: '#/components/schemas/Envelope'
                                    - properties:
                                        data:
                                            $ref: '#/components/schemas/BetBuilder'
                    description: Policy
                default:
                    $ref: '#/components/responses/Error'
            summary: Set the site's own bet builder policy (every field)
            tags:
                - Site settings
            x-scope: sportsbook.configure
    /sites/{siteId}/bet-delays:
        delete:
            description: Idempotent; that scope falls back to the next site rule, then the platform rule.
            operationId: deleteBetDelay
            parameters:
                - $ref: '#/components/parameters/Actor'
                - in: query
                  name: level
                  required: true
                  schema:
                    $ref: '#/components/schemas/BetDelayLevel'
                - description: 0 for the default level.
                  in: query
                  name: entity_id
                  required: true
                  schema:
                    format: int64
                    minimum: 0
                    type: integer
            responses:
                "204":
                    description: Removed.
                default:
                    $ref: '#/components/responses/Error'
                    description: 422 validation.invalid_id (entity_id missing/not an integer), 422 validation.bad_body (bad level/entity_id), or a common error.
            summary: Remove one site bet-delay rule
            tags:
                - Bet delays
            x-scope: risk.manage
        get:
            operationId: listBetDelays
            responses:
                "200":
                    content:
                        application/json:
                            schema:
                                allOf:
                                    - $ref: '#/components/schemas/Envelope'
                                    - properties:
                                        data:
                                            $ref: '#/components/schemas/BetDelays'
                                      type: object
                    description: Both tiers, most specific level first.
                default:
                    $ref: '#/components/responses/Error'
            summary: The site's live bet-delay rules and the platform rules
            tags:
                - Bet delays
            x-scope: risk.view
        parameters:
            - $ref: '#/components/parameters/SiteId'
        put:
            operationId: setBetDelay
            parameters:
                - $ref: '#/components/parameters/Actor'
            requestBody:
                content:
                    application/json:
                        schema:
                            $ref: '#/components/schemas/BetDelayRequest'
                required: true
            responses:
                "200":
                    content:
                        application/json:
                            schema:
                                allOf:
                                    - $ref: '#/components/schemas/Envelope'
                                    - properties:
                                        data:
                                            $ref: '#/components/schemas/BetDelayRule'
                                      type: object
                    description: The stored rule.
                default:
                    $ref: '#/components/responses/Error'
                    description: 422 validation.bad_body (bad level, entityId or delayMs), or a common error.
            summary: Create or update one site bet-delay rule
            tags:
                - Bet delays
            x-scope: risk.manage
    /sites/{siteId}/bonus-templates:
        get:
            description: Ordered by name, not paged. Configuration only; no bet path reads templates yet.
            operationId: listBonusTemplates
            responses:
                "200":
                    content:
                        application/json:
                            schema:
                                allOf:
                                    - $ref: '#/components/schemas/Envelope'
                                    - properties:
                                        data:
                                            items:
                                                $ref: '#/components/schemas/BonusTemplate'
                                            type: array
                                        meta:
                                            $ref: '#/components/schemas/ListMeta'
                                      type: object
                    description: The templates.
                default:
                    $ref: '#/components/responses/Error'
            summary: The site's combine bonus templates
            tags:
                - Bonus
            x-scope: sportsbook.view
        parameters:
            - $ref: '#/components/parameters/SiteId'
        post:
            operationId: createBonusTemplate
            parameters:
                - $ref: '#/components/parameters/Actor'
            requestBody:
                content:
                    application/json:
                        schema:
                            $ref: '#/components/schemas/BonusTemplateRequest'
                required: true
            responses:
                "201":
                    content:
                        application/json:
                            schema:
                                allOf:
                                    - $ref: '#/components/schemas/Envelope'
                                    - properties:
                                        data:
                                            $ref: '#/components/schemas/BonusTemplate'
                                      type: object
                    description: Created.
                default:
                    $ref: '#/components/responses/Error'
                    description: 422 validation.bad_body, 422 validation.invalid_currency, 422 bonus_template.currency_not_on_site, 422 bonus_template.invalid_tiers, 409 bonus_template.duplicate_name, or a common error.
            summary: Create a combine bonus template
            tags:
                - Bonus
            x-scope: sportsbook.configure
    /sites/{siteId}/bonus-templates/{id}:
        delete:
            operationId: deleteBonusTemplate
            parameters:
                - $ref: '#/components/parameters/Actor'
            responses:
                "204":
                    description: Deleted.
                default:
                    $ref: '#/components/responses/Error'
                    description: 404 not_found, 422 validation.invalid_id, or a common error.
            summary: Delete a combine bonus template
            tags:
                - Bonus
            x-scope: sportsbook.configure
        parameters:
            - $ref: '#/components/parameters/SiteId'
            - in: path
              name: id
              required: true
              schema:
                example: "4"
                pattern: ^[1-9][0-9]*$
                type: string
        put:
            description: Full replace; tiers are recreated with new ids.
            operationId: updateBonusTemplate
            parameters:
                - $ref: '#/components/parameters/Actor'
            requestBody:
                content:
                    application/json:
                        schema:
                            $ref: '#/components/schemas/BonusTemplateRequest'
                required: true
            responses:
                "200":
                    content:
                        application/json:
                            schema:
                                allOf:
                                    - $ref: '#/components/schemas/Envelope'
                                    - properties:
                                        data:
                                            $ref: '#/components/schemas/BonusTemplate'
                                      type: object
                    description: Updated.
                default:
                    $ref: '#/components/responses/Error'
                    description: 404 not_found, 422 validation.invalid_id, plus the create errors, or a common error.
            summary: Replace a combine bonus template (tiers included)
            tags:
                - Bonus
            x-scope: sportsbook.configure
    /sites/{siteId}/cashout:
        get:
            operationId: getCashoutPolicy
            parameters:
                - $ref: '#/components/parameters/SiteId'
            responses:
                "200":
                    content:
                        application/json:
                            schema:
                                allOf:
                                    - $ref: '#/components/schemas/Envelope'
                                    - properties:
                                        data:
                                            $ref: '#/components/schemas/CashoutPolicy'
                                      type: object
                    description: The policy in force (defaults filled in when the site never saved one).
                "401":
                    $ref: '#/components/responses/Error'
                "403":
                    $ref: '#/components/responses/Error'
                "500":
                    $ref: '#/components/responses/Error'
            summary: The site's cashout policy with the platform band
            tags:
                - Cashout
            x-scope: cashout.configure
        put:
            description: |
                FULL replacement — send all six fields; an omitted boolean is false. The GET
                response cannot be sent back verbatim: its read-only fields are unknown here (400).
            operationId: putCashoutPolicy
            parameters:
                - $ref: '#/components/parameters/SiteId'
                - $ref: '#/components/parameters/Actor'
            requestBody:
                content:
                    application/json:
                        schema:
                            $ref: '#/components/schemas/CashoutPolicyInput'
                required: true
            responses:
                "200":
                    content:
                        application/json:
                            schema:
                                allOf:
                                    - $ref: '#/components/schemas/Envelope'
                                    - properties:
                                        data:
                                            $ref: '#/components/schemas/CashoutPolicy'
                                      type: object
                    description: The policy as stored (same shape as GET).
                "400":
                    $ref: '#/components/responses/Error'
                    description: validation.bad_body — malformed/unknown field, negative value, coefficient outside (0, 1].
                "401":
                    $ref: '#/components/responses/Error'
                "403":
                    $ref: '#/components/responses/Error'
                "500":
                    $ref: '#/components/responses/Error'
            summary: Replace the site's cashout policy (coefficient clamped into the band)
            tags:
                - Cashout
            x-scope: cashout.configure
    /sites/{siteId}/display-overrides:
        get:
            operationId: listDisplayOverrides
            parameters:
                - $ref: '#/components/parameters/SiteId'
                - in: query
                  name: entityType
                  schema:
                    enum:
                        - sport
                        - category
                        - tournament
                        - match
                    type: string
            responses:
                "200":
                    content:
                        application/json:
                            schema:
                                allOf:
                                    - $ref: '#/components/schemas/Envelope'
                                    - properties:
                                        data:
                                            items:
                                                $ref: '#/components/schemas/DisplayOverride'
                                            type: array
                    description: Overrides
                default:
                    $ref: '#/components/responses/Error'
            summary: The sports, categories, tournaments and matches the site switched off (or explicitly on)
            tags:
                - Site settings
            x-scope: sportsbook.view
    /sites/{siteId}/display-overrides/{entityType}/{entityId}:
        delete:
            operationId: deleteDisplayOverride
            parameters:
                - $ref: '#/components/parameters/Actor'
            responses:
                "200":
                    description: Removed
                default:
                    $ref: '#/components/responses/Error'
            summary: Remove the override (the entity follows the platform again)
            tags:
                - Site settings
            x-scope: sportsbook.configure
        parameters:
            - $ref: '#/components/parameters/SiteId'
            - in: path
              name: entityType
              required: true
              schema:
                enum:
                    - sport
                    - category
                    - tournament
                    - match
                type: string
            - in: path
              name: entityId
              required: true
              schema:
                format: int64
                type: integer
        put:
            operationId: putDisplayOverride
            parameters:
                - $ref: '#/components/parameters/Actor'
            requestBody:
                content:
                    application/json:
                        schema:
                            properties:
                                disabled:
                                    type: boolean
                            required:
                                - disabled
                            type: object
                required: true
            responses:
                "200":
                    content:
                        application/json:
                            schema:
                                allOf:
                                    - $ref: '#/components/schemas/Envelope'
                                    - properties:
                                        data:
                                            $ref: '#/components/schemas/DisplayOverride'
                    description: Saved
                default:
                    $ref: '#/components/responses/Error'
            summary: Switch an entity off (disabled true) or on for the site
            tags:
                - Site settings
            x-scope: sportsbook.configure
    /sites/{siteId}/featured-events:
        get:
            operationId: listFeaturedEvents
            parameters:
                - $ref: '#/components/parameters/SiteId'
            responses:
                "200":
                    content:
                        application/json:
                            schema:
                                allOf:
                                    - $ref: '#/components/schemas/Envelope'
                                    - properties:
                                        data:
                                            items:
                                                $ref: '#/components/schemas/FeaturedEvent'
                                            type: array
                    description: Featured events
                default:
                    $ref: '#/components/responses/Error'
            summary: The site's pinned and excluded top events
            tags:
                - Site settings
            x-scope: sportsbook.view
    /sites/{siteId}/featured-events/{matchId}:
        delete:
            operationId: deleteFeaturedEvent
            parameters:
                - $ref: '#/components/parameters/Actor'
            responses:
                "200":
                    description: Removed
                default:
                    $ref: '#/components/responses/Error'
            summary: Return the match to the default selection
            tags:
                - Site settings
            x-scope: sportsbook.configure
        parameters:
            - $ref: '#/components/parameters/SiteId'
            - in: path
              name: matchId
              required: true
              schema:
                format: int64
                type: integer
        put:
            operationId: setFeaturedEvent
            parameters:
                - $ref: '#/components/parameters/Actor'
            requestBody:
                content:
                    application/json:
                        schema:
                            $ref: '#/components/schemas/FeaturedEventInput'
                required: true
            responses:
                "200":
                    description: Saved
                default:
                    $ref: '#/components/responses/Error'
            summary: Pin (featured true) or exclude (false) a match
            tags:
                - Site settings
            x-scope: sportsbook.configure
    /sites/{siteId}/live-bet:
        get:
            operationId: getLiveBet
            parameters:
                - $ref: '#/components/parameters/SiteId'
            responses:
                "200":
                    content:
                        application/json:
                            schema:
                                allOf:
                                    - $ref: '#/components/schemas/Envelope'
                                    - properties:
                                        data:
                                            $ref: '#/components/schemas/LiveBet'
                                      type: object
                    description: The live-bet switch.
                "401":
                    $ref: '#/components/responses/Error'
                "403":
                    $ref: '#/components/responses/Error'
            summary: Whether the site takes live bets
            tags:
                - Site settings
            x-scope: sportsbook.view
        put:
            operationId: setLiveBet
            parameters:
                - $ref: '#/components/parameters/SiteId'
                - $ref: '#/components/parameters/Actor'
            requestBody:
                content:
                    application/json:
                        schema:
                            $ref: '#/components/schemas/LiveBetInput'
                required: true
            responses:
                "200":
                    content:
                        application/json:
                            schema:
                                allOf:
                                    - $ref: '#/components/schemas/Envelope'
                                    - properties:
                                        data:
                                            $ref: '#/components/schemas/LiveBet'
                                      type: object
                    description: The stored value.
                "400":
                    $ref: '#/components/responses/Error'
                "401":
                    $ref: '#/components/responses/Error'
                "403":
                    $ref: '#/components/responses/Error'
                "422":
                    $ref: '#/components/responses/Error'
                    description: validation.bad_body — liveBetEnabled is missing.
            summary: Turn the site's live book on or off (refuses tickets when off)
            tags:
                - Site settings
            x-scope: sportsbook.configure
    /sites/{siteId}/market-groups/sports:
        get:
            description: Same answer for every site.
            operationId: listMarketGroupSports
            responses:
                "200":
                    content:
                        application/json:
                            schema:
                                allOf:
                                    - $ref: '#/components/schemas/Envelope'
                                    - properties:
                                        data:
                                            items:
                                                $ref: '#/components/schemas/MarketGroupSport'
                                            type: array
                                        meta:
                                            $ref: '#/components/schemas/ListMeta'
                                      type: object
                    description: The sports.
                default:
                    $ref: '#/components/responses/Error'
                    description: 503 db_unavailable, or a common error.
            summary: Sports that offer markets, most market types first
            tags:
                - Market groups
            x-scope: sportsbook.view
        parameters:
            - $ref: '#/components/parameters/SiteId'
    /sites/{siteId}/market-groups/sports/{sportId}:
        get:
            description: Read-only, same for every site; per-site market settings are not applied. Unknown sport → empty view.
            operationId: getSportMarketGroups
            responses:
                "200":
                    content:
                        application/json:
                            schema:
                                allOf:
                                    - $ref: '#/components/schemas/Envelope'
                                    - properties:
                                        data:
                                            $ref: '#/components/schemas/SportMarketGroups'
                                      type: object
                    description: The sport's tab layout.
                default:
                    $ref: '#/components/responses/Error'
                    description: 422 validation.invalid_id, 503 db_unavailable, or a common error.
            summary: A sport's match-page tabs and the market types in each
            tags:
                - Market groups
            x-scope: sportsbook.view
        parameters:
            - $ref: '#/components/parameters/SiteId'
            - in: path
              name: sportId
              required: true
              schema:
                format: int64
                minimum: 1
                type: integer
    /sites/{siteId}/market-settings:
        get:
            description: Only overridden market types are listed, ordered by market type.
            operationId: listMarketSettings
            responses:
                "200":
                    content:
                        application/json:
                            schema:
                                allOf:
                                    - $ref: '#/components/schemas/Envelope'
                                    - properties:
                                        data:
                                            items:
                                                $ref: '#/components/schemas/MarketSetting'
                                            type: array
                                        meta:
                                            $ref: '#/components/schemas/ListMeta'
                                      type: object
                    description: The overrides.
                default:
                    $ref: '#/components/responses/Error'
            summary: The site's market-type overrides (display only)
            tags:
                - Market settings
            x-scope: sportsbook.view
        parameters:
            - $ref: '#/components/parameters/SiteId'
    /sites/{siteId}/market-settings/{marketType}/disable:
        parameters:
            - $ref: '#/components/parameters/SiteId'
            - in: path
              name: marketType
              required: true
              schema:
                example: 18
                format: int64
                type: integer
        post:
            description: No body. Idempotent. Hidden markets still accept tickets that reference them.
            operationId: disableMarketSetting
            parameters:
                - $ref: '#/components/parameters/Actor'
            responses:
                "200":
                    content:
                        application/json:
                            schema:
                                allOf:
                                    - $ref: '#/components/schemas/Envelope'
                                    - properties:
                                        data:
                                            $ref: '#/components/schemas/MarketSetting'
                                      type: object
                    description: The setting.
                default:
                    $ref: '#/components/responses/Error'
                    description: 422 validation.bad_body (marketType not an integer), or a common error.
            summary: Hide a market type on the site (display only, does not stop betting)
            tags:
                - Market settings
            x-scope: sportsbook.configure
    /sites/{siteId}/market-settings/{marketType}/display-name:
        parameters:
            - $ref: '#/components/parameters/SiteId'
            - in: path
              name: marketType
              required: true
              schema:
                example: 18
                format: int64
                type: integer
        put:
            operationId: putMarketDisplayName
            parameters:
                - $ref: '#/components/parameters/Actor'
            requestBody:
                content:
                    application/json:
                        schema:
                            $ref: '#/components/schemas/MarketDisplayNameRequest'
                required: true
            responses:
                "200":
                    content:
                        application/json:
                            schema:
                                allOf:
                                    - $ref: '#/components/schemas/Envelope'
                                    - properties:
                                        data:
                                            $ref: '#/components/schemas/MarketSetting'
                                      type: object
                    description: The setting.
                default:
                    $ref: '#/components/responses/Error'
                    description: 400 validation.bad_body (empty/malformed body), 422 validation.bad_body (marketType not an integer), or a common error.
            summary: Set or clear the site's display name of a market type
            tags:
                - Market settings
            x-scope: sportsbook.configure
    /sites/{siteId}/market-settings/{marketType}/enable:
        parameters:
            - $ref: '#/components/parameters/SiteId'
            - in: path
              name: marketType
              required: true
              schema:
                example: 18
                format: int64
                type: integer
        post:
            description: No body. Idempotent. The market type is not checked against the registry.
            operationId: enableMarketSetting
            parameters:
                - $ref: '#/components/parameters/Actor'
            responses:
                "200":
                    content:
                        application/json:
                            schema:
                                allOf:
                                    - $ref: '#/components/schemas/Envelope'
                                    - properties:
                                        data:
                                            $ref: '#/components/schemas/MarketSetting'
                                      type: object
                    description: The setting.
                default:
                    $ref: '#/components/responses/Error'
                    description: 422 validation.bad_body (marketType not an integer), or a common error.
            summary: Show a market type on the site
            tags:
                - Market settings
            x-scope: sportsbook.configure
    /sites/{siteId}/market-types:
        get:
            operationId: listMarketTypes
            parameters:
                - $ref: '#/components/parameters/SiteId'
                - description: Name substring or exact market type id
                  in: query
                  name: q
                  schema:
                    type: string
                - in: query
                  name: sportId
                  schema:
                    type: integer
                - in: query
                  name: limit
                  schema:
                    default: 50
                    maximum: 200
                    type: integer
                - in: query
                  name: offset
                  schema:
                    default: 0
                    type: integer
            responses:
                "200":
                    content:
                        application/json:
                            schema:
                                allOf:
                                    - $ref: '#/components/schemas/Envelope'
                                    - properties:
                                        data:
                                            items:
                                                $ref: '#/components/schemas/MarketTypeView'
                                            type: array
                    description: Market types
                default:
                    $ref: '#/components/responses/Error'
            summary: The market type registry with the site's overrides
            tags:
                - Market settings
            x-scope: sportsbook.view
    /sites/{siteId}/players:
        get:
            operationId: listPlayers
            parameters:
                - $ref: '#/components/parameters/SiteId'
                - description: Case-insensitive player-id substring (% and _ are wildcards).
                  in: query
                  name: q
                  required: false
                  schema:
                    type: string
                - description: Placed >= this (RFC 3339).
                  in: query
                  name: from
                  required: false
                  schema:
                    format: date-time
                    type: string
                - description: Placed < this (RFC 3339).
                  in: query
                  name: to
                  required: false
                  schema:
                    format: date-time
                    type: string
                - description: Default 50; values above 200 fall back to 50.
                  in: query
                  name: limit
                  required: false
                  schema:
                    default: 50
                    maximum: 200
                    type: integer
                - in: query
                  name: offset
                  required: false
                  schema:
                    default: 0
                    minimum: 0
                    type: integer
            responses:
                "200":
                    content:
                        application/json:
                            schema:
                                allOf:
                                    - $ref: '#/components/schemas/Envelope'
                                    - properties:
                                        data:
                                            items:
                                                $ref: '#/components/schemas/PlayerReport'
                                            type: array
                                      type: object
                    description: A page of player rows.
                "401":
                    $ref: '#/components/responses/Error'
                "403":
                    $ref: '#/components/responses/Error'
                "422":
                    $ref: '#/components/responses/Error'
                "502":
                    $ref: '#/components/responses/Error'
                "503":
                    $ref: '#/components/responses/Error'
            summary: Turnover per player (and currency), heaviest first
            tags:
                - Reports
            x-scope: tickets.view
    /sites/{siteId}/players/{ref}/risk:
        get:
            operationId: getPlayerRisk
            responses:
                "200":
                    content:
                        application/json:
                            schema:
                                allOf:
                                    - $ref: '#/components/schemas/Envelope'
                                    - properties:
                                        data:
                                            $ref: '#/components/schemas/PlayerRisk'
                    description: The player
                default:
                    $ref: '#/components/responses/Error'
            summary: A player's risk group and bet block
            tags:
                - Risk
            x-scope: risk.view
        parameters:
            - $ref: '#/components/parameters/SiteId'
            - description: Your player id (the Launch userId)
              in: path
              name: ref
              required: true
              schema:
                maxLength: 128
                type: string
        put:
            operationId: setPlayerRisk
            parameters:
                - $ref: '#/components/parameters/Actor'
            requestBody:
                content:
                    application/json:
                        schema:
                            $ref: '#/components/schemas/PlayerRiskInput'
                required: true
            responses:
                "200":
                    content:
                        application/json:
                            schema:
                                allOf:
                                    - $ref: '#/components/schemas/Envelope'
                                    - properties:
                                        data:
                                            $ref: '#/components/schemas/PlayerRisk'
                    description: The player
                default:
                    $ref: '#/components/responses/Error'
            summary: Set a player's own risk group and bet block
            tags:
                - Risk
            x-scope: risk.manage
    /sites/{siteId}/reports:
        get:
            operationId: getReport
            parameters:
                - $ref: '#/components/parameters/SiteId'
                - description: Placed >= this (RFC 3339).
                  in: query
                  name: from
                  required: false
                  schema:
                    format: date-time
                    type: string
                - description: Placed < this (RFC 3339).
                  in: query
                  name: to
                  required: false
                  schema:
                    format: date-time
                    type: string
            responses:
                "200":
                    content:
                        application/json:
                            schema:
                                allOf:
                                    - $ref: '#/components/schemas/Envelope'
                                    - properties:
                                        data:
                                            items:
                                                $ref: '#/components/schemas/CurrencyReport'
                                            type: array
                                      type: object
                    description: One row per currency.
                "401":
                    $ref: '#/components/responses/Error'
                "403":
                    $ref: '#/components/responses/Error'
                "422":
                    $ref: '#/components/responses/Error'
                "502":
                    $ref: '#/components/responses/Error'
                "503":
                    $ref: '#/components/responses/Error'
            summary: The ticket book per currency, with the per-site breakdown
            tags:
                - Reports
            x-scope: reports.view
    /sites/{siteId}/reports/by-bet-type:
        get:
            operationId: getReportByBetType
            parameters:
                - $ref: '#/components/parameters/SiteId'
                - description: Only this currency.
                  in: query
                  name: currency
                  required: false
                  schema:
                    type: string
                - description: Placed >= this (RFC 3339).
                  in: query
                  name: from
                  required: false
                  schema:
                    format: date-time
                    type: string
                - description: Placed < this (RFC 3339).
                  in: query
                  name: to
                  required: false
                  schema:
                    format: date-time
                    type: string
            responses:
                "200":
                    content:
                        application/json:
                            schema:
                                allOf:
                                    - $ref: '#/components/schemas/Envelope'
                                    - properties:
                                        data:
                                            items:
                                                $ref: '#/components/schemas/BetTypeReport'
                                            type: array
                                      type: object
                    description: One row per (bet type, currency).
                "401":
                    $ref: '#/components/responses/Error'
                "403":
                    $ref: '#/components/responses/Error'
                "422":
                    $ref: '#/components/responses/Error'
                "502":
                    $ref: '#/components/responses/Error'
                "503":
                    $ref: '#/components/responses/Error'
            summary: The single/combo/system/betbuilder split (sums to the total)
            tags:
                - Reports
            x-scope: reports.view
    /sites/{siteId}/reports/by-match:
        get:
            operationId: getReportByMatch
            parameters:
                - $ref: '#/components/parameters/SiteId'
                - description: Placed >= this (RFC 3339).
                  in: query
                  name: from
                  required: false
                  schema:
                    format: date-time
                    type: string
                - description: Placed < this (RFC 3339).
                  in: query
                  name: to
                  required: false
                  schema:
                    format: date-time
                    type: string
                - description: Default 50; values above 200 fall back to 50.
                  in: query
                  name: limit
                  required: false
                  schema:
                    default: 50
                    maximum: 200
                    type: integer
                - in: query
                  name: offset
                  required: false
                  schema:
                    default: 0
                    minimum: 0
                    type: integer
            responses:
                "200":
                    content:
                        application/json:
                            schema:
                                allOf:
                                    - $ref: '#/components/schemas/Envelope'
                                    - properties:
                                        data:
                                            items:
                                                $ref: '#/components/schemas/MatchReport'
                                            type: array
                                      type: object
                    description: A page of (match, currency) rows.
                "401":
                    $ref: '#/components/responses/Error'
                "403":
                    $ref: '#/components/responses/Error'
                "422":
                    $ref: '#/components/responses/Error'
                "502":
                    $ref: '#/components/responses/Error'
                "503":
                    $ref: '#/components/responses/Error'
            summary: Exposure per match (stake overlaps between matches)
            tags:
                - Reports
            x-scope: tickets.view
    /sites/{siteId}/reports/by-sport:
        get:
            operationId: getReportBySport
            parameters:
                - $ref: '#/components/parameters/SiteId'
                - description: Only this currency.
                  in: query
                  name: currency
                  required: false
                  schema:
                    type: string
                - description: Placed >= this (RFC 3339).
                  in: query
                  name: from
                  required: false
                  schema:
                    format: date-time
                    type: string
                - description: Placed < this (RFC 3339).
                  in: query
                  name: to
                  required: false
                  schema:
                    format: date-time
                    type: string
                - description: Default 10; values above 200 fall back to 10. No offset.
                  in: query
                  name: limit
                  required: false
                  schema:
                    default: 10
                    maximum: 200
                    type: integer
            responses:
                "200":
                    content:
                        application/json:
                            schema:
                                allOf:
                                    - $ref: '#/components/schemas/Envelope'
                                    - properties:
                                        data:
                                            items:
                                                $ref: '#/components/schemas/SportReport'
                                            type: array
                                      type: object
                    description: The top sports.
                "401":
                    $ref: '#/components/responses/Error'
                "403":
                    $ref: '#/components/responses/Error'
                "422":
                    $ref: '#/components/responses/Error'
                "502":
                    $ref: '#/components/responses/Error'
                "503":
                    $ref: '#/components/responses/Error'
            summary: Turnover per sport (stake overlaps between sports)
            tags:
                - Reports
            x-scope: reports.view
    /sites/{siteId}/reports/daily:
        get:
            operationId: getDailyReport
            parameters:
                - $ref: '#/components/parameters/SiteId'
                - description: Only this currency.
                  in: query
                  name: currency
                  required: false
                  schema:
                    type: string
                - description: Placed >= this (RFC 3339).
                  in: query
                  name: from
                  required: false
                  schema:
                    format: date-time
                    type: string
                - description: Placed < this (RFC 3339).
                  in: query
                  name: to
                  required: false
                  schema:
                    format: date-time
                    type: string
            responses:
                "200":
                    content:
                        application/json:
                            schema:
                                allOf:
                                    - $ref: '#/components/schemas/Envelope'
                                    - properties:
                                        data:
                                            items:
                                                $ref: '#/components/schemas/DailyPoint'
                                            type: array
                                      type: object
                    description: One row per day.
                "401":
                    $ref: '#/components/responses/Error'
                "403":
                    $ref: '#/components/responses/Error'
                "422":
                    $ref: '#/components/responses/Error'
                "502":
                    $ref: '#/components/responses/Error'
                "503":
                    $ref: '#/components/responses/Error'
            summary: The ticket book per UTC day (days without tickets are absent)
            tags:
                - Reports
            x-scope: reports.view
    /sites/{siteId}/risk-groups:
        get:
            description: Ordered by id, not paged.
            operationId: listRiskGroups
            parameters:
                - description: Only groups in this currency (case-insensitive).
                  in: query
                  name: currency
                  required: false
                  schema:
                    example: EUR
                    type: string
            responses:
                "200":
                    content:
                        application/json:
                            schema:
                                allOf:
                                    - $ref: '#/components/schemas/Envelope'
                                    - properties:
                                        data:
                                            items:
                                                $ref: '#/components/schemas/RiskGroup'
                                            type: array
                                        meta:
                                            $ref: '#/components/schemas/ListMeta'
                                      type: object
                    description: The risk groups.
                default:
                    $ref: '#/components/responses/Error'
            summary: List the site's risk groups
            tags:
                - Risk
            x-scope: risk.view
        parameters:
            - $ref: '#/components/parameters/SiteId'
        post:
            description: The site is the path site; a body site_id is overwritten.
            operationId: createRiskGroup
            parameters:
                - $ref: '#/components/parameters/Actor'
            requestBody:
                content:
                    application/json:
                        schema:
                            $ref: '#/components/schemas/RiskGroupRequest'
                required: true
            responses:
                "201":
                    content:
                        application/json:
                            schema:
                                allOf:
                                    - $ref: '#/components/schemas/Envelope'
                                    - properties:
                                        data:
                                            $ref: '#/components/schemas/RiskGroup'
                                      type: object
                    description: Created.
                default:
                    $ref: '#/components/responses/Error'
                    description: 422 validation.bad_body (name empty), 422 validation.invalid_currency, 409 risk_group.duplicate, or a common error.
            summary: Create a risk group
            tags:
                - Risk
            x-scope: risk.manage
    /sites/{siteId}/risk-groups/{id}:
        delete:
            description: Cascades every node and market limit of the group. 409 when players or partners are assigned to it.
            operationId: deleteRiskGroup
            parameters:
                - $ref: '#/components/parameters/Actor'
            responses:
                "204":
                    description: Deleted.
                default:
                    $ref: '#/components/responses/Error'
                    description: 409 risk_group.in_use, 404 not_found, 422 validation.invalid_id, or a common error.
            summary: Delete a risk group and all its limits
            tags:
                - Risk
            x-scope: risk.manage
        parameters:
            - $ref: '#/components/parameters/SiteId'
            - description: Risk group id. Must belong to the path site, else 404 not_found.
              in: path
              name: id
              required: true
              schema:
                example: "9"
                pattern: ^[0-9]+$
                type: string
        put:
            description: Full replace; an omitted allowHigherPayout is stored as false. id/site_id in the body are ignored.
            operationId: updateRiskGroup
            parameters:
                - $ref: '#/components/parameters/Actor'
            requestBody:
                content:
                    application/json:
                        schema:
                            $ref: '#/components/schemas/RiskGroupRequest'
                required: true
            responses:
                "200":
                    content:
                        application/json:
                            schema:
                                allOf:
                                    - $ref: '#/components/schemas/Envelope'
                                    - properties:
                                        data:
                                            $ref: '#/components/schemas/RiskGroup'
                                      type: object
                    description: Updated.
                default:
                    $ref: '#/components/responses/Error'
                    description: 404 not_found, 422 validation.invalid_id, 422 validation.bad_body, 422 validation.invalid_currency, or a common error.
            summary: Replace a risk group's name, currency and allowHigherPayout
            tags:
                - Risk
            x-scope: risk.manage
    /sites/{siteId}/risk-groups/{id}/markets:
        get:
            description: |
                The node is picked by level + the matching id. sportId also narrows the list to the markets that sport offers (pass it at every level). configured=true returns only the capped markets, unpaged.
            operationId: listRiskGroupMarkets
            parameters:
                - in: query
                  name: level
                  required: true
                  schema:
                    $ref: '#/components/schemas/RiskLevel'
                - description: Required when level=sport.
                  in: query
                  name: sportId
                  required: false
                  schema:
                    maximum: 2147483647
                    minimum: 1
                    type: integer
                - description: Required when level=category.
                  in: query
                  name: categoryId
                  required: false
                  schema:
                    maximum: 2147483647
                    minimum: 1
                    type: integer
                - description: Required when level=tournament.
                  in: query
                  name: tournamentId
                  required: false
                  schema:
                    maximum: 2147483647
                    minimum: 1
                    type: integer
                - in: query
                  name: configured
                  required: false
                  schema:
                    default: false
                    type: boolean
                - description: Market name substring or exact market type id.
                  in: query
                  name: q
                  required: false
                  schema:
                    type: string
                - in: query
                  name: limit
                  required: false
                  schema:
                    default: 50
                    maximum: 200
                    minimum: 1
                    type: integer
                - in: query
                  name: offset
                  required: false
                  schema:
                    default: 0
                    minimum: 0
                    type: integer
            responses:
                "200":
                    content:
                        application/json:
                            schema:
                                allOf:
                                    - $ref: '#/components/schemas/Envelope'
                                    - properties:
                                        data:
                                            items:
                                                $ref: '#/components/schemas/RiskMarket'
                                            type: array
                                        meta:
                                            $ref: '#/components/schemas/ListMeta'
                                      type: object
                    description: The market types.
                default:
                    $ref: '#/components/responses/Error'
                    description: 422 risk_node.invalid_level, 422 risk_node.missing_scope_id, 404 not_found, 503 db_unavailable, or a common error.
            summary: Market types under one node with the group's stake caps
            tags:
                - Risk
            x-scope: risk.view
        parameters:
            - $ref: '#/components/parameters/SiteId'
            - description: Risk group id. Must belong to the path site, else 404 not_found.
              in: path
              name: id
              required: true
              schema:
                example: "9"
                pattern: ^[0-9]+$
                type: string
        put:
            description: Both caps null removes the override. A cap must be > 0 (0 would mean inherit on market tiers).
            operationId: upsertRiskMarket
            parameters:
                - $ref: '#/components/parameters/Actor'
            requestBody:
                content:
                    application/json:
                        schema:
                            $ref: '#/components/schemas/RiskMarketRequest'
                required: true
            responses:
                "200":
                    content:
                        application/json:
                            schema:
                                allOf:
                                    - $ref: '#/components/schemas/Envelope'
                                    - properties:
                                        data:
                                            $ref: '#/components/schemas/RiskMarket'
                                      type: object
                    description: The resulting market limit.
                default:
                    $ref: '#/components/responses/Error'
                    description: 422 risk_node.invalid_level, 422 risk_node.missing_scope_id, 422 risk_market.unknown_market_type, 422 risk_market.invalid_stake, 404 not_found, or a common error.
            summary: Set or clear one market type's stake caps under one node
            tags:
                - Risk
            x-scope: risk.manage
    /sites/{siteId}/risk-groups/{id}/nodes:
        delete:
            description: Idempotent. Market limits under the node are not removed.
            operationId: deleteRiskNode
            parameters:
                - $ref: '#/components/parameters/Actor'
                - in: query
                  name: level
                  required: true
                  schema:
                    $ref: '#/components/schemas/RiskLevel'
                - description: Required when level=sport.
                  in: query
                  name: sportId
                  required: false
                  schema:
                    maximum: 2147483647
                    minimum: 1
                    type: integer
                - description: Required when level=category.
                  in: query
                  name: categoryId
                  required: false
                  schema:
                    maximum: 2147483647
                    minimum: 1
                    type: integer
                - description: Required when level=tournament.
                  in: query
                  name: tournamentId
                  required: false
                  schema:
                    maximum: 2147483647
                    minimum: 1
                    type: integer
            responses:
                "204":
                    description: Reverted.
                default:
                    $ref: '#/components/responses/Error'
                    description: 422 risk_node.invalid_level, 422 risk_node.missing_scope_id, 404 not_found, or a common error.
            summary: Revert one node to inherited
            tags:
                - Risk
            x-scope: risk.manage
        parameters:
            - $ref: '#/components/parameters/SiteId'
            - description: Risk group id. Must belong to the path site, else 404 not_found.
              in: path
              name: id
              required: true
              schema:
                example: "9"
                pattern: ^[0-9]+$
                type: string
        put:
            description: |
                Full replace: every omitted field is stored as null (inherit). Only the id matching level is used. Values are not range-checked; 0 is a literal block, not unlimited.
            operationId: upsertRiskNode
            parameters:
                - $ref: '#/components/parameters/Actor'
            requestBody:
                content:
                    application/json:
                        schema:
                            $ref: '#/components/schemas/RiskNodeRequest'
                required: true
            responses:
                "200":
                    content:
                        application/json:
                            schema:
                                allOf:
                                    - $ref: '#/components/schemas/Envelope'
                                    - properties:
                                        data:
                                            $ref: '#/components/schemas/RiskNode'
                                      type: object
                    description: The resulting node.
                default:
                    $ref: '#/components/responses/Error'
                    description: 422 risk_node.invalid_level, 422 risk_node.missing_scope_id, 404 not_found, or a common error.
            summary: Create or replace one node's limits
            tags:
                - Risk
            x-scope: risk.manage
    /sites/{siteId}/risk-groups/{id}/players:
        get:
            operationId: listRiskGroupPlayers
            parameters:
                - $ref: '#/components/parameters/SiteId'
                - in: path
                  name: id
                  required: true
                  schema:
                    type: string
                - in: query
                  name: limit
                  schema:
                    default: 100
                    maximum: 500
                    type: integer
                - in: query
                  name: offset
                  schema:
                    default: 0
                    type: integer
            responses:
                "200":
                    content:
                        application/json:
                            schema:
                                allOf:
                                    - $ref: '#/components/schemas/Envelope'
                                    - properties:
                                        data:
                                            items:
                                                $ref: '#/components/schemas/GroupPlayer'
                                            type: array
                    description: Players
                default:
                    $ref: '#/components/responses/Error'
            summary: Players whose own group is this one
            tags:
                - Risk
            x-scope: risk.view
    /sites/{siteId}/risk-groups/{id}/tree:
        get:
            description: |
                No sport_id → sports; sport_id → that sport's categories; sport_id + category_id → that category's tournaments. Every catalogue entry is listed; unconfigured ones have all fields null (inherit). meta.total counts catalogue entries.
            operationId: getRiskGroupTree
            parameters:
                - in: query
                  name: sport_id
                  required: false
                  schema:
                    minimum: 1
                    type: integer
                - description: Only used together with sport_id.
                  in: query
                  name: category_id
                  required: false
                  schema:
                    minimum: 1
                    type: integer
                - description: Case-insensitive name substring.
                  in: query
                  name: q
                  required: false
                  schema:
                    type: string
                - in: query
                  name: limit
                  required: false
                  schema:
                    default: 50
                    maximum: 200
                    minimum: 1
                    type: integer
                - in: query
                  name: offset
                  required: false
                  schema:
                    default: 0
                    minimum: 0
                    type: integer
            responses:
                "200":
                    content:
                        application/json:
                            schema:
                                allOf:
                                    - $ref: '#/components/schemas/Envelope'
                                    - properties:
                                        data:
                                            items:
                                                $ref: '#/components/schemas/RiskNode'
                                            type: array
                                        meta:
                                            $ref: '#/components/schemas/ListMeta'
                                      type: object
                    description: The nodes at that level.
                default:
                    $ref: '#/components/responses/Error'
                    description: 404 not_found, 503 db_unavailable (catalogue), or a common error.
            summary: One level of a risk group's sport/category/tournament tree
            tags:
                - Risk
            x-scope: risk.view
        parameters:
            - $ref: '#/components/parameters/SiteId'
            - description: Risk group id. Must belong to the path site, else 404 not_found.
              in: path
              name: id
              required: true
              schema:
                example: "9"
                pattern: ^[0-9]+$
                type: string
    /sites/{siteId}/risk-groups/seed-defaults:
        parameters:
            - $ref: '#/components/parameters/SiteId'
        post:
            description: |
                Inserts the site-wide wildcard base row (prematch and live: min bet size 1, max bet size 20, min stake 1, max stake 1000, max payout 10000, active true) when absent. Idempotent; never overwrites an existing base row (seeded=false). Body empty or {}.
            operationId: seedRiskDefaults
            parameters:
                - $ref: '#/components/parameters/Actor'
            requestBody:
                content:
                    application/json:
                        schema:
                            additionalProperties: false
                            properties: {}
                            type: object
                required: false
            responses:
                "200":
                    content:
                        application/json:
                            schema:
                                allOf:
                                    - $ref: '#/components/schemas/Envelope'
                                    - properties:
                                        data:
                                            $ref: '#/components/schemas/RiskSeedResult'
                                      type: object
                    description: Seed result.
                default:
                    $ref: '#/components/responses/Error'
            summary: Ensure the site's base (scope 9) risk limits exist
            tags:
                - Risk
            x-scope: risk.manage
    /sites/{siteId}/site-settings:
        get:
            operationId: getSiteSettings
            responses:
                "200":
                    content:
                        application/json:
                            schema:
                                allOf:
                                    - $ref: '#/components/schemas/Envelope'
                                    - properties:
                                        data:
                                            $ref: '#/components/schemas/SiteSettings'
                    description: Settings
                default:
                    $ref: '#/components/responses/Error'
            summary: The site's settings (platform-owned part read-only)
            tags:
                - Site settings
            x-scope: sportsbook.view
        parameters:
            - $ref: '#/components/parameters/SiteId'
        patch:
            operationId: patchSiteSettings
            parameters:
                - $ref: '#/components/parameters/Actor'
            requestBody:
                content:
                    application/json:
                        schema:
                            $ref: '#/components/schemas/SiteSettingsPatch'
                required: true
            responses:
                "200":
                    content:
                        application/json:
                            schema:
                                allOf:
                                    - $ref: '#/components/schemas/Envelope'
                                    - properties:
                                        data:
                                            $ref: '#/components/schemas/SiteSettings'
                    description: Settings
                default:
                    $ref: '#/components/responses/Error'
            summary: Change the operator-owned settings (partial; null resets a section)
            tags:
                - Site settings
            x-scope: sportsbook.configure
    /sites/{siteId}/stake-limits:
        get:
            operationId: getStakeLimits
            responses:
                "200":
                    content:
                        application/json:
                            schema:
                                allOf:
                                    - $ref: '#/components/schemas/Envelope'
                                    - properties:
                                        data:
                                            $ref: '#/components/schemas/StakeLimits'
                    description: Limits
                default:
                    $ref: '#/components/responses/Error'
            summary: The site's base stake limits (players without a risk group)
            tags:
                - Risk
            x-scope: risk.view
        parameters:
            - $ref: '#/components/parameters/SiteId'
        put:
            operationId: putStakeLimits
            parameters:
                - $ref: '#/components/parameters/Actor'
            requestBody:
                content:
                    application/json:
                        schema:
                            $ref: '#/components/schemas/StakeLimits'
                required: true
            responses:
                "200":
                    content:
                        application/json:
                            schema:
                                allOf:
                                    - $ref: '#/components/schemas/Envelope'
                                    - properties:
                                        data:
                                            $ref: '#/components/schemas/StakeLimits'
                    description: The limits as stored
                default:
                    $ref: '#/components/responses/Error'
            summary: Replace the site's base stake limits
            tags:
                - Risk
            x-scope: risk.manage
    /sites/{siteId}/tickets:
        get:
            operationId: listTickets
            parameters:
                - $ref: '#/components/parameters/SiteId'
                - description: A ticketStatuses value (case-insensitive); unknown = empty list.
                  in: query
                  name: status
                  required: false
                  schema:
                    enum:
                        - PENDING
                        - WALLET_FAILED
                        - OPEN
                        - SETTLING
                        - WON
                        - LOST
                        - CANCELLED
                        - ROLLBACK_PENDING
                        - CASHED_OUT
                        - VOID
                    type: string
                - description: Exact player id.
                  in: query
                  name: player
                  required: false
                  schema:
                    type: string
                - description: Tickets with a leg on this match.
                  in: query
                  name: eventId
                  required: false
                  schema:
                    pattern: ^-?[0-9]+$
                    type: string
                - description: Placed >= this (RFC 3339).
                  in: query
                  name: from
                  required: false
                  schema:
                    format: date-time
                    type: string
                - description: Placed < this (RFC 3339
                  exclusive).: null
                  in: query
                  name: to
                  required: false
                  schema:
                    format: date-time
                    type: string
                - description: Default 50; values above 200 fall back to 50.
                  in: query
                  name: limit
                  required: false
                  schema:
                    default: 50
                    maximum: 200
                    type: integer
                - description: Ignored with cursor.
                  in: query
                  name: offset
                  required: false
                  schema:
                    default: 0
                    minimum: 0
                    type: integer
                - description: The previous page's meta.nextCursor (absent on the last page). 400 validation.bad_cursor for a value this API did not issue.
                  in: query
                  name: cursor
                  required: false
                  schema:
                    type: string
            responses:
                "200":
                    content:
                        application/json:
                            schema:
                                allOf:
                                    - $ref: '#/components/schemas/Envelope'
                                    - properties:
                                        data:
                                            items:
                                                $ref: '#/components/schemas/Ticket'
                                            type: array
                                      type: object
                    description: A page of tickets; meta.nextCursor continues it.
                "401":
                    $ref: '#/components/responses/Error'
                "403":
                    $ref: '#/components/responses/Error'
                "422":
                    $ref: '#/components/responses/Error'
                "502":
                    $ref: '#/components/responses/Error'
                "503":
                    $ref: '#/components/responses/Error'
            summary: The site's tickets, newest first
            tags:
                - Tickets
            x-scope: tickets.view
    /sites/{siteId}/tickets/{id}:
        get:
            operationId: getTicket
            parameters:
                - $ref: '#/components/parameters/SiteId'
                - as a string): null
                  description: Ticket id (64-bit
                  in: path
                  name: id
                  required: true
                  schema:
                    type: string
            responses:
                "200":
                    content:
                        application/json:
                            schema:
                                allOf:
                                    - $ref: '#/components/schemas/Envelope'
                                    - properties:
                                        data:
                                            $ref: '#/components/schemas/TicketDetail'
                    description: The ticket
                default:
                    $ref: '#/components/responses/Error'
            summary: One ticket with its legs named
            tags:
                - Tickets
            x-scope: tickets.view
    /sites/{siteId}/tickets/{id}/cancel:
        post:
            description: 'OPEN/SETTLING/LOST: the stake is refunded. WON/VOID: the payout is reversed first, then the stake is refunded. CASHED_OUT, a partial cash-out, or a ticket cancelled by the provider or the player: 409. A repeat of an operator''s cancel answers 200 with repeat=true and moves no money. Requires X-Actor.'
            operationId: cancelTicket
            parameters:
                - $ref: '#/components/parameters/SiteId'
                - description: Ticket id (digits only).
                  in: path
                  name: id
                  required: true
                  schema:
                    pattern: ^[0-9]+$
                    type: string
                - description: The admin making the change.
                  in: header
                  name: X-Actor
                  required: true
                  schema:
                    type: string
            requestBody:
                content:
                    application/json:
                        schema:
                            properties:
                                reason:
                                    maxLength: 500
                                    type: string
                            required:
                                - reason
                            type: object
                required: true
            responses:
                "200":
                    content:
                        application/json:
                            schema:
                                allOf:
                                    - $ref: '#/components/schemas/Envelope'
                                    - properties:
                                        data:
                                            properties:
                                                cancelReason:
                                                    type: string
                                                cancelledAt:
                                                    format: date-time
                                                    type: string
                                                cancelledBy:
                                                    type: string
                                                currency:
                                                    type: string
                                                refunded:
                                                    description: Decimal string.
                                                    type: string
                                                repeat:
                                                    type: boolean
                                                reversed:
                                                    description: Decimal string; 0 when nothing was paid.
                                                    type: string
                                                status:
                                                    enum:
                                                        - cancelled
                                                    type: string
                                                ticketId:
                                                    type: string
                                            type: object
                                      type: object
                    description: Cancelled (or already cancelled by an operator — repeat=true).
                "400":
                    $ref: '#/components/responses/Error'
                "401":
                    $ref: '#/components/responses/Error'
                "403":
                    $ref: '#/components/responses/Error'
                "404":
                    $ref: '#/components/responses/Error'
                "409":
                    $ref: '#/components/responses/Error'
                "422":
                    $ref: '#/components/responses/Error'
                "502":
                    $ref: '#/components/responses/Error'
                "503":
                    $ref: '#/components/responses/Error'
            summary: Cancel a player's bet (refund the stake, reverse a payout)
            tags:
                - Tickets
            x-scope: tickets.cancel
    /sites/{siteId}/tickets/{id}/history:
        get:
            operationId: getTicketHistory
            parameters:
                - $ref: '#/components/parameters/SiteId'
                - description: Ticket id (digits only).
                  in: path
                  name: id
                  required: true
                  schema:
                    pattern: ^[0-9]+$
                    type: string
            responses:
                "200":
                    content:
                        application/json:
                            schema:
                                allOf:
                                    - $ref: '#/components/schemas/Envelope'
                                    - properties:
                                        data:
                                            items:
                                                properties:
                                                    actor:
                                                        type: string
                                                    amount:
                                                        type: number
                                                    at:
                                                        format: date-time
                                                        type: string
                                                    eventId:
                                                        type: string
                                                    initiator:
                                                        enum:
                                                            - feed
                                                            - player
                                                            - operator
                                                            - platform
                                                        type: string
                                                    kind:
                                                        enum:
                                                            - settlement
                                                            - reopen
                                                            - correction
                                                            - cancel
                                                            - uncancel
                                                            - cashout
                                                        type: string
                                                    partial:
                                                        type: boolean
                                                    reason:
                                                        type: string
                                                    ticketStatus:
                                                        type: string
                                                type: object
                                            type: array
                                      type: object
                    description: The history.
                "400":
                    $ref: '#/components/responses/Error'
                "401":
                    $ref: '#/components/responses/Error'
                "403":
                    $ref: '#/components/responses/Error'
                "404":
                    $ref: '#/components/responses/Error'
                "502":
                    $ref: '#/components/responses/Error'
            summary: A ticket's settlements, corrections, cancels and cash-outs, oldest first, with who and why
            tags:
                - Tickets
            x-scope: tickets.view
    /sites/{siteId}/tickets/{id}/offers:
        get:
            operationId: listTicketOffers
            parameters:
                - $ref: '#/components/parameters/SiteId'
                - description: Ticket id (positive integer).
                  in: path
                  name: id
                  required: true
                  schema:
                    pattern: ^[0-9]+$
                    type: string
                - description: 1-based page.
                  in: query
                  name: page
                  required: false
                  schema:
                    default: 1
                    minimum: 1
                    type: integer
                - description: Default 20, capped at 100.
                  in: query
                  name: limit
                  required: false
                  schema:
                    default: 20
                    maximum: 100
                    type: integer
            responses:
                "200":
                    content:
                        application/json:
                            schema:
                                allOf:
                                    - $ref: '#/components/schemas/Envelope'
                                    - properties:
                                        data:
                                            items:
                                                $ref: '#/components/schemas/CashoutOffer'
                                            type: array
                                      type: object
                    description: A page of offers.
                "400":
                    $ref: '#/components/responses/Error'
                    description: validation.invalid_id.
                "401":
                    $ref: '#/components/responses/Error'
                "403":
                    $ref: '#/components/responses/Error'
                "502":
                    $ref: '#/components/responses/Error'
                "503":
                    $ref: '#/components/responses/Error'
                    description: internal_error — the cashout engine is not connected to this deployment.
            summary: A ticket's cashout offer history
            tags:
                - Cashout
            x-scope: cashout.configure
    /sites/{siteId}/tickets/{id}/selections:
        get:
            operationId: listTicketSelections
            parameters:
                - $ref: '#/components/parameters/SiteId'
                - description: Ticket id (digits only).
                  in: path
                  name: id
                  required: true
                  schema:
                    pattern: ^[0-9]+$
                    type: string
            responses:
                "200":
                    content:
                        application/json:
                            schema:
                                allOf:
                                    - $ref: '#/components/schemas/Envelope'
                                    - properties:
                                        data:
                                            items:
                                                $ref: '#/components/schemas/ResolvedSelection'
                                            type: array
                                      type: object
                    description: The legs.
                "400":
                    $ref: '#/components/responses/Error'
                "401":
                    $ref: '#/components/responses/Error'
                "403":
                    $ref: '#/components/responses/Error'
                "404":
                    $ref: '#/components/responses/Error'
                "502":
                    $ref: '#/components/responses/Error'
                "503":
                    $ref: '#/components/responses/Error'
            summary: A ticket's legs with names resolved
            tags:
                - Tickets
            x-scope: tickets.view
    /sites/{siteId}/tickets/{id}/wallet-events:
        get:
            operationId: listTicketWalletEvents
            parameters:
                - $ref: '#/components/parameters/SiteId'
                - description: Ticket id (digits only).
                  in: path
                  name: id
                  required: true
                  schema:
                    pattern: ^[0-9]+$
                    type: string
            responses:
                "200":
                    content:
                        application/json:
                            schema:
                                allOf:
                                    - $ref: '#/components/schemas/Envelope'
                                    - properties:
                                        data:
                                            items:
                                                $ref: '#/components/schemas/WalletEvent'
                                            type: array
                                      type: object
                    description: The wallet events.
                "400":
                    $ref: '#/components/responses/Error'
                "401":
                    $ref: '#/components/responses/Error'
                "403":
                    $ref: '#/components/responses/Error'
                "404":
                    $ref: '#/components/responses/Error'
                "502":
                    $ref: '#/components/responses/Error'
                "503":
                    $ref: '#/components/responses/Error'
            summary: The wallet calls made for a ticket, oldest first
            tags:
                - Tickets
            x-scope: tickets.view
    /sites/{siteId}/ui-copy:
        get:
            operationId: listUiCopy
            parameters:
                - $ref: '#/components/parameters/SiteId'
                - description: Exact language code.
                  in: query
                  name: lang
                  required: false
                  schema:
                    type: string
                - description: Literal key prefix (e.g. betslip.).
                  in: query
                  name: prefix
                  required: false
                  schema:
                    type: string
                - description: Substring of the key, the default or the override (case-insensitive).
                  in: query
                  name: q
                  required: false
                  schema:
                    type: string
                - description: '"true" = only rows this site overrides.'
                  in: query
                  name: onlyOverridden
                  required: false
                  schema:
                    default: false
                    type: boolean
                - description: No default and no cap — omitted returns every row.
                  in: query
                  name: limit
                  required: false
                  schema:
                    minimum: 1
                    type: integer
                - in: query
                  name: offset
                  required: false
                  schema:
                    default: 0
                    minimum: 0
                    type: integer
            responses:
                "200":
                    content:
                        application/json:
                            schema:
                                allOf:
                                    - $ref: '#/components/schemas/Envelope'
                                    - properties:
                                        data:
                                            items:
                                                $ref: '#/components/schemas/UiCopyRow'
                                            type: array
                                      type: object
                    description: A page of rows.
                "401":
                    $ref: '#/components/responses/Error'
                "403":
                    $ref: '#/components/responses/Error'
                "503":
                    $ref: '#/components/responses/Error'
            summary: The UI-text catalogue with this site's overrides
            tags:
                - Translations
            x-scope: uicopy.configure
    /sites/{siteId}/ui-copy/{key}/{lang}:
        delete:
            operationId: deleteUiCopy
            parameters:
                - $ref: '#/components/parameters/SiteId'
                - $ref: '#/components/parameters/Actor'
                - in: path
                  name: key
                  required: true
                  schema:
                    type: string
                - in: path
                  name: lang
                  required: true
                  schema:
                    type: string
            responses:
                "204":
                    description: Reverted. Empty body, no envelope.
                "400":
                    $ref: '#/components/responses/Error'
                "401":
                    $ref: '#/components/responses/Error'
                "403":
                    $ref: '#/components/responses/Error'
                "404":
                    $ref: '#/components/responses/Error'
                    description: not_found — this site does not override that key.
                "503":
                    $ref: '#/components/responses/Error'
            summary: Revert one key to the default wording
            tags:
                - Translations
            x-scope: uicopy.configure
        put:
            description: |
                The key must exist in the catalogue for this language (else 404). The text must
                carry exactly the key's {{placeholders}} — none missing, none extra (else 422).
                Up to ~10 minutes to reach players (caches).
            operationId: putUiCopy
            parameters:
                - $ref: '#/components/parameters/SiteId'
                - $ref: '#/components/parameters/Actor'
                - description: The key, dots included (betslip.max_stake).
                  in: path
                  name: key
                  required: true
                  schema:
                    type: string
                - in: path
                  name: lang
                  required: true
                  schema:
                    type: string
            requestBody:
                content:
                    application/json:
                        schema:
                            $ref: '#/components/schemas/UiCopyInput'
                required: true
            responses:
                "200":
                    content:
                        application/json:
                            schema:
                                allOf:
                                    - $ref: '#/components/schemas/Envelope'
                                    - properties:
                                        data:
                                            $ref: '#/components/schemas/UiCopyRow'
                                      type: object
                    description: The row (updatedAt not included).
                "400":
                    $ref: '#/components/responses/Error'
                "401":
                    $ref: '#/components/responses/Error'
                "403":
                    $ref: '#/components/responses/Error'
                "404":
                    $ref: '#/components/responses/Error'
                    description: not_found — no such key in the catalogue for this language.
                "422":
                    $ref: '#/components/responses/Error'
                    description: validation.bad_body — malformed body (422 here, not 400), blank text, or placeholder mismatch.
                "503":
                    $ref: '#/components/responses/Error'
            summary: Override one key's wording in one language
            tags:
                - Translations
            x-scope: uicopy.configure
    /sites/{siteId}/ui-copy/languages:
        get:
            operationId: listUiCopyLanguages
            parameters:
                - $ref: '#/components/parameters/SiteId'
            responses:
                "200":
                    content:
                        application/json:
                            schema:
                                allOf:
                                    - $ref: '#/components/schemas/Envelope'
                                    - properties:
                                        data:
                                            example:
                                                - de
                                                - en
                                                - tr
                                            items:
                                                type: string
                                            type: array
                                      type: object
                    description: Sorted language codes.
                "401":
                    $ref: '#/components/responses/Error'
                "403":
                    $ref: '#/components/responses/Error'
                "503":
                    $ref: '#/components/responses/Error'
            summary: The languages the catalogue has wording for
            tags:
                - Translations
            x-scope: uicopy.configure
    /sites/{siteId}/wallet-signing-keys:
        get:
            operationId: listWalletSigningKeys
            responses:
                "200":
                    content:
                        application/json:
                            schema:
                                allOf:
                                    - $ref: '#/components/schemas/Envelope'
                                    - properties:
                                        data:
                                            items:
                                                $ref: '#/components/schemas/WalletSigningKey'
                                            type: array
                    description: Keys, newest first; `signing` marks the one in use
                default:
                    $ref: '#/components/responses/Error'
            summary: The keys the site's wallet calls are signed with (public halves only)
            tags:
                - Wallet signing keys
            x-scope: sportsbook.view
        parameters:
            - $ref: '#/components/parameters/SiteId'
        post:
            operationId: createWalletSigningKey
            parameters:
                - $ref: '#/components/parameters/Actor'
            responses:
                "201":
                    content:
                        application/json:
                            schema:
                                allOf:
                                    - $ref: '#/components/schemas/Envelope'
                                    - properties:
                                        data:
                                            $ref: '#/components/schemas/WalletSigningKey'
                    description: The new key
                default:
                    $ref: '#/components/responses/Error'
            summary: Create a key; the newest active key signs the site's calls within 30 s
            tags:
                - Wallet signing keys
            x-scope: sportsbook.configure
    /sites/{siteId}/wallet-signing-keys/{keyId}/retire:
        parameters:
            - $ref: '#/components/parameters/SiteId'
            - description: Key id, e.g. wk_3f9a1c0d2b7e4a51
              in: path
              name: keyId
              required: true
              schema:
                type: string
        post:
            operationId: retireWalletSigningKey
            parameters:
                - $ref: '#/components/parameters/Actor'
            responses:
                "200":
                    content:
                        application/json:
                            schema:
                                allOf:
                                    - $ref: '#/components/schemas/Envelope'
                                    - properties:
                                        data:
                                            items:
                                                $ref: '#/components/schemas/WalletSigningKey'
                                            type: array
                    description: The site's keys after the change
                default:
                    $ref: '#/components/responses/Error'
            summary: Stop a key signing (kept for the audit trail)
            tags:
                - Wallet signing keys
            x-scope: sportsbook.configure
    /sites/{siteId}/wallet-test:
        post:
            description: |
                Up to 7 sequential calls (bet, bet_replay, bet_rollback, bet_rollback_replay, win,
                win_replay, win_rollback) against the SAVED wallet URL, each with the production
                wallet timeout. Debits and credits the named test player on your ledger; every one
                is reversed, so a correct wallet nets to zero. Answers 200 even when steps fail —
                read the verdicts and ledgerDelta.
            operationId: runWalletTest
            parameters:
                - $ref: '#/components/parameters/SiteId'
                - $ref: '#/components/parameters/Actor'
            requestBody:
                content:
                    application/json:
                        schema:
                            $ref: '#/components/schemas/WalletTestInput'
                required: true
            responses:
                "200":
                    content:
                        application/json:
                            schema:
                                allOf:
                                    - $ref: '#/components/schemas/Envelope'
                                    - properties:
                                        data:
                                            $ref: '#/components/schemas/WalletTestReport'
                                      type: object
                    description: The run report.
                "400":
                    $ref: '#/components/responses/Error'
                "401":
                    $ref: '#/components/responses/Error'
                "403":
                    $ref: '#/components/responses/Error'
                "422":
                    $ref: '#/components/responses/Error'
                    description: validation.bad_body — no wallet URL saved, userId/currency missing, amount not in (0, 100].
                "503":
                    $ref: '#/components/responses/Error'
                    description: internal_error — wallet testing is not configured.
            summary: Run the saved wallet through the money-path sequence (moves real money, net-zero)
            tags:
                - Site settings
            x-scope: sportsbook.configure
    /sites/{siteId}/wallet-url:
        get:
            operationId: getWalletUrl
            parameters:
                - $ref: '#/components/parameters/SiteId'
            responses:
                "200":
                    content:
                        application/json:
                            schema:
                                allOf:
                                    - $ref: '#/components/schemas/Envelope'
                                    - properties:
                                        data:
                                            $ref: '#/components/schemas/WalletUrl'
                                      type: object
                    description: The wallet URL ("" when unset).
                "401":
                    $ref: '#/components/responses/Error'
                "403":
                    $ref: '#/components/responses/Error'
            summary: The site's seamless-wallet base URL
            tags:
                - Site settings
            x-scope: sportsbook.view
        put:
            operationId: setWalletUrl
            parameters:
                - $ref: '#/components/parameters/SiteId'
                - $ref: '#/components/parameters/Actor'
            requestBody:
                content:
                    application/json:
                        schema:
                            $ref: '#/components/schemas/WalletUrl'
                required: true
            responses:
                "200":
                    content:
                        application/json:
                            schema:
                                allOf:
                                    - $ref: '#/components/schemas/Envelope'
                                    - properties:
                                        data:
                                            $ref: '#/components/schemas/WalletUrl'
                                      type: object
                    description: The stored value.
                "400":
                    $ref: '#/components/responses/Error'
                "401":
                    $ref: '#/components/responses/Error'
                "403":
                    $ref: '#/components/responses/Error'
                "422":
                    $ref: '#/components/responses/Error'
                    description: validation.bad_body — not an absolute http(s) URL.
            summary: Set or clear the wallet URL (redirects live money)
            tags:
                - Site settings
            x-scope: sportsbook.configure
security:
    - bearer: []
    - apiKey: []
servers:
    - url: https://operator-api.oddyne.com/integration/v1
tags:
    - name: Sites
    - name: Dictionaries
    - name: Catalogue
    - name: Matches
    - name: Site settings
    - name: Risk
    - name: Bet delays
    - name: Market settings
    - name: Market groups
    - name: Bonus
    - name: Cashout
    - name: Tickets
    - name: Reports
    - name: Translations
