Skip to main content
PATCH
/
api
/
public
/
v2
/
tables
/
{table_id}
/
sheets
/
{sheet_id}
/
score
Configure Table Sheet Score
curl --request PATCH \
  --url https://api.promptlayer.com/api/public/v2/tables/{table_id}/sheets/{sheet_id}/score \
  --header 'Content-Type: application/json' \
  --header 'X-API-KEY: <api-key>' \
  --data '
{
  "score_config": {},
  "column_ids": [
    "3c90c3cc-0d44-4b50-8888-8dd25736052a"
  ],
  "column_names": [
    "<string>"
  ],
  "code": "<string>",
  "code_language": "PYTHON",
  "true_values": [
    "<string>"
  ],
  "false_values": [
    "<string>"
  ]
}
'
{
  "success": true,
  "message": "<string>",
  "score_configuration_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "status": "<string>",
  "requires_recalculation": true,
  "version": 123
}
Configure scoring for a 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.

Authorizations

X-API-KEY
string
header
required

Headers

X-API-KEY
string
required

Your PromptLayer API key. The key's workspace scopes table resources for this request.

Path Parameters

table_id
string<uuid>
required

Table ID.

sheet_id
string<uuid>
required

Table sheet ID.

Body

application/json
score_type
enum<string> | null

Scoring mode. Required when score_config is provided.

Available options:
auto,
boolean,
numeric,
custom
score_config
object

Explicit score configuration.

column_ids
string<uuid>[] | null

Column IDs to score.

column_names
string[] | null

Column titles to score. Titles must be unique in the sheet.

code
string | null

Custom scoring code.

Required string length: 1 - 50000
code_language
enum<string>
default:PYTHON
Available options:
PYTHON,
JAVASCRIPT
true_values
string[] | null

Values treated as true for boolean scoring.

false_values
string[] | null

Values treated as false for boolean scoring.

assertion_aggregation
enum<string> | null

Aggregation mode for assertion-style boolean scoring.

Available options:
all,
any,
mean

Response

Score configuration updated.

success
boolean
required
message
string
required
score_configuration_id
string<uuid>
required
status
string | null
required

Returned as null by this endpoint. Use the recalculation endpoint to queue score calculation.

requires_recalculation
boolean
required

Always true after updating the score configuration.

version
integer
required