This commit is contained in:
Iyeoluwa Akinrinola
2025-05-16 15:52:20 +01:00
parent 1896298a18
commit 463923278a
2 changed files with 60 additions and 1 deletions
+25
View File
@@ -271,5 +271,30 @@ class OpenWebUIChannels:
print(f"Error sending message to channel: {str(e)}")
return None
def get_webhooks(self) -> List[Dict[str, Any]]:
"""
Get all registered webhooks.
Returns:
List of webhook data.
"""
try:
# Make API request to get webhooks
response = requests.get(
f"{self.openwebui_url}/api/webhooks",
headers=self.headers,
timeout=30
)
if response.status_code == 200:
return response.json()
else:
print(f"Error getting webhooks: {response.status_code} - {response.text}")
return []
except Exception as e:
print(f"Error getting webhooks: {str(e)}")
return []
# Create a singleton instance
openwebui_channels = OpenWebUIChannels()