Skip to content

Event Listeners

You can set up event listeners to react to production changes.

Quickstart

It's possible to listen to events and trigger callbacks as they occur.

Because listening to events blocks the current thread, we recommend that you set it up in a different thread than the main one.

python
gazu.set_host("https://kitsu.mystudio.com/api")
gazu.set_event_host("https://kitsu.mystudio.com")
gazu.log_in("email", "password")


def my_callback(data):
    print("Asset created %s" % data["asset_id"])

event_client = gazu.events.init()
gazu.events.add_listener(event_client, "asset:new", my_callback)
gazu.events.run_client(event_client)

Available events

Each event name follows the pattern entity:action. Most entities emit three generic CRUD events: new, update, and delete. The naming convention is:

model_name.lower().replace(' ', '-') + ':' + action

On top of these, some entities emit additional events for specific actions (e.g. task:assign, comment:reply, shot:casting-update).

The callback data always includes the entity ID (e.g. {"asset_id": "..."}) and, when relevant, a project_id.

Asset

EventData
asset:newasset_id
asset:updateasset_id
asset:deleteasset_id
asset:new-linkasset_id
asset:remove-linkasset_id
asset:casting-updateasset_id
asset-type:newasset_type_id
asset-type:updateasset_type_id
asset-type:deleteasset_type_id
asset_instance:newasset_instance_id
asset_instance:add-to-shotasset_instance_id
asset_instance:remove-from-shotasset_instance_id

Shot and sequence

EventData
shot:newshot_id
shot:updateshot_id
shot:deleteshot_id
shot:casting-updateshot_id
shot:add-to-sceneshot_id
shot:remove-from-sceneshot_id
sequence:newsequence_id
sequence:deletesequence_id
scene:newscene_id
scene:deletescene_id
episode:newepisode_id
episode:deleteepisode_id
episode:casting-updateepisode_id

Task

EventData
task:newtask_id
task:updatetask_id
task:deletetask_id
task:assigntask_id
task:unassigntask_id
task:status-changedtask_id
task:to-reviewtask_id
task:update-casting-statstask_id
task-type:newtask_type_id
task-status:newtask_status_id
task-status:updatetask_status_id

Comment

EventData
comment:newcomment_id
comment:updatecomment_id
comment:deletecomment_id
comment:replycomment_id
comment:delete-replycomment_id
comment:acknowledgecomment_id, person_id
comment:unacknowledgecomment_id, person_id

Preview and file

EventData
preview-file:newpreview_file_id
preview-file:updatepreview_file_id
preview-file:deletepreview_file_id
preview-file:add-filepreview_file_id
preview-file:set-mainpreview_file_id
preview-file:annotation-updatepreview_file_id
preview-background-file:add-filepreview_background_file_id
preview-background-file:updatepreview_background_file_id
working-file:newworking_file_id
output-file:newoutput_file_id
output-file:updateoutput_file_id
output-file:deleteoutput_file_id

Person and organisation

EventData
person:newperson_id
person:updateperson_id
person:deleteperson_id
person:set-thumbnailperson_id
organisation:updateorganisation_id
organisation:set-thumbnailorganisation_id
department:newdepartment_id

Project

EventData
project:newproject_id
project:updateproject_id
project:deleteproject_id
project:set-thumbnailproject_id
metadata-descriptor:newmetadata_descriptor_id
metadata-descriptor:updatemetadata_descriptor_id
metadata-descriptor:deletemetadata_descriptor_id

Edit

EventData
edit:newedit_id
edit:updateedit_id
edit:deleteedit_id

Concept

EventData
concept:newconcept_id
concept:updateconcept_id
concept:deleteconcept_id

Playlist

EventData
playlist:deleteplaylist_id
playlist:add_entityplaylist_id

Notification

EventData
notification:newnotification_id
notification:readnotification_id
notification:unreadnotification_id
notification:all-readperson_id

Chat

EventData
chat:new-messagemessage data
chat:deleted-messagemessage data
chat:joinedchat data
chat:leftchat data

News

EventData
news:newnews_id
news:deletenews_id

Budget

EventData
budget:createbudget_id
budget:updatebudget_id
budget:deletebudget_id
budget-entry:createbudget_entry_id
budget-entry:updatebudget_entry_id
budget-entry:deletebudget_entry_id

Schedule

EventData
schedule-item:newschedule_item_id
production_schedule_version:updateproduction_schedule_version_id

Time spent

EventData
time-spent:newtime_spent_id
time-spent:updatetime_spent_id
time-spent:deletetime_spent_id
EventData
entity-link:newlink data
entity-link:updatelink data
entity-link:deletelink data

Build job

EventData
build-job:newbuild_job_id
build-job:updatebuild_job_id
build-job:deletebuild_job_id

Search Logs

You can access the latest events with raw functions:

py
events = gazu.client.get("data/events/last?page_size=100")
events = gazu.client.get("data/events/last?page_size=100&before=2019-02-01")
events = gazu.client.get("data/events/last?page_size=100&before=2019-02-01&after=2019-01-01")
events = gazu.client.get("data/events/last?page_size=100&only_files=true")

Next Steps