Overview
TheVersionResource provides methods for managing versions within Speckle models. Access it via client.version after authenticating your SpeckleClient.
Versions represent specific states or iterations of your data within a model. Each version references a committed object and includes metadata like author, timestamp, and a descriptive message.
Methods
get()
Get a single version by ID.str
required
The ID of the version to retrieve
str
required
The ID of the project containing the version
Version
The version object
get_versions()
Get all versions in a model with pagination support.str
required
The ID of the model
str
required
The ID of the project
int
default:"25"
Maximum number of versions to return
str
default:"None"
Cursor for pagination
ModelVersionsFilter
default:"None"
Filter criteria
ResourceCollection[Version]
Collection with
items, totalCount, and cursorThe
ResourceCollection object includes: - items - List of Version objects - totalCount -
Total number of versions (across all pages) - cursor - Pagination cursor for next page (or
None if no more pages)create()
Create a new version in a model.CreateVersionInput
required
Version creation parameters. See CreateVersionInput
Version
The newly created version
project_id(str, required) - The project IDmodel_id(str, required) - The model IDobject_id(str, required) - The ID of the object to reference (fromoperations.send())message(str, optional) - Commit message describing this versionsource_application(str, optional) - Name of the source application
update()
Update an existing version’s properties.UpdateVersionInput
required
Version update parameters. See UpdateVersionInput
Version
The updated version
You can only update the message of a version. The referenced object cannot be changed after
creation.
move_to_model()
Move versions from one model to another within the same project.MoveVersionsInput
required
Move parameters. See MoveVersionsInput
str
The target model ID
project_id(str, required) - The project IDversion_ids(List[str], required) - List of version IDs to movetarget_model_id(str, required) - The destination model ID
delete()
Delete one or more versions permanently.DeleteVersionsInput
required
Deletion parameters. See DeleteVersionsInput
bool
True if deletion was successfulproject_id(str, required) - The project IDversion_ids(List[str], required) - List of version IDs to delete
received()
Mark a version as received (useful for tracking which versions have been processed).MarkReceivedVersionInput
required
Mark received parameters
bool
True if successfully markedproject_id(str, required) - The project IDversion_id(str, required) - The version ID to markmessage(str, optional) - Optional messagesource_application(str, optional) - Application that received the version
This method is useful for automation workflows where you want to track which versions have been
processed by your scripts or applications.
Types
Version
Represents a version within a Speckle model.str
Version ID
str
Commit message describing this version
str
The ID of the committed object
datetime
Creation timestamp
LimitedUser
User who created the version. See
LimitedUser
str
Application used to create the version
str
URL to preview image
Input Types
CreateVersionInput
create().
Fields:
object_id(str) - ID of the object (fromoperations.send())model_id(str) - Model IDproject_id(str) - Project IDmessage(str, optional) - Version message/descriptionsource_application(str, optional) - Source application name. Default:"py"total_children_count(int, optional) - Total number of child objectsparents(List[str], optional) - Parent version IDs
UpdateVersionInput
update().
Fields:
version_id(str) - Version IDproject_id(str) - Project IDmessage(str, optional) - New version message
DeleteVersionsInput
delete().
Fields:
version_ids(List[str]) - List of version IDs to deleteproject_id(str) - Project ID
MoveVersionsInput
target_model_name(str) - Name of the target modelversion_ids(List[str]) - Version IDs to moveproject_id(str) - Project ID
Related Resources
Operations
Send and receive objects for versions
ModelResource
Manage models that contain versions
ServerTransport
Transport for sending/receiving data
SpeckleClient
Main client documentation