Docs

Events

Appwrite provides a variety of events that allows your application to react to changes as they happen. A event will fire when a change occurs in your Appwrite project, like when a new user registers or a new file is uploaded to Appwrite. You can subscribe to these events to with Appwrite Functions, Realtime, or Webhooks.

You can subscribe to events for specific resources using their ID or subscribe to changes of all resources of the same type by using a wildcard character * instead of an ID. You can also filter for events of specific actions like create, update, or delete. You can find a list of events for Storage, Databases, Functions, and Authentication services below.

Storage Service

Name Payload Description
buckets.* Bucket Object This event triggers on any buckets event.
buckets.*.create Bucket Object This event triggers when a bucket is created.
buckets.*.delete Bucket Object This event triggers when a bucket is deleted.
buckets.*.files.* File Object This event triggers on any files event.
buckets.*.files.*.create File Object This event triggers when a file is created.
buckets.*.files.*.delete File Object This event triggers when a file is deleted.
buckets.*.files.*.update File Object This event triggers when a file is updated.
buckets.*.update Bucket Object This event triggers when a bucket is updated.

Databases Service

Name Payload Description
databases.* Database Object This event triggers on any database event.
databases.*.collections.* Collection Object This event triggers on any collection event.
databases.*.collections.*.attributes Attribute Object This event triggers on any attributes event.
databases.*.collections.*.attributes.create Attribute Object This event triggers when an attribute is created.
databases.*.collections.*.attributes.delete Attribute Object This event triggers when an attribute is deleted.
databases.*.collections.*.create Collection Object This event triggers when a collection is created.
databases.*.collections.*.delete Collection Object This event triggers when a collection is deleted.
databases.*.collections.*.documents Document Object This event triggers on any documents event.
databases.*.collections.*.documents.create Document Object This event triggers when a document is created.
databases.*.collections.*.documents.delete Document Object This event triggers when a document is deleted.
databases.*.collections.*.documents.update Document Object This event triggers when a document is updated.
databases.*.collections.*.indexes Index Object This event triggers on any indexes event.
databases.*.collections.*.indexes.create Index Object This event triggers when an index is created.
databases.*.collections.*.indexes.delete Index Object This event triggers when an index is deleted.
databases.*.collections.*.update Collection Object This event triggers when a collection is updated.
databases.*.create Database Object This event triggers when a database is created.
databases.*.delete Database Object This event triggers when a database is deleted.
databases.*.update Database Object This event triggers when a database is updated.

Functions Service

Name Payload Description
buckets.* Bucket Object This event triggers on any buckets event.
buckets.*.create Bucket Object This event triggers when a bucket is created.
buckets.*.delete Bucket Object This event triggers when a bucket is deleted.
buckets.*.files.* File Object This event triggers on any files event.
buckets.*.files.*.create File Object This event triggers when a file is created.
buckets.*.files.*.delete File Object This event triggers when a file is deleted.
buckets.*.files.*.update File Object This event triggers when a file is updated.
buckets.*.update Bucket Object This event triggers when a bucket is updated.

Authentication Service

Name Payload Description
teams.* Team Object This event triggers on any teams event.
teams.*.create Team Object This event triggers when a bucket is created.
teams.*.delete Team Object This event triggers when a bucket is deleted.
teams.*.memberships.* Membership Object This event triggers on any team memberships event.
teams.*.memberships.*.create Membership Object This event triggers when a membership is created.
teams.*.memberships.*.delete Membership Object This event triggers when a membership is deleted.
teams.*.memberships.*.update Membership Object This event triggers when a membership is updated.
teams.*.memberships.*.update.status Membership Object This event triggers when a team memberships status is updated.
teams.*.update Team Object This event triggers when a bucket is updated.
users.* User Object This event triggers on any user's event.
users.*.create User Object This event triggers when a user is created.
users.*.delete User Object This event triggers when a user is deleted.
users.*.recovery.* Token Object This event triggers on any user's recovery token event.
users.*.recovery.*.create Token Object This event triggers when a recovery token for a user is created.
users.*.recovery.*.update Token Object This event triggers when a recovery token for a user is validated.
users.*.sessions.* Session Object This event triggers on any user's sessions event.
users.*.sessions.*.create Session Object This event triggers when a session for a user is created.
users.*.sessions.*.delete Session Object This event triggers when a session for a user is deleted.
users.*.update User Object This event triggers when a user is updated.
users.*.update.*.email User Object This event triggers when a user's email address is updated.
users.*.update.*.name User Object This event triggers when a user's name is updated.
users.*.update.*.password User Object This event triggers when a user's password is updated.
users.*.update.*.prefs User Object This event triggers when a user's preferences is updated.
users.*.update.*.status User Object This event triggers when a user's status is updated.
users.*.verification.* Token Object This event triggers on any user's verification token event.
users.*.verification.*.create Token Object This event triggers when a verification token for a user is created.
users.*.verification.*.update Token Object This event triggers when a verification token for a user is validated.

Known Limitations

When events fire, only existing subscriptions for that event will receive the update. If your client or server side integrations lose network connection temporarily, delivery of the event is not guaranteed.

For self-hosted instances, when the Appwrite containers are shut down and restarted, events with pending webhooks and subscription updates will not be delivered.

A change to a resource can cause multiple events to fire. For example adding a new document with ID "lion-king" to a collection with the ID "movies" will cause all of the below events to fire.

{
    "events": [
        databases.default.collections.movies.documents.lion-king.create,
        databases.*.collections.*.documents.*.create, 
        databases.default.collections.*.documents.lion-king.create, 
        databases.*.collections.*.documents.lion-king.create, 
        databases.*.collections.movies.documents.lion-king.create, 
        databases.default.collections.movies.documents.*.create, 
        databases.*.collections.movies.documents.*.create, 
        databases.default.collections.*.documents.*.create, 
        databases.default.collections.movies.documents.lion-king, 
        databases.*.collections.*.documents.*, 
        databases.default.collections.*.documents.lion-king, 
        databases.*.collections.*.documents.lion-king, 
        databases.*.collections.movies.documents.lion-king, 
        databases.default.collections.movies.documents.*, 
        databases.*.collections.movies.documents.*, 
        databases.default.collections.*.documents.*, 
        databases.default.collections.movies, 
        databases.*.collections.*, 
        databases.default.collections.*, 
        databases.*.collections.movies, 
        databases.default, 
        databases.*
    ]
}

When designing function triggers or webhook integrations, beware of possible overlaping events. Function execution order is not dependent on type of event.

Permissions apply to Appwrite events. When subscribing to event channels using Appwrite Realtime, you will only receive updates for resources to which you have read permissions.