Docs

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:

Header Description
X-Appwrite-Webhook-Event Name of the event that triggered this delivery.
X-Appwrite-Webhook-Name Name of the webhook as specified in your app settings and events list.
X-Appwrite-Webhook-Userid

version >= 0.7

The 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.
User-Agent Each request made by Appwrite will be 'Appwrite-Server'.

Events

A list of all currently available events you can hook to:

Name Payload Description
account.create This event triggers when the account is created.
account.update.email This event triggers when the account email address is updated.
account.update.name This event triggers when the account name is updated.
account.update.password This event triggers when the account password is updated.
account.update.prefs This event triggers when the account preferences are updated.
account.delete This event triggers when the account is deleted.
account.sessions.create This event triggers when the account session is created.
account.sessions.delete This event triggers when the account session is deleted.
database.collections.create This event triggers when a database collection is created.
database.collections.update This event triggers when a database collection is updated.
database.collections.delete This event triggers when a database collection is deleted.
database.documents.create This event triggers when a database document is created.
database.documents.patch This event triggers when a database document is patched.
database.documents.delete This event triggers when a database document is deleted.
storage.files.create This event triggers when a storage file is created.
storage.files.update This event triggers when a storage file is updated.
storage.files.delete This event triggers when a storage file is deleted.
users.create This event triggers when a user is created from the users API.
users.update.status This event triggers when a user status is updated from the users API.
users.delete This event triggers when a user is deleted from users API.
users.sessions.delete This event triggers when a user session is deleted from users API.