Skip to content
Init is coming / May 19 - 23
Back

How to handle webhooks from external services?

  • 1
  • Functions
  • Cloud
amitrochates
26 Mar, 2025, 16:13

Hi, so I am trying to setup multiple services which send events through webhooks to my appwrite project. I have setup functions that will receive and process these requests. A typical configuration in these services asks for a webhookUrl at which they will send their updates. I understand this url would be the execution url of my function. Ex.https://myprojecturl/v1/functions/function-id/executions

  1. for external services to be able to hit an appwrite url, they need to include a header ie. x-appwrite-project:<ProjectId>. I dont see any configuration in these services where I can ask them to include this custom header in their requests. Is there a different way that I can allow requests?
  2. When working with these external requests the function must have "Guest" scope enabled, this means anyone can hit it. Is there any way that I can selectively allow only a certain service to be able to access my function?
TL;DR
To handle webhooks from external services in Appwrite: 1. Use the function [domain](https://appwrite.io/docs/products/functions/execute#domains) for webhook handling. 2. Perform authentication checks within your function code, such as verifying signatures for services like Stripe. 1. Utilize the function domain for webhook setup instead of configuring headers in external services. 2. Implement auth checks within your function code to selectively allow specific services to access it.
Steven
26 Mar, 2025, 16:18
  1. use the function domain instead.
  2. do the auth check in your function code. For example, for stripe, we check the webhook signature and validate it.
Reply

Reply to this thread by joining our Discord

Reply on Discord

Need support?

Join our Discord

Get community support by joining our Discord server.

Join Discord

Get premium support

Join Appwrite Pro and get email support from our team.

Learn more