main, or hold a reviewer-only copy of labels.
You create a new label version by copying labels from an existing branch onto a new branch with project.copy_labels_to_branch(). Every Project starts with a main branch. Copying from main (or any branch) into a new branch name creates that branch and populates it with the matching label rows.
All examples on this page use
bundle when calling initialise_labels() or save() to reduce network round-trips. Keep bundle sizes under 1000 operations — larger bundles can degrade performance. A good starting point is BUNDLE_SIZE = 100; for videos with many labels, start at 20 and adjust. copy_labels_to_branch() does not need a bundle — it batches internally via its own batch_size parameter (default 50).Copy All Labels to a New Branch
The following example creates a new label version namedpre-label-v1 by copying every label row on main into the new branch. This is the most common pattern: snapshot the current label state before making changes.
Copy all labels to a new branch
Copy Labels for Specific Data Units
To version labels for only a subset of your Project, pass thedata_hashes (or label_hashes) you want to include. Everything outside that list stays untouched on the target branch.
When you need to discover the label_hashes first, fetch them with list_label_rows_v2() from the source branch. You only need to initialise label rows (with a bundle) when you intend to read their contents — for the hash-discovery step alone, the metadata returned by list_label_rows_v2() is enough.
Switch to a Branch and Read Labels
Once a branch exists, uselist_label_rows_v2() with branch_name to fetch the label rows on that branch. Initialise each label row inside a create_bundle() context so all the download calls are batched into a single round-trip.
Read labels from a branch
Compare two branches
Sync or Merge Branches
There is no dedicated “merge” call. To push updates from one branch back into another, callcopy_labels_to_branch() again with overwrite=True. This replaces label rows on the target branch with the latest content from the source branch.
Verify the copy

