Webhooks

Webhooks allow you to build or set up integrations which subscribe to certain events on Appwrite. When one of those events is triggered, we'll send an HTTP POST payload to the webhook's configured URL. Webhooks can be used to purge cache from CDN, calculate data or send a Slack notification. You're only limited by your imagination.

Add your webhook

You can set your webhook by adding it from your Appwrite project dashboard. You can access your webhooks settings from your project dashboard or on the left navigation panel. Click the 'Add Webhook' button and choose your webhook name and the events that should trigger it. You can also set an optional basic HTTP authentication username and password to protect your endpoint from unauthorized access.

Payload

Each event type has a specific payload format with the relevant event information. All event payloads mirror the payloads for the API payload which parallel to the event types.

Headers

HTTP requests made to your webhook's configured URL endpoint will contain several special headers.

HeaderDescription
X-Appwrite-Webhook-IdThe ID of the Webhook who triggered the event.
X-Appwrite-Webhook-EventsNames of the events that triggered this delivery.
X-Appwrite-Webhook-NameName of the webhook as specified in your app settings and events list.
X-Appwrite-Webhook-User-IdThe user ID of the user who triggered the event. Returns an empty string if an API key triggered the event. Note that events like account.create or account.sessions.create are performed by guest users and will not return any user ID. If you still need the user ID for these events, you can find it in the event payload.
X-Appwrite-Webhook-Project-IdThe ID of the project who owns the Webhook and API call.
X-Appwrite-Webhook-SignatureThe HMAC-SHA1 signature of the payload. This is used to verify the authenticity of the payload.
User-AgentEach request made by Appwrite will be 'Appwrite-Server'.

Verification

Webhooks can be verified by using the X-Appwrite-Webhook-Signature header. This is the HMAC-SHA1 signature of the payload. You can find the signature key in your webhooks properties in the dashboard. To generate this hash you append the payload to the end of webhook URL (make sure there are no spaces in between) and then use the HMAC-SHA1 algorithm to generate the signature. After you've generated the signature, compare it to the X-Appwrite-Webhook-Signature header value. If they match, the payload is valid and you can trust it came from your Appwrite instance.

Events

Appwrite has events that fire when a resource changes. These events cover all Appwrite resources and can reflect create, update, and delete actions. You can specify one or many events to subscribe to with webhooks.

Authentication events

NamePayloadDescription
teams.*Team ObjectThis event triggers on any teams event.
teams.*.createTeam ObjectThis event triggers when a team is created.
teams.*.deleteTeam ObjectThis event triggers when a team is deleted.
teams.*.memberships.*Membership ObjectThis event triggers on any team memberships event.
teams.*.memberships.*.createMembership ObjectThis event triggers when a membership is created.
teams.*.memberships.*.deleteMembership ObjectThis event triggers when a membership is deleted.
teams.*.memberships.*.updateMembership ObjectThis event triggers when a membership is updated.
teams.*.memberships.*.update.statusMembership ObjectThis event triggers when a team memberships status is updated.
teams.*.updateTeam ObjectThis event triggers when a team is updated.
teams.*.update.prefsTeam ObjectThis event triggers when a team's preferences are updated.
users.*User ObjectThis event triggers on any user's event.
users.*.createUser ObjectThis event triggers when a user is created.
users.*.deleteUser ObjectThis event triggers when a user is deleted.
users.*.recovery.*Token ObjectThis event triggers on any user's recovery token event.
users.*.recovery.*.createToken ObjectThis event triggers when a recovery token for a user is created.
users.*.recovery.*.updateToken ObjectThis event triggers when a recovery token for a user is validated.
users.*.sessions.*Session ObjectThis event triggers on any user's sessions event.
users.*.sessions.*.createSession ObjectThis event triggers when a session for a user is created.
users.*.sessions.*.deleteSession ObjectThis event triggers when a session for a user is deleted.
users.*.updateUser ObjectThis event triggers when a user is updated.
users.*.update.emailUser ObjectThis event triggers when a user's email address is updated.
users.*.update.nameUser ObjectThis event triggers when a user's name is updated.
users.*.update.passwordUser ObjectThis event triggers when a user's password is updated.
users.*.update.prefsUser ObjectThis event triggers when a user's preferences is updated.
users.*.update.statusUser ObjectThis event triggers when a user's status is updated.
users.*.verification.*Token ObjectThis event triggers on any user's verification token event.
users.*.verification.*.createToken ObjectThis event triggers when a verification token for a user is created.
users.*.verification.*.updateToken ObjectThis event triggers when a verification token for a user is validated.

