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

# Change leaderboard columns

> A key the leaderboard does not have yet is added as a new column at the end and needs a `title`; a key it has gets the `title`, `sorting` or `hidden` given. A finished run's scores.json reaches the leaderboard key by key and a key with no column is dropped, so a scoring program that gains a metric needs a column for it. Runs scored before a column is added show it blank. Nothing is deleted, no key is renamed, the column the board ranks by cannot be hidden, and a leaderboard another benchmark also uses is refused. Add `?dry_run=1` to validate only. Requires the `benchmark:edit` scope. To change which column ranks the board, send `{"ranks_by": "<key>"}` on its own; the answer shows the top of the board now (`top_now`) and after (`top_next`).



## OpenAPI

````yaml POST /api/competitions/{id}/leaderboard_columns/
openapi: 3.0.3
info:
  title: BenchGen Platform API
  version: 1.0.0
  description: >-
    One API for the whole BenchGen platform: model catalogue and serving,
    fine-tuning and benchmarks, datasets (knowledge), and billing.


    ## Authentication

    Every request uses the same credential: a platform API token sent as
    `Authorization: Bearer bgn_...`.

    Create tokens in the web app under Profile Settings > Platform API tokens
    (the secret is shown exactly once), or via `POST /api/tokens/` with an
    interactive session. Revoking a token disables it platform-wide within 60
    seconds.


    ## Scopes

    A token carries scopes chosen at creation; a request outside the token's
    scopes gets `403` with an explanatory message.


    | scope | grants |

    |---|---|

    | `models:read` | read model catalogues, job status, logs, GPU info |

    | `models:write` | deploy, train, merge, stop models and jobs |

    | `benchmark:read` | read benchmark runs and results |

    | `benchmark:run` | launch benchmark runs |

    | `benchmark:create` | create benchmarks in your account (drafts, Excel,
    bundles, specs); counts toward the creation limit |

    | `benchmark:manage` | edit and delete benchmarks you own or collaborate on
    |

    | `benchmark:publish` | publish and unpublish benchmarks you own or
    collaborate on |

    | `knowledge:read` | read your datasets and fine-tuning data |

    | `knowledge:write` | create, edit and delete datasets and fine-tuning data
    |

    | `billing:read` | read your balance and usage |

    | `agents:chat` | chat with your own agents through the API |

    | `agents:manage` | manage your agents, knowledge bases and channels |

    | `admin` | everything the account can do (staff accounts only) |


    ## For agents

    This document plus `/api/llms.txt` are the machine-readable entry points.
    Responses are JSON. Errors use conventional status codes; the body carries
    `error` or `message`. Knowledge endpoints return `[{"data": [...], "meta":
    {...}}]`.


    The complete auto-generated schema of every endpoint (including internal
    ones) lives at `/api/public-docs.json` (Swagger 2.0); this document is the
    curated, stable, supported surface.
  contact:
    url: https://benchgen.com
servers:
  - url: https://api.benchgen.com
security:
  - platformToken: []
tags:
  - name: auth
    description: Token introspection for services and integrations
  - name: tokens
    description: Manage your platform API tokens
  - name: models
    description: Model catalogue and serving
  - name: finetune
    description: Fine-tuning jobs, inference deployments, GPUs
  - name: knowledge
    description: Datasets and fine-tuning data (knowledge API)
  - name: billing
    description: Balance and usage
  - name: agents
    description: Chat with your agents (OpenAI-compatible facade)
  - name: benchmark
    description: Public benchmark (competition) listings.
paths:
  /api/competitions/{id}/leaderboard_columns/:
    post:
      tags:
        - benchmark
      summary: Add, retitle, re-sort or hide leaderboard columns
      description: >-
        A key the leaderboard does not have yet is added as a new column at the
        end and needs a `title`; a key it has gets the `title`, `sorting` or
        `hidden` given. A finished run's scores.json reaches the leaderboard key
        by key and a key with no column is dropped, so a scoring program that
        gains a metric needs a column for it. Runs scored before a column is
        added show it blank. Nothing is deleted, no key is renamed, the column
        the board ranks by cannot be hidden, and a leaderboard another benchmark
        also uses is refused. Add `?dry_run=1` to validate only. Requires the
        `benchmark:edit` scope. To change which column ranks the board, send
        `{"ranks_by": "<key>"}` on its own; the answer shows the top of the
        board now (`top_now`) and after (`top_next`).
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: integer
          description: The benchmark id.
        - name: dry_run
          in: query
          required: false
          schema:
            type: string
            enum:
              - '1'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                columns:
                  type: array
                  maxItems: 20
                  items:
                    type: object
                    required:
                      - key
                    properties:
                      key:
                        type: string
                        pattern: ^[a-z][a-z0-9_]{0,35}$
                        description: Must match the key the scoring program writes.
                      title:
                        type: string
                        maxLength: 36
                      sorting:
                        type: string
                        enum:
                          - desc
                          - asc
                      hidden:
                        type: boolean
                leaderboard:
                  type: integer
                  description: Needed when the benchmark has several.
                ranks_by:
                  type: string
                  description: Rank the board by this column. Sent on its own.
      responses:
        '200':
          description: Checked (dry run) or changed
          content:
            application/json:
              schema:
                type: object
                properties:
                  valid:
                    type: boolean
                  id:
                    type: integer
                  leaderboard:
                    type: integer
                  adding:
                    type: array
                    items:
                      type: string
                  updating:
                    type: array
                    items:
                      type: string
                  note:
                    type: string
                  leaderboard_now:
                    type: object
                    properties:
                      id:
                        type: integer
                      title:
                        type: string
                      columns:
                        type: array
                        items:
                          type: object
                          properties:
                            key:
                              type: string
                            title:
                              type: string
                            sorting:
                              type: string
                              enum:
                                - desc
                                - asc
                            hidden:
                              type: boolean
                            ranks_by:
                              type: boolean
                              description: The column the leaderboard is ordered by.
                            computed:
                              type: boolean
        '400':
          description: Fixable input
          content:
            application/json:
              schema:
                type: object
                properties:
                  valid:
                    type: boolean
                  errors:
                    type: array
                    items:
                      type: string
        '403':
          description: Not the creator or a collaborator, or the token lacks benchmark:edit
        '404':
          description: No such benchmark
components:
  securitySchemes:
    platformToken:
      type: http
      scheme: bearer
      bearerFormat: bgn_ opaque token
      description: >-
        Platform API token created under Profile Settings > Platform API tokens.
        Scopes are fixed at creation.

````