Skip to content

AutoGPT is the vision of accessible AI for everyone, to use and to build on. Our mission is to provide the tools, so that you can focus on what matters.

fix(backend): Fix webhook ingress URL generation (#9209)

Reinier van der Leer7a9a77171856
diff --git a/autogpt_platform/backend/backend/data/integrations.py b/autogpt_platform/backend/backend/data/integrations.py
index 95034d078b..2ed06e2015 100644
--- a/autogpt_platform/backend/backend/data/integrations.py
+++ b/autogpt_platform/backend/backend/data/integrations.py
@@ -35,7 +35,7 @@ class Webhook(BaseDbModel):
@computed_field
@property
def url(self) -> str:
- return webhook_ingress_url(self.provider.value, self.id)
+ return webhook_ingress_url(self.provider, self.id)
@staticmethod
def from_db(webhook: IntegrationWebhook):
diff --git a/autogpt_platform/backend/backend/integrations/webhooks/utils.py b/autogpt_platform/backend/backend/integrations/webhooks/utils.py
index 87724c04cd..1dc037d82d 100644
--- a/autogpt_platform/backend/backend/integrations/webhooks/utils.py
+++ b/autogpt_platform/backend/backend/integrations/webhooks/utils.py
@@ -1,10 +1,11 @@
+from backend.integrations.providers import ProviderName
from backend.util.settings import Config
app_config = Config()
# TODO: add test to assert this matches the actual API route
-def webhook_ingress_url(provider_name: str, webhook_id: str) -> str:
+def webhook_ingress_url(provider_name: ProviderName, webhook_id: str) -> str:
return (
f"{app_config.platform_base_url}/api/integrations/{provider_name}"
f"/webhooks/{webhook_id}/ingress"