Databases events

NamePayloadDescription
databases.*Database ObjectThis event triggers on any database event.
databases.*.collections.*Collection ObjectThis event triggers on any collection event.
databases.*.collections.*.attributes.*Attribute ObjectThis event triggers on any attributes event.
databases.*.collections.*.attributes.*.createAttribute ObjectThis event triggers when an attribute is created.
databases.*.collections.*.attributes.*.deleteAttribute ObjectThis event triggers when an attribute is deleted.
databases.*.collections.*.createCollection ObjectThis event triggers when a collection is created.
databases.*.collections.*.deleteCollection ObjectThis event triggers when a collection is deleted.
databases.*.collections.*.documents.*Document ObjectThis event triggers on any documents event.
databases.*.collections.*.documents.*.createDocument ObjectThis event triggers when a document is created.
databases.*.collections.*.documents.*.deleteDocument ObjectThis event triggers when a document is deleted.
databases.*.collections.*.documents.*.updateDocument ObjectThis event triggers when a document is updated.
databases.*.collections.*.indexes.*Index ObjectThis event triggers on any indexes event.
databases.*.collections.*.indexes.*.createIndex ObjectThis event triggers when an index is created.
databases.*.collections.*.indexes.*.deleteIndex ObjectThis event triggers when an index is deleted.
databases.*.collections.*.updateCollection ObjectThis event triggers when a collection is updated.
databases.*.createDatabase ObjectThis event triggers when a database is created.
databases.*.deleteDatabase ObjectThis event triggers when a database is deleted.
databases.*.updateDatabase ObjectThis event triggers when a database is updated.

Storage events

NamePayloadDescription
buckets.*Bucket ObjectThis event triggers on any buckets event.
buckets.*.createBucket ObjectThis event triggers when a bucket is created.
buckets.*.deleteBucket ObjectThis event triggers when a bucket is deleted.
buckets.*.files.*File ObjectThis event triggers on any files event.
buckets.*.files.*.createFile ObjectThis event triggers when a file is created.
buckets.*.files.*.deleteFile ObjectThis event triggers when a file is deleted.
buckets.*.files.*.updateFile ObjectThis event triggers when a file is updated.
buckets.*.updateBucket ObjectThis event triggers when a bucket is updated.

Functions events

NamePayloadDescription
functions.*Function ObjectThis event triggers on any functions event.
functions.*.createFunction ObjectThis event triggers when a function is created.
functions.*.deleteFunction ObjectThis event triggers when a function is deleted.
functions.*.deployments.*Deployment ObjectThis event triggers on any deployments event.
functions.*.deployments.*.createDeployment ObjectThis event triggers when a deployment is created.
functions.*.deployments.*.deleteDeployment ObjectThis event triggers when a deployment is deleted.
functions.*.deployments.*.updateDeployment ObjectThis event triggers when a deployment is updated.
functions.*.executions.*Execution ObjectThis event triggers on any executions event.
functions.*.executions.*.createExecution ObjectThis event triggers when an execution is created.
functions.*.executions.*.deleteExecution ObjectThis event triggers when an execution is deleted.
functions.*.executions.*.updateExecution ObjectThis event triggers when an execution is updated.
functions.*.updateFunction ObjectThis event triggers when a function is updated.

Messaging events

NamePayloadDescription
providers.*Provider ObjectThis event triggers on any providers event.
providers.*.createProvider ObjectThis event triggers when a provider is created.
providers.*.deleteProvider ObjectThis event triggers when a provider is deleted.
providers.*.updateProvider ObjectThis event triggers when a provider is updated.
topics.*Topic ObjectThis event triggers on any topic event.
topics.*.createTopic ObjectThis event triggers when a topic is created.
topics.*.deleteTopic ObjectThis event triggers when a topic is deleted.
topics.*.updateTopic ObjectThis event triggers when a topic is updated.
topics.*.subscribers.*.createTopic ObjectThis event triggers when a subscriber to a topic is created.
topics.*.subscribers.*.deleteTopic ObjectThis event triggers when a subscriber to a topic is deleted.
messages.*Message ObjectThis event triggers on any message event.
messages.*.createMessage ObjectThis event triggers when a message is created.
messages.*.deleteMessage ObjectThis event triggers when a message is deleted.
messages.*.updateMessage ObjectThis event triggers when a message is updated.

Learn more about events