Skip to main content

Overview

The update() method allows you to modify an existing test after it has been created.
Only name and metadata are mutable post-creation. All other fields (type, variants, strategies, uri, ground_truth_uri, data_catalog_uri, source_test_id, max_test_cases, etc.) are fixed for the lifetime of the test because they drive generation, credit accounting, and the stored test-case shape. Sending any of them in an update returns a 400.

Parameters

string
required
The ID of the test to update.
string
New test name. Must be a non-empty string; leading and trailing whitespace are trimmed server-side.
Any
Arbitrary JSON-serializable metadata for tracking purposes. Replaces the existing metadata wholesale. Pass None to clear.

Returns

Returns the updated Test object.

Example

Use Cases

Replacing Metadata

Overwrite the metadata object on an existing test:

Updating Name and Metadata Together

Notes

All fields except test_id default to PydanticUndefined (from pydantic_core). Omit a field (or pass PydanticUndefined) to leave it unchanged. Pass None to explicitly clear an optional field. Pass a value to update it.