{% extends "layout.html" %} {% block content %}

Webhooks initialization:

1. All active subscriptions will be paused
2. Target url will be updated to {{ target_url }}
3. Following subscriptions will be created and activated:
// src/routes/init.py
pause_active_subscriptions(hubspot_client=hubspot, app_id=app_id)

target_url = url_for("webhooks.handle", _external=True)
configure_target_url(hubspot_client=hubspot, app_id=app_id, target_url=target_url)

subscriptions = [
    {"event_type": "contact.propertyChange", "property_name": "firstname"},
    {"event_type": "contact.creation"},
    {"event_type": "contact.deletion"},
]
for subscription in subscriptions:
    create_or_activate_subscription(
        hubspot_client=hubspot,
        app_id=app_id,
        **subscription,
    )
{% endblock %}