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

# Upsert system version

> Create a new system version if it does not already exist. Does **not** set the created version to be the system's production version.

If there is already a system version with the same config, its name will be updated.



## OpenAPI

````yaml post /systems/{systemId}/versions
openapi: 3.1.0
info:
  title: Scorecard API
  description: REST API for Scorecard
  version: 1.0.0
servers:
  - url: https://api2.scorecard.io/api/v2
security:
  - ApiKeyAuth: []
paths:
  /systems/{systemId}/versions:
    post:
      summary: Upsert system version
      description: >-
        Create a new system version if it does not already exist. Does **not**
        set the created version to be the system's production version.


        If there is already a system version with the same config, its name will
        be updated.
      operationId: upsertSystemVersion
      parameters:
        - in: path
          name: systemId
          description: The ID of the system to create the system version for.
          schema:
            type: string
            format: uuid
            example: 12345678-0a8b-4f66-b6f3-2ddcfa097257
          required: true
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                config:
                  type: object
                  additionalProperties: true
                  description: The configuration of the system version.
                name:
                  type: string
                  description: >-
                    The name of the system version. If creating a new system
                    version and the name isn't provided, it will be
                    autogenerated.
              required:
                - config
            examples:
              Create system version:
                value:
                  name: 'Test model: Gemini'
                  config:
                    temperature: 0.5
                    maxTokens: 1024
                    model: gemini-2.0-flash
                summary: Create system version
                description: Create a new system version.
      responses:
        '200':
          description: Successfully upserted system version.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SystemVersion'
              examples:
                System version details:
                  value:
                    id: 87654321-4d3b-4ae4-8c7a-4b6e2a19ccf0
                    systemId: 12345678-0a8b-4f66-b6f3-2ddcfa097257
                    name: Production (Low Temperature)
                    config:
                      temperature: 0.1
                      maxTokens: 1024
                      model: gpt-4-turbo
                  summary: System version details
                  description: >-
                    Example response showing the complete details of a valid
                    system version.
        '401':
          $ref: '#/components/responses/UnauthenticatedError'
        '500':
          $ref: '#/components/responses/ServiceError'
      x-codeSamples:
        - lang: JavaScript
          source: >-
            import Scorecard from 'scorecard-ai';


            const client = new Scorecard({
              apiKey: 'My API Key',
            });


            const systemVersion = await
            client.systems.versions.upsert('12345678-0a8b-4f66-b6f3-2ddcfa097257',
            {
              config: { temperature: 0.5, maxTokens: 1024, model: 'gemini-2.0-flash' },
              name: 'Test model: Gemini',
            });


            console.log(systemVersion.id);
        - lang: Python
          source: |-
            from scorecard_ai import Scorecard

            client = Scorecard(
                api_key="My API Key",
            )
            system_version = client.systems.versions.upsert(
                system_id="12345678-0a8b-4f66-b6f3-2ddcfa097257",
                config={
                    "temperature": 0.5,
                    "maxTokens": 1024,
                    "model": "gemini-2.0-flash",
                },
                name="Test model: Gemini",
            )
            print(system_version.id)
        - lang: cURL
          source: |-
            curl https://api2.scorecard.io/api/v2/systems/$SYSTEM_ID/versions \
                -H 'Content-Type: application/json' \
                -H "Authorization: Bearer $SCORECARD_API_KEY" \
                -d '{
                      "config": {
                        "temperature": "bar",
                        "maxTokens": "bar",
                        "model": "bar"
                      }
                    }'
components:
  schemas:
    SystemVersion:
      type: object
      properties:
        id:
          type: string
          format: uuid
          description: The ID of the system version.
        systemId:
          type: string
          format: uuid
          description: The ID of the system the system version belongs to.
        name:
          type: string
          description: The name of the system version.
        config:
          type: object
          additionalProperties: true
          description: The configuration of the system version.
      required:
        - id
        - systemId
        - name
        - config
      description: >-
        A SystemVersion defines the specific settings for a System Under Test.


        System versions contain parameter values that determine system behavior
        during evaluation.

        They are immutable snapshots - once created, they never change.


        When running evaluations, you reference a specific systemVersionId to
        establish which system version to test.
    ApiError:
      type: object
      properties:
        code:
          type: string
        message:
          type: string
        details:
          type: object
          additionalProperties: true
          x-stainless-any: true
      required:
        - code
        - message
        - details
      description: An API error.
  responses:
    UnauthenticatedError:
      description: Error indicating that the request is not authenticated.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ApiError'
          examples:
            Authentication failure:
              value:
                code: UNAUTHORIZED
                message: Invalid or missing authentication token
                details: {}
              summary: Authentication failure
              description: >-
                Error returned when authentication credentials are invalid or
                missing.
    ServiceError:
      description: >-
        An internal service error indicating an issue with the Scorecard
        service.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ApiError'
          examples:
            Internal error:
              value:
                code: INTERNAL_ERROR
                message: An unexpected error occurred while processing your request.
                details: {}
              summary: Internal error
              description: Generic error when an unexpected internal issue occurs.
  securitySchemes:
    ApiKeyAuth:
      type: http
      scheme: bearer
      bearerFormat: starts with ak_

````