Skip to main content

Table Scorecards Public API and Python SDK Documentation Handoff

This file is the public-docs and Python-SDK handoff for table scorecards. It has been validated against the current backend implementation in:
Use public wording in docs: tables, sheets, table scorecards, and scorecards. Avoid using Smart Table in public docs except if referencing an existing endpoint section title that has not yet been renamed.

1. Current backend source of truth

Base path:
Authentication is the same as other public table endpoints.

Important SDK alignment note

The backend canonical configure endpoint is:
If the Python SDK PR currently sends PUT from configure_scorecard(...), update the SDK to send PATCH. Do not document PUT unless the backend is changed to accept PUT.

2. Public terminology updates

Use this wording in public docs and SDK docs: Release notes should say table scorecard APIs, not Smart Table Scorecard APIs. Suggested release note:

3. Concepts for public docs

Scorecard

A scorecard is a structured evaluation configuration for a table sheet. It contains criteria and aggregation rules for producing row-level and sheet-level scores.

Criterion / step

A criterion is one scorecard step. Criteria can compare columns, check text, run assertions, summarize columns, and contribute to the aggregate score.

Calculation

A calculation is one scorecard run. It stores aggregate score, verdict, criterion summaries, row-level results, drift metadata, status, and errors.

Row result

A row result contains the scorecard outcome for one row, including per-criterion step_results.

Drift and stale state

Drift compares current results to a previous completed calculation when available. Stale state indicates results may need recalculation after inputs or scorecard configuration changed.

4. Backend enums and public values

These are the current backend values. The Python SDK should align to these values for table scorecards.

Scorecard status

If the SDK currently defines scorecard status as:
that is not aligned with this backend scorecard API. Update the SDK type for table scorecards or introduce a separate type if those values belong to another SDK concept.

Scorecard calculation status

Verdicts

Criterion primitive types

If the SDK currently defines scorecard primitive types as:
that does not match the current backend criterion primitives for this endpoint. Update the table scorecard SDK type or separate the concepts. Public docs and screenshots should use evaluators that appear in the product add-evaluator UI (Quality evaluators such as CONTAINS, COMPARE, LLM_ASSERTION, CODE_EXECUTION, REGEX, and ASSERT_VALID). Do not document or screenshot hidden agent-behavior primitives (MAX_TOOL_CALLS, NO_INVALID_TOOL_CALLS, TOOL_EVALUATOR, STRUCTURE) until they are exposed in the UI.

5. Public API endpoint reference

5.1 Get scorecard

Returns the active scorecard for a sheet, if one exists.

Response when no scorecard exists

Response when a scorecard exists

Notes:
  • The raw backend response currently includes smart_table_id. Public docs may describe this as the table identifier, but SDK types should either expose the raw response field or intentionally alias it with clear documentation.
  • display_calculation may differ from latest_calculation. If the latest calculation is completed, display_calculation is that completed calculation. If the latest calculation is queued, running, or failed, display_calculation may be the previous completed calculation. If there is no completed calculation to display, it is null.

5.2 Configure scorecard

Creates or updates the active scorecard for a sheet.

Request

Backend request schema

The current backend Pydantic body is:
Therefore:
  • name is required.
  • aggregation is required.
  • evaluated_column_ids may be omitted and defaults to [].
  • steps may be omitted and defaults to [].
If the Python SDK currently marks evaluated_column_ids and steps as Required[...], update the SDK types to make them optional for this endpoint, or document that the SDK requires fields that the backend does not require. Prefer aligning SDK with backend.

Response

Nested scorecard examples may be abbreviated for readability. The backend returns the full serialized scorecard.

5.3 Soft-delete scorecard

Soft-deletes the active scorecard for the sheet.

Response

Deleting a scorecard does not delete legacy score configuration. Legacy /score behavior may still exist if the sheet has a legacy score configuration.

5.4 Migrate legacy score to scorecard

Converts an existing legacy sheet score configuration into scorecard criteria.

Request

delete_legacy_score defaults to false.

Response

Skipped migration example:
Some legacy score configurations cannot be converted automatically, including custom scoring code, missing score columns, and unsupported column types.

5.5 Recalculate scorecard

Queues scorecard recalculation.

Request

Full recalculation:
Scoped recalculation:

Backend request schema

The backend does not currently accept force on /scorecard/recalculate. If the Python SDK currently has:
update it to include step_ids and remove or ignore force unless the backend adds support for force.

Response

Status code: 202 Accepted.

