Thanks to webhooks, you can easily integrate with external services, for example ERP or CRM. Ory Identities (Ory Kratos) allows you to tie the execution of custom calls to external systems to self-service user flows.
Self-service user flows are actions that the users of a system perform on their own, without the need of administrative intervention.
By triggering custom logic at specific points of self-service user flows, you can custom-tailor your users' customer experience, trigger usage data collection to learn more about how your system is used, and more.
Follow these steps to add a webhook that enables integration with Mailchimp. With this integration in place, the system sends a welcome email message to all newly registered users.
Get the Ory Identities config with Ory CLI:
## List all available projects
ory list projects
## Get config
ory get identity-config <project-id> --format yaml > identity-config.yaml
Create a request body Jsonnet snippet and encode it with Base64:Mailchimp request body
key: "<Your-Api-Key>", // Mailchimp requires passing the API key in request body.
from_email: "[email protected]",
subject: "Hello from Ory",
text: "Welcome to Ory! Have fun and happy hacking!",
Add the webhook configuration to the downloaded Ory Identities (Ory Kratos) configuration file.identity-config.yaml
registration: # Defines for which flow triggers the hook.
after: # Defines the point at which the hook runs.
password: # When method is defined, the hook is triggered only for this particular method and flow.
- hook: web_hook
# Encode the Jsonnet with Base64 and add the encoded string to 'body'.
Update the Ory Identities configuration using the file you worked with:
ory update identity-config <project-id> --file updated_config.yaml
Read this document to learn more about hooks in The Ory Network.