<@U04UQ68083H> - what is the Ory webhook flow that...
# ory-copilot
h
@chilly-king-10285 - what is the Ory webhook flow that’s triggered when an identity trait is updated?
b
A message from kapa.ai
When an identity trait is updated in Ory (for example, when a user changes their profile information), the relevant webhook flow is the settings flow. Ory Identities allows you to configure webhooks (Actions) that run before and after a profile update is successful. These hooks can be used to trigger custom logic or integrate with external systems whenever identity traits are changed. Specifically, you can use the after settings flow to trigger a webhook after the identity traits have been updated. This is the only action type available for the after settings flow: > The web_hook action ... can be used with all flows and methods except error and logout. This is the only action type available for the after settings flow. [Available actions](https://www.ory.sh/docs/kratos/hooks/configure-hooks#available-actions) For more details on configuring these hooks, see the documentation on [settings and profile updates](https://www.ory.sh/docs/kratos/self-service/flows/user-settings#hooks). Additionally, if you want the webhook to modify the identity as part of the update, you must configure the webhook to parse the response and return the updated identity data in the correct format. This is supported during the registration and settings flows only. [Modify identities](https://www.ory.sh/docs/guides/integrate-with-ory-cloud-through-webhooks#modify-identities)
h
@chilly-king-10285 My identity schema is:
Copy code
{
  "$schema": "<http://json-schema.org/draft-07/schema#>",
  "$id": "user-v1.json",
  "title": "Person",
  "type": "object",
  "properties": {
    "traits": {
      "type": "object",
      "properties": {
        "email": {
          "type": "string",
          "format": "email",
          "title": "Email",
          "ory.sh/kratos": {
            "credentials": {
              "password": {
                "identifier": true
              },
              "webauthn": {
                "identifier": true
              },
              "totp": {
                "account_name": true
              },
              "code": {
                "identifier": true,
                "via": "email"
              }
            },
            "recovery": {
              "via": "email"
            },
            "verification": {
              "via": "email"
            }
          },
          "maxLength": 320
        },
        "displayName": {
          "type": "string",
          "title": "Name",
          "maxLength": 30
        }
      },
      "required": [
        "email",
        "displayName"
      ],
      "additionalProperties": false
    }
  }
}
So you’re saying that if the
displayName
property is updated, then the
/selfservice/flows/settings/after/profile/hooks
hook would be triggered - is that right?
b
A message from kapa.ai
Yes, that is correct. If the
displayName
property (or any other trait) is updated via the Ory Settings/Profile flow, the configured webhook for the
after
settings/profile flow (i.e.,
/selfservice/flows/settings/after/profile/hooks
) will be triggered. This is explicitly supported by Ory, as hooks can be configured to run after a profile update is successful, and this includes updates to any identity traits defined in your schema, such as
displayName
or
email
 [Settings and profile updates](https://www.ory.sh/docs/kratos/self-service/flows/user-settings#hooks). To summarize: - When a user updates their profile (traits) through the settings flow, the
after
settings/profile webhook is triggered. - This applies to any trait, including your custom
displayName
field. If you want the webhook to modify the identity in response, you must ensure the webhook is configured to parse the response and return the updated traits in the correct format [Modify identities](https://www.ory.sh/docs/guides/integrate-with-ory-cloud-through-webhooks#modify-identities).