<@U04UQ68083H> I am using hosted Ory Network for u...
# ory-copilot
a
@chilly-king-10285 I am using hosted Ory Network for users to sign up. How can I trigger a callback that notified a server of the newly-created user’s ID?
c
A message from kapa.ai
You can achieve this by using Ory Actions, which supports webhooks. Webhooks are HTTP callbacks that can be triggered by specific events in your Ory-powered application, such as user registration. Here are the steps to create an action on the Ory Network: 1. Navigate to [Ory Network > Developers > Actions](https://console.ory.sh/projects/current/developers/actions). There, click on + Create new Action. 2. Choose the flow type that best suits your need and determine the execution time. Here, you should also provide other necessary data, such as the URL and request method. 3. Click on Next. The ensuing screen allows you to establish authentication parameters and input request body details. 4. Once you have all adjusted settings, click on Save action. Your new Ory Action has now been created and is ready to operate. You can further customize the behavior of the system by defining what action to trigger based on the authentication method used to sign in, register, and update user settings. For example, when a user signs up, you can use Ory Actions to send a callback to your server with the user's ID. For more information, you can refer to the following documentation: - [Trigger custom logic and integrate with external systems with webhooks](https://www.ory.sh/docs/guides/integrate-with-ory-cloud-through-webhooks) - [Creating Actions on the Ory Network](https://www.ory.sh/docs/guides/integrate-with-ory-cloud-through-webhooks#creating-actions-on-the-ory-network) - [Triggers based on authentication methods](https://www.ory.sh/docs/kratos/hooks/configure-hooks#triggers-based-on-authentication-methods)
a
@chilly-king-10285 i get “message”: “webhook failed with status code 401",
c
A message from kapa.ai
The error message "webhook failed with status code 401" typically indicates an issue with authorization. This means that the server you're trying to reach via the webhook is expecting some form of authentication that it's not receiving. Here are a few things you can check: 1. Authentication: Ensure that the server you're trying to reach with the webhook is receiving the correct authentication credentials. This could be an API key, a token, or some other form of authentication. 2. Webhook Configuration: Check your webhook configuration in Ory. Make sure the URL, headers, and any other necessary parameters are correctly set up. 3. Server Logs: Check the logs of the server you're trying to reach. They might provide more detailed information about why the request is unauthorized. 4. Retry Policy: Ory implements a retry policy that attempts to deliver the payload up to three times, with a 30-second timeout between each attempt. If delivery fails on the first attempt, Ory will automatically retry the delivery two more times. If all attempts fail, you will receive the error message. For more information, refer to the following documentation: - [Troubleshoot Ory Actions Webhook issues](https://www.ory.sh/docs/troubleshooting/troubleshoot-actions) - [Webhook retries](https://www.ory.sh/docs/guides/integrate-with-ory-cloud-through-webhooks#webhook-retries)