- Label sets — structured annotations on agent runs, validated against a JSON schema
- General label sets — structured annotations on agent runs, transcripts, transcript slices, or reading results
- Tags — lightweight string annotations on agent runs
- Comments — free-text notes on agent runs
Label Sets
Create a Label Set
Define a new label set with a JSON schema that all labels must conform to.Parameters
str
required
ID of the collection.
str
required
Display name for the label set.
dict
required
JSON schema for validating labels. Must be a valid JSON Schema object.
str | None
Optional description.
Returns
str
ID of the created label set.
List Label Sets
Add a Label
Add Multiple Labels
Get Labels
Parameters
str
required
ID of the collection.
str
required
ID of the label set.
bool
default:"False"
If
True, only return labels that fully match the label set schema including
required fields. Default returns all labels.Update a Label
Update an existing label’slabel_value. The server validates the updated value against
the label set schema, but does not enforce top-level required fields for regular labels.
It also verifies that the label belongs to the given label set.
Parameters
str
required
ID of the collection.
str
required
ID of the label set that owns the label.
str
required
ID of the label to update.
dict
required
New label value. It must conform to the label set’s JSON schema validation rules,
except top-level
required fields are not enforced for regular labels.Returns
dict
Updated label object.
Delete Labels
Preview or delete specific labels from a label set. Deletion defaults to a dry run so you can inspect the returned labels before mutating data.Parameters
str
required
ID of the collection.
str
required
ID of the label set that owns all labels being deleted.
list[str]
required
Non-empty list of unique label IDs.
bool
default:"True"
If
True, return the labels that would be deleted without deleting them.
Pass False to perform the deletion.Returns
DeleteLabelsResult
Structured deletion preview or result.
DeleteLabelsResult and DeletedLabelPreview are exported from docent.sdk for typing:
DeletedLabelPreview records include:
str
Label ID.
str
Label set ID.
dict
Stored label value.
str | None
Agent run ID for regular labels.
LabelTarget | None
General-label target, when deleting general labels.
Errors
ValueError—label_idsis empty or contains duplicatesHTTPError (404)— Collection, label set, or label not found
General Labels
General labels use the same schema validation model as label sets, but they can target several Docent object types instead of only one agent run.Create a General Label Set
List and Fetch General Label Sets
Create a General Label
target.items can contain agent_run, transcript, transcript_slice, or
reading_result targets.
Get a General Label
Update a General Label
Update a general label’slabel_value and optionally replace its metadata. The
server verifies that the label belongs to the supplied general label set.
Parameters
str
required
ID of the collection.
str
required
ID of the general label set that owns the label.
str
required
ID of the general label to update.
dict
required
New label value. It must conform to the general label set’s JSON schema.
dict | None
Optional metadata to store on the label. If omitted, existing metadata is unchanged.
Returns
GeneralLabel
Updated general label.
Delete General Labels
Preview or delete specific general labels from a general label set. Likedelete_labels, this method defaults to a dry run.
Parameters
str
required
ID of the collection.
str
required
ID of the general label set that owns all labels being deleted.
list[str]
required
Non-empty list of unique general label IDs.
bool
default:"True"
If
True, return the general labels that would be deleted without deleting
them. Pass False to perform the deletion.Returns
DeleteLabelsResult
Structured deletion preview or result. See
Delete Labels for the result fields.Errors
ValueError—label_idsis empty or contains duplicatesHTTPError (404)— Collection, general label set, or general label not found