5.6 Cancel scorecard calculation

Cancels active queued/running scorecard work when possible.

Request

All fields are optional.

Backend request schema

The backend does not currently accept calculation_id on /scorecard/cancel. It cancels the active latest queued/running calculation for the scorecard. If the Python SDK currently has:
update it to match the backend request body or update the backend if cancellation by calculation ID is desired.

Response

If nothing was cancellable:

5.7 Get calculation details

Response


5.8 List row summaries

Query parameters

Response

The current backend uses cursor / next_cursor, not offset / next_offset. The list response also includes calculation_id and verdict_counts at the top level. If the Python SDK currently has:
update it to match the backend (cursor / next_cursor) unless the SDK intentionally provides an abstraction layer. The backend does not currently support offset or stale_state query parameters on this endpoint.

5.9 Get row breakdown

Query parameters

Response


6. Existing /score compatibility behavior

Existing public table scoring endpoints remain supported:

GET /score

If a legacy score configuration exists, this endpoint returns legacy score data as before. If no legacy score configuration exists and the sheet has an active scorecard with a completed latest calculation and non-null aggregate score, GET /score can return a scorecard-compatible payload:
If both a legacy score configuration and a scorecard exist, /score returns legacy behavior. Use /scorecard for scorecard-specific state and results.

POST /score

If a legacy score configuration exists, this endpoint queues legacy score recalculation. If no legacy score configuration exists but an active scorecard exists, this endpoint queues scorecard recalculation:

7. Safe migration guide

Recommended migration path:
  1. Inspect current legacy score behavior:
  2. Convert the legacy score configuration into a scorecard:
  3. Inspect converted_count, skipped, and scorecard.steps.
  4. Recalculate via POST /scorecard/recalculate.
  5. Poll with GET /scorecard/calculations/{calculation_id}.
  6. Move consumers from /score to /scorecard.
  7. Only after all consumers have migrated, optionally delete the legacy score configuration by using:
Do not set delete_legacy_score: true until every consumer that depends on /score has been migrated or verified to support the scorecard fallback response shape.

8. Criterion examples

Empty scorecard

Compare criterion

Contains criterion

Column aggregate criterion

Supported COLUMN_AGGREGATE aggregation_type values:

9. Python SDK docs

Current Python SDK namespace:
Use snake_case methods in Python SDK docs.

Get scorecard

Configure scorecard

SDK implementation note: configure_scorecard(...) must call backend PATCH /scorecard, not PUT /scorecard, unless the backend is changed to accept PUT.

Migrate legacy score

Recalculate scorecard

Scoped recalculation:

Get calculation

List rows

Get row

Cancel

Scoped cancel:

Delete scorecard


10. Python SDK type alignment checklist

Update the Python SDK scorecard types to match backend behavior.

ConfigureScorecardRequest

Backend allows evaluated_column_ids and steps to be omitted. Recommended SDK type:

RecalculateScorecardRequest

Backend accepts row_indices and step_ids; it does not accept force.

CancelScorecardRequest

Backend accepts row_indices and step_ids; it does not accept calculation_id.

ListScorecardRowsOptions

Backend accepts cursor and returns next_cursor; it does not accept offset, next_offset, or stale_state. The response includes top-level calculation_id and verdict_counts.

Existing /score SDK response types

Existing score response types should allow scorecard fallback fields:
Existing score recalculation response type should allow this union case:

11. Public-ready quality bar

Final docs should:
  • Use public wording: tables, sheets, table scorecards, scorecards.
  • Avoid “Smart Table” except where legacy docs still require a transition note.
  • Use Python SDK examples, not TypeScript examples.
  • Use Python SDK snake_case method names.
  • Document backend-canonical HTTP methods, especially PATCH /scorecard for configuration.
  • Explain exactly when /score returns legacy behavior vs scorecard fallback behavior.
  • Emphasize safe migration with delete_legacy_score: false.
  • Include migration caveats and skipped conversion examples.
  • Keep examples aligned with backend fields, including currently returned fields such as smart_table_id, latest_calculation_id, aggregate_score, aggregate_verdict, criterion_summaries, step_results, and verdict_counts.
  • If the SDK chooses aliases such as table_id instead of raw smart_table_id, document that aliasing explicitly.

Screenshot capture notes

Screenshots in screenshots/ use only evaluators exposed in the product add-evaluator UI (Quality evaluators). Hidden agent-behavior primitives are excluded from demo data, screenshots, and public doc examples. To regenerate: