- 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
ID of the collection.
Display name for the label set.
JSON schema for validating labels. Must be a valid JSON Schema object.
Optional description.
Returns
ID of the created label set.
List Label Sets
Add a Label
Add Multiple Labels
Get Labels
Parameters
ID of the collection.
ID of the label set.
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
ID of the collection.
ID of the label set that owns the label.
ID of the label to update.
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
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
ID of the collection.
ID of the label set that owns all labels being deleted.
Non-empty list of unique label IDs.
If
True, return the labels that would be deleted without deleting them.
Pass False to perform the deletion.Returns
Structured deletion preview or result.
DeleteLabelsResult and DeletedLabelPreview are exported from docent.sdk for typing:
DeletedLabelPreview records include:
Label ID.
Label set ID.
Stored label value.
Agent run ID for regular labels.
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
ID of the collection.
ID of the general label set that owns the label.
ID of the general label to update.
New label value. It must conform to the general label set’s JSON schema.
Optional metadata to store on the label. If omitted, existing metadata is unchanged.
Returns
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
ID of the collection.
ID of the general label set that owns all labels being deleted.
Non-empty list of unique general label IDs.
If
True, return the general labels that would be deleted without deleting
them. Pass False to perform the deletion.Returns
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

