Skip to main content

Websocket events

By subscribing to the ftrack.update topic, you connect your application or script to the ftrack event hub. When an entity is changed, an event is emitted on this topic and your callback function is triggered.

Inside the callback, you can process the received event data and take necessary actions based on the changes.

import ftrack_api

# Define a function to handle the received event
def my_callback(event):
# Iterate through the updated entities and print their data
for entity in event['data']['entities']:
# Print data for the entity
print(entity)

# Create a session and automatically connect to the event hub
session = ftrack_api.Session(auto_connect_event_hub=True)

# Subscribe to events with the 'ftrack.update' topic
session.event_hub.subscribe('topic=ftrack.update', my_callback)