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

# Configure Table Sheet Score

> Configure scoring for a Table sheet.

Configure scoring for a Table sheet.

Use `column_ids` or `column_names` for standard boolean or numeric scoring. Column names must be unique in the sheet.

Use `score_type` with `score_config` for explicit configuration. Supported scoring modes are `auto`, `boolean`, `numeric`, and `custom`; `score_type` is required when you pass `score_config`.

For custom scoring, pass `code` and optionally `code_language` (`PYTHON` by default, or `JAVASCRIPT`). Boolean scoring also supports `true_values`, `false_values`, and `assertion_aggregation` (`all`, `any`, or `mean`).

This endpoint updates the configuration and returns `requires_recalculation`; call the recalculation endpoint to queue score calculation.

Changing score configuration creates a new sheet version. The response returns `version`, the current sheet version count after the configuration update.


## OpenAPI

````yaml PATCH /api/public/v2/tables/{table_id}/sheets/{sheet_id}/score
openapi: 3.1.0
info:
  title: FastAPI
  version: 0.1.0
servers: []
security:
  - ApiKeyAuth: []
paths:
  /api/public/v2/tables/{table_id}/sheets/{sheet_id}/score:
    patch:
      tags:
        - tables
      summary: Configure Table Sheet Score
      description: >-
        Configure scoring for a Table sheet. This endpoint updates the
        configuration and returns whether recalculation is required; it does not
        queue score calculation. Requests are scoped to the workspace associated
        with the API key; table, sheet, column, cell, operation, and version IDs
        must belong to that workspace.
      operationId: configureTableSheetScore
      parameters:
        - name: X-API-KEY
          in: header
          required: true
          schema:
            type: string
          description: >-
            Your PromptLayer API key. The key's workspace scopes table resources
            for this request.
        - name: table_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
          description: Table ID.
        - name: sheet_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
          description: Table sheet ID.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ConfigureTableSheetScoreRequest'
      responses:
        '200':
          description: Score configuration updated.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ConfigureTableSheetScoreResponse'
        '400':
          description: Invalid score configuration or workspace context.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          description: Authentication required.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '404':
          description: Table, sheet, or score column not found.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '500':
          description: Failed to update score configuration.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
components:
  schemas:
    ConfigureTableSheetScoreRequest:
      type: object
      title: ConfigureTableSheetScoreRequest
      properties:
        score_type:
          type: string
          enum:
            - auto
            - boolean
            - numeric
            - custom
          nullable: true
          description: Scoring mode. Required when score_config is provided.
        score_config:
          type: object
          nullable: true
          additionalProperties: true
          description: Explicit score configuration.
        column_ids:
          type: array
          nullable: true
          items:
            type: string
            format: uuid
          description: Column IDs to score.
        column_names:
          type: array
          nullable: true
          items:
            type: string
          description: Column titles to score. Titles must be unique in the sheet.
        code:
          type: string
          minLength: 1
          maxLength: 50000
          nullable: true
          description: Custom scoring code.
        code_language:
          type: string
          enum:
            - PYTHON
            - JAVASCRIPT
          default: PYTHON
        true_values:
          type: array
          nullable: true
          items:
            type: string
          description: Values treated as true for boolean scoring.
        false_values:
          type: array
          nullable: true
          items:
            type: string
          description: Values treated as false for boolean scoring.
        assertion_aggregation:
          type: string
          enum:
            - all
            - any
            - mean
          nullable: true
          description: Aggregation mode for assertion-style boolean scoring.
      additionalProperties: false
    ConfigureTableSheetScoreResponse:
      type: object
      title: ConfigureTableSheetScoreResponse
      required:
        - success
        - message
        - score_configuration_id
        - status
        - requires_recalculation
        - version
      properties:
        success:
          type: boolean
        message:
          type: string
        score_configuration_id:
          type: string
          format: uuid
        status:
          type: string
          nullable: true
          description: >-
            Returned as null by this endpoint. Use the recalculation endpoint to
            queue score calculation.
        requires_recalculation:
          type: boolean
          description: Always true after updating the score configuration.
        version:
          type: integer
    ErrorResponse:
      type: object
      properties:
        success:
          type: boolean
          default: false
          description: Indicates that the request failed.
        message:
          type: string
          description: Human-readable error message.
        error:
          type: string
          description: Machine-readable or fallback error message.
      additionalProperties: true
      description: >-
        Standard error response. Some legacy endpoints may return either message
        or error.
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: X-API-KEY

````