> ## Documentation Index
> Fetch the complete documentation index at: https://docs.softmax.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Create League Tournament



## OpenAPI

````yaml https://softmax.com/api/observatory/openapi.json post /v2/leagues/{league_id}/tournaments
openapi: 3.1.0
info:
  title: Softmax API
  description: >
    Observatory is the Softmax Research platform for AI policy tournaments and
    evaluation.

    Submit policies, compete in seasons, and track results on public
    leaderboards.


    ---


    ## Authentication


    Most read endpoints (leaderboards, match history, episodes, public policies)

    work without auth. Submitting policies or accessing your own data requires

    a Bearer token:


    ```

    Authorization: Bearer <your-token>

    ```


    To get a token, install [cogames](https://pypi.org/project/cogames/) and
    run:


    ```bash

    cogames auth login

    ```


    A `401` response means no token was provided. A `403` means the token

    is invalid or expired.


    ### Verify your token


    ```bash

    curl -H "Authorization: Bearer <your-token>" \
      https://softmax.com/api/observatory/whoami
    ```


    Returns `{"user_email": "you@example.com"}` on success.
  version: 1.0.0
servers:
  - url: https://softmax.com/api/observatory
security: []
paths:
  /v2/leagues/{league_id}/tournaments:
    post:
      tags:
        - v2
        - v2
      summary: Create League Tournament
      operationId: create_league_tournament_v2_leagues__league_id__tournaments_post
      parameters:
        - name: league_id
          in: path
          required: true
          schema:
            type: string
            pattern: >-
              ^league_[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$
            title: League Id
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateTournamentBody'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TournamentPublic'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - BearerAuth: []
components:
  schemas:
    CreateTournamentBody:
      properties:
        definition:
          $ref: '#/components/schemas/TournamentDefinition-Input'
        idempotency_key:
          type: string
          maxLength: 200
          minLength: 1
          title: Idempotency Key
      additionalProperties: false
      type: object
      required:
        - definition
        - idempotency_key
      title: CreateTournamentBody
    TournamentPublic:
      properties:
        tournament_id:
          type: string
          title: Tournament Id
        league_id:
          type: string
          title: League Id
        name:
          type: string
          title: Name
        status:
          $ref: '#/components/schemas/TournamentStatus'
        definition:
          $ref: '#/components/schemas/TournamentDefinition-Output'
        frozen_entrants:
          anyOf:
            - items:
                $ref: '#/components/schemas/FrozenEntrant'
              type: array
            - type: 'null'
          title: Frozen Entrants
        visualization:
          anyOf:
            - oneOf:
                - $ref: '#/components/schemas/DoubleEliminationView'
              discriminator:
                propertyName: strategy
                mapping:
                  double_elimination:
                    $ref: '#/components/schemas/DoubleEliminationView'
            - type: 'null'
          title: Visualization
        placements:
          anyOf:
            - items:
                $ref: '#/components/schemas/Placement'
              type: array
            - type: 'null'
          title: Placements
        locked_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Locked At
        locked_by:
          anyOf:
            - type: string
            - type: 'null'
          title: Locked By
        started_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Started At
        completed_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Completed At
        error:
          anyOf:
            - type: string
            - type: 'null'
          title: Error
        created_at:
          type: string
          format: date-time
          title: Created At
        idempotency_key:
          anyOf:
            - type: string
            - type: 'null'
          title: Idempotency Key
        requester_user_id:
          type: string
          title: Requester User Id
        host_division_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Host Division Id
        wave_experience_request_ids:
          additionalProperties:
            type: string
          type: object
          title: Wave Experience Request Ids
          default: {}
      additionalProperties: false
      type: object
      required:
        - tournament_id
        - league_id
        - name
        - status
        - definition
        - frozen_entrants
        - visualization
        - placements
        - locked_at
        - locked_by
        - started_at
        - completed_at
        - error
        - created_at
        - idempotency_key
        - requester_user_id
        - host_division_id
        - wave_experience_request_ids
      title: TournamentPublic
      description: Full tournament document served by the detail/lifecycle endpoints.
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    TournamentDefinition-Input:
      properties:
        name:
          type: string
          maxLength: 200
          minLength: 1
          title: Name
        schedule:
          $ref: '#/components/schemas/TournamentScheduleConfig-Input'
        roster_generator:
          oneOf:
            - $ref: '#/components/schemas/ExplicitRosterGenerator-Input'
            - $ref: '#/components/schemas/TopNRosterGenerator-Input'
            - $ref: '#/components/schemas/DivisionAllRosterGenerator-Input'
          title: Roster Generator
          discriminator:
            propertyName: type
            mapping:
              division_all:
                $ref: '#/components/schemas/DivisionAllRosterGenerator-Input'
              explicit:
                $ref: '#/components/schemas/ExplicitRosterGenerator-Input'
              top_n:
                $ref: '#/components/schemas/TopNRosterGenerator-Input'
        round_generator:
          $ref: '#/components/schemas/DoubleEliminationRoundGenerator-Input'
        placements:
          $ref: '#/components/schemas/PlacementsConfig-Input'
      additionalProperties: false
      type: object
      required:
        - name
        - roster_generator
      title: TournamentDefinition
      description: Canonical tournament config stored on the tournament row.
    TournamentStatus:
      type: string
      enum:
        - draft
        - locked
        - running
        - completed
        - cancelled
        - failed
      title: TournamentStatus
    TournamentDefinition-Output:
      properties:
        name:
          type: string
          maxLength: 200
          minLength: 1
          title: Name
        schedule:
          $ref: '#/components/schemas/TournamentScheduleConfig-Output'
        roster_generator:
          oneOf:
            - $ref: '#/components/schemas/ExplicitRosterGenerator-Output'
            - $ref: '#/components/schemas/TopNRosterGenerator-Output'
            - $ref: '#/components/schemas/DivisionAllRosterGenerator-Output'
          title: Roster Generator
          discriminator:
            propertyName: type
            mapping:
              division_all:
                $ref: '#/components/schemas/DivisionAllRosterGenerator-Output'
              explicit:
                $ref: '#/components/schemas/ExplicitRosterGenerator-Output'
              top_n:
                $ref: '#/components/schemas/TopNRosterGenerator-Output'
        round_generator:
          $ref: '#/components/schemas/DoubleEliminationRoundGenerator-Output'
        placements:
          $ref: '#/components/schemas/PlacementsConfig-Output'
      additionalProperties: false
      type: object
      required:
        - name
        - schedule
        - roster_generator
        - round_generator
        - placements
      title: TournamentDefinition
      description: Canonical tournament config stored on the tournament row.
    FrozenEntrant:
      properties:
        entrant_id:
          type: string
          title: Entrant Id
        player_id:
          type: string
          title: Player Id
        policy_version_id:
          type: string
          title: Policy Version Id
        seed:
          type: integer
          title: Seed
        display_name:
          anyOf:
            - type: string
            - type: 'null'
          title: Display Name
        league_policy_membership_id:
          anyOf:
            - type: string
            - type: 'null'
          title: League Policy Membership Id
      additionalProperties: false
      type: object
      required:
        - entrant_id
        - player_id
        - policy_version_id
        - seed
        - display_name
        - league_policy_membership_id
      title: FrozenEntrant
    DoubleEliminationView:
      properties:
        strategy:
          type: string
          const: double_elimination
          title: Strategy
          default: double_elimination
        size:
          type: integer
          title: Size
        grand_final_reset:
          type: boolean
          title: Grand Final Reset
        entrants:
          items:
            $ref: '#/components/schemas/VisualizationEntrant'
          type: array
          title: Entrants
        matches:
          items:
            $ref: '#/components/schemas/BracketMatchView'
          type: array
          title: Matches
        current_round_key:
          anyOf:
            - type: string
            - type: 'null'
          title: Current Round Key
        highlight_match_ids:
          items:
            type: string
          type: array
          title: Highlight Match Ids
        champion_entrant_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Champion Entrant Id
      additionalProperties: false
      type: object
      required:
        - strategy
        - size
        - grand_final_reset
        - entrants
        - matches
        - current_round_key
        - highlight_match_ids
        - champion_entrant_id
      title: DoubleEliminationView
    Placement:
      properties:
        entrant_id:
          type: string
          title: Entrant Id
        player_id:
          type: string
          title: Player Id
        rank:
          type: integer
          title: Rank
        tier:
          anyOf:
            - type: string
            - type: 'null'
          title: Tier
        score:
          anyOf:
            - type: number
            - type: 'null'
          title: Score
      additionalProperties: false
      type: object
      required:
        - entrant_id
        - player_id
        - rank
        - tier
        - score
      title: Placement
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
        input:
          title: Input
        ctx:
          type: object
          title: Context
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
    TournamentScheduleConfig-Input:
      properties:
        mode:
          type: string
          enum:
            - scheduled
            - on_demand
          title: Mode
          default: on_demand
        starts_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Starts At
        ends_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Ends At
      additionalProperties: false
      type: object
      title: TournamentScheduleConfig
    ExplicitRosterGenerator-Input:
      properties:
        type:
          type: string
          const: explicit
          title: Type
          default: explicit
        entrants:
          items:
            $ref: '#/components/schemas/ExplicitEntrantRef-Input'
          type: array
          minItems: 2
          title: Entrants
        host_division_id:
          type: string
          minLength: 1
          title: Host Division Id
      additionalProperties: false
      type: object
      required:
        - entrants
        - host_division_id
      title: ExplicitRosterGenerator
    TopNRosterGenerator-Input:
      properties:
        type:
          type: string
          const: top_n
          title: Type
          default: top_n
        division_id:
          type: string
          title: Division Id
        'n':
          type: integer
          maximum: 256
          minimum: 2
          title: 'N'
      additionalProperties: false
      type: object
      required:
        - division_id
        - 'n'
      title: TopNRosterGenerator
    DivisionAllRosterGenerator-Input:
      properties:
        type:
          type: string
          const: division_all
          title: Type
          default: division_all
        division_id:
          type: string
          title: Division Id
      additionalProperties: false
      type: object
      required:
        - division_id
      title: DivisionAllRosterGenerator
    DoubleEliminationRoundGenerator-Input:
      properties:
        strategy:
          type: string
          const: double_elimination
          title: Strategy
          default: double_elimination
        grand_final_reset:
          type: boolean
          title: Grand Final Reset
          default: true
        best_of:
          type: integer
          maximum: 15
          minimum: 1
          title: Best Of
          default: 1
      additionalProperties: false
      type: object
      title: DoubleEliminationRoundGenerator
    PlacementsConfig-Input:
      properties:
        type:
          type: string
          const: bracket_finish
          title: Type
          default: bracket_finish
        tiers:
          items:
            $ref: '#/components/schemas/TierBand'
          type: array
          title: Tiers
      additionalProperties: false
      type: object
      title: PlacementsConfig
    TournamentScheduleConfig-Output:
      properties:
        mode:
          type: string
          enum:
            - scheduled
            - on_demand
          title: Mode
          default: on_demand
        starts_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Starts At
        ends_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Ends At
      additionalProperties: false
      type: object
      required:
        - mode
        - starts_at
        - ends_at
      title: TournamentScheduleConfig
    ExplicitRosterGenerator-Output:
      properties:
        type:
          type: string
          const: explicit
          title: Type
          default: explicit
        entrants:
          items:
            $ref: '#/components/schemas/ExplicitEntrantRef-Output'
          type: array
          minItems: 2
          title: Entrants
        host_division_id:
          type: string
          minLength: 1
          title: Host Division Id
      additionalProperties: false
      type: object
      required:
        - type
        - entrants
        - host_division_id
      title: ExplicitRosterGenerator
    TopNRosterGenerator-Output:
      properties:
        type:
          type: string
          const: top_n
          title: Type
          default: top_n
        division_id:
          type: string
          title: Division Id
        'n':
          type: integer
          maximum: 256
          minimum: 2
          title: 'N'
      additionalProperties: false
      type: object
      required:
        - type
        - division_id
        - 'n'
      title: TopNRosterGenerator
    DivisionAllRosterGenerator-Output:
      properties:
        type:
          type: string
          const: division_all
          title: Type
          default: division_all
        division_id:
          type: string
          title: Division Id
      additionalProperties: false
      type: object
      required:
        - type
        - division_id
      title: DivisionAllRosterGenerator
    DoubleEliminationRoundGenerator-Output:
      properties:
        strategy:
          type: string
          const: double_elimination
          title: Strategy
          default: double_elimination
        grand_final_reset:
          type: boolean
          title: Grand Final Reset
          default: true
        best_of:
          type: integer
          maximum: 15
          minimum: 1
          title: Best Of
          default: 1
      additionalProperties: false
      type: object
      required:
        - strategy
        - grand_final_reset
        - best_of
      title: DoubleEliminationRoundGenerator
    PlacementsConfig-Output:
      properties:
        type:
          type: string
          const: bracket_finish
          title: Type
          default: bracket_finish
        tiers:
          items:
            $ref: '#/components/schemas/TierBand'
          type: array
          title: Tiers
      additionalProperties: false
      type: object
      required:
        - type
        - tiers
      title: PlacementsConfig
    VisualizationEntrant:
      properties:
        entrant_id:
          type: string
          title: Entrant Id
        player_id:
          type: string
          title: Player Id
        policy_version_id:
          type: string
          title: Policy Version Id
        seed:
          type: integer
          title: Seed
        display_name:
          anyOf:
            - type: string
            - type: 'null'
          title: Display Name
      additionalProperties: false
      type: object
      required:
        - entrant_id
        - player_id
        - policy_version_id
        - seed
        - display_name
      title: VisualizationEntrant
    BracketMatchView:
      properties:
        match_id:
          type: string
          title: Match Id
        bracket:
          type: string
          enum:
            - winners
            - losers
            - grand_final
          title: Bracket
        round_index:
          type: integer
          title: Round Index
        slot_index:
          type: integer
          title: Slot Index
        label:
          type: string
          title: Label
        series_format:
          type: string
          enum:
            - bo1
            - bo3
            - bo5
            - bo7
            - bo9
            - bo11
            - bo13
            - bo15
          title: Series Format
          default: bo1
        entrant_a_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Entrant A Id
        entrant_b_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Entrant B Id
        winner_entrant_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Winner Entrant Id
        status:
          type: string
          enum:
            - pending
            - ready
            - running
            - completed
            - void
          title: Status
          default: pending
        edges:
          items:
            $ref: '#/components/schemas/BracketEdge'
          type: array
          title: Edges
      additionalProperties: false
      type: object
      required:
        - match_id
        - bracket
        - round_index
        - slot_index
        - label
        - series_format
        - entrant_a_id
        - entrant_b_id
        - winner_entrant_id
        - status
        - edges
      title: BracketMatchView
    ExplicitEntrantRef-Input:
      properties:
        player_id:
          type: string
          title: Player Id
        policy_version_id:
          type: string
          title: Policy Version Id
        display_name:
          anyOf:
            - type: string
            - type: 'null'
          title: Display Name
      additionalProperties: false
      type: object
      required:
        - player_id
        - policy_version_id
      title: ExplicitEntrantRef
    TierBand:
      properties:
        name:
          type: string
          title: Name
        ranks:
          prefixItems:
            - type: integer
            - type: integer
          type: array
          maxItems: 2
          minItems: 2
          title: Ranks
      additionalProperties: false
      type: object
      required:
        - name
        - ranks
      title: TierBand
    ExplicitEntrantRef-Output:
      properties:
        player_id:
          type: string
          title: Player Id
        policy_version_id:
          type: string
          title: Policy Version Id
        display_name:
          anyOf:
            - type: string
            - type: 'null'
          title: Display Name
      additionalProperties: false
      type: object
      required:
        - player_id
        - policy_version_id
        - display_name
      title: ExplicitEntrantRef
    BracketEdge:
      properties:
        to_match_id:
          type: string
          title: To Match Id
        slot:
          type: string
          enum:
            - a
            - b
          title: Slot
        kind:
          type: string
          enum:
            - advance
            - drop
            - grand_final
          title: Kind
      additionalProperties: false
      type: object
      required:
        - to_match_id
        - slot
        - kind
      title: BracketEdge
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      description: Bearer token issued by Softmax

````