few-scooter-86891
10/16/2023, 4:05 AMchilly-king-10285
10/16/2023, 4:05 AMchilly-king-10285
10/16/2023, 4:05 AMfew-scooter-86891
10/16/2023, 7:44 AMchilly-king-10285
10/16/2023, 7:44 AMchilly-king-10285
10/16/2023, 7:45 AMidentity
in it, the values from that object will be used to change the identity before it is saved to the database. Modifying the identity is currently only possible during the registration and settings flows. Here is an example of how you can do this: yaml hook: web_hook config: response: parse: true
[Source](https://www.ory.sh/docs/guides/integrate-with-ory-cloud-through-webhooks) 2. Update Identity Metadata: When the webhook target returns a 200 OK response code and the response body is a JSON object with the key identity.metadata_public
or identity.metadata_admin
in it, the values from that object will be used to replace the identity metadata fields before they are saved to the database. This method replaces the entire metadata object. You can't update only a single value in metadata_public
or metadata_admin
. Here is an example of how you can do this: json { "identity": { "metadata_public": { "the_webhook": "changed this value", "and_added_this_one": "too" }, "metadata_admin": { "the_webhook": "updated this value", "and_this_one": "too" } } }
[Source](https://www.ory.sh/docs/guides/integrate-with-ory-cloud-through-webhooks) 3. Update Identity Traits: When the webhook target returns a 200 OK response code and the response body is a JSON object with the key identity.traits
in it, the values from that object will be used to replace the identity traits before they are saved to the database. This method replaces the entire identity traits object. It is not possible to update only a single trait. Here is an example of how you can do this: json { "identity": { "traits": { "email": "[email protected]", "the_webhook": "updated this value" } } }
[Source](https://www.ory.sh/docs/guides/integrate-with-ory-cloud-through-webhooks) 4. Webhook Retries: Sometimes webhook delivery can fail due to issues such as network problems or server errors. To mitigate this, Ory Network implements a retry policy that attempts to deliver the payload up to three times, with a 30-second timeout between each attempt. This means that if delivery fails on the first attempt, Ory Network will automatically retry the delivery two more times, with a 30-second delay between each retry. [Source](https://www.ory.sh/docs/guides/integrate-with-ory-cloud-through-webhooks)