<@U04UQ68083H> Transient payload is missing in pos...
# ory-copilot
l
@chilly-king-10285 Transient payload is missing in post register hook
b
A message from kapa.ai
If the
transient_payload
is missing in your post-registration hook, there are a few things to consider based on the knowledge sources: 1. Correct Usage and Placement: The
transient_payload
field is supported in the registration flow and is designed to forward data to webhooks without persisting it in Ory. You must include it in your registration flow submission payload, for example:
Copy code
json    {      "method": "password",      "traits.email": "<mailto:email@example.com|email@example.com>",      "password": "verystrongpassword",      "transient_payload": {        "consents": ["newsletter", "usage_stats"]      }    }
This data should be available to your post-registration webhooks as described in the documentation and API references [Docs: Submit registration flow](https://www.ory.sh/docs/kratos/bring-your-own-ui/custom-ui-basic-integration#submit-registration-flow) [Github Issue: Possibility to define complex data types in the metadata of identity](https://github.com/ory/network/issues/187). 2. Webhooks and Flow Type: There have been issues reported where webhooks (and by extension, the
transient_payload
) do not fire or are not available in certain flows, especially when using native API flows versus browser flows. For example, in some cases, the after-registration webhook does not trigger for native flows, or the session hook may override other hooks, preventing your webhook from running and thus not receiving the
transient_payload
[Github Issue: After registration webhooks aren't executed on native api flows](https://github.com/ory/network/issues/353) [Github Issue: "after registration" hook is not fired](https://github.com/ory/network/issues/361). 3. Hook Ordering: If you have the "Sign in after registration" (session hook) enabled, it may override or prevent your custom webhook from firing. The recommended solution is to ensure your webhook runs before the session hook. You can do this by editing your registration hooks configuration (preferably using the Ory CLI) and making sure the session hook is last in the list:
Copy code
yaml    password:      hooks:      - hook: web_hook        config:          url: <https://your-webhook-url>          method: POST      - hook: session
This ensures your webhook (and thus the
transient_payload
) is processed before the session is created [Github Issue: "after registration" hook is not fired](https://github.com/ory/network/issues/361). 4. Known Issues and Limitations: There are known issues where the
transient_payload
or other form data may not be available in API/native flows due to how Ory handles continuity containers (session state). This is especially true if the required cookies are not present or if the flow is not browser-based. The Ory team is aware and working on improvements, but for now, this can be a limitation [Github Issue: Traits from the Update Registration API Flow payload with OIDC get lost](https://github.com/ory/network/issues/345). Summary: If your
transient_payload
is missing in the post-registration hook, check that: - You are including it in the registration payload. - Your webhook is configured to run before the session hook. - You are aware of the limitations in native/API flows versus browser flows. If you have followed all these steps and it is still missing, it may be due to a known issue or limitation in the current Ory implementation for your specific flow type.
l
@chilly-king-10285 can I define transient_payload on kratos config yaml ?
b
A message from kapa.ai
No, you cannot define a default or static
transient_payload
in the Kratos config YAML file. The
transient_payload
is designed to be provided dynamically as part of the registration (or other self-service) flow request payload by the client application. It is meant for passing temporary, per-request data (such as consents or custom values) that is forwarded to webhooks or email templates, but not persisted by Ory. You must include the
transient_payload
in the API request when submitting the registration flow, for example:
Copy code
json {   "method": "password",   "traits": {     "email": "<mailto:user@example.com|user@example.com>"   },   "password": "verystrongpassword",   "transient_payload": {     "consents": ["newsletter", "usage_stats"]   } }
This field is not configurable in the static Kratos configuration file; it is only available at runtime via the API request body [Docs: Submit registration flow](https://www.ory.sh/docs/kratos/bring-your-own-ui/custom-ui-basic-integration#submit-registration-flow) [Github Issue: Possibility to define complex data types in the metadata of identity](https://github.com/ory/network/issues/187).
l
@chilly-king-10285 how can I get logs of whats posted to webhook
b
A message from kapa.ai
To get logs of what is posted to a webhook in Ory Polis Directory Sync, you can enable webhook event logging in the Admin Portal. Here’s how: 1. Go to Directory Sync in your Admin Portal. 2. Click the edit icon for your directory sync connection. 3. Enable the Enable Webhook events logging option. Once enabled, you can view webhook events: 1. In Directory Sync, click the database icon for your connection. 2. Go to the Webhook Events tab. 3. Click the eye icon to view the raw JSON data of each event. By default, webhook events are not logged, so you must enable this feature to see the logs of what was posted to your webhook [Manage directories](https://www.ory.sh/docs/polis/admin-portal/directory-sync). If you are using other Ory products (like Ory Kratos or Ory Actions), the knowledge sources do not mention a built-in way to log webhook payloads directly from the Ory Console or configuration. In such cases, you would need to implement logging on your own webhook endpoint to capture incoming requests.
l
@chilly-king-10285 how can I log webhook events on ory kratos
b
A message from kapa.ai
I'm sorry, but the knowledge sources do not contain explicit information about logging webhook events directly within Ory Kratos. While Ory Polis provides a built-in option to log webhook events via the Admin Portal, there is no mention of a similar feature for Ory Kratos in the provided documentation. For Ory Kratos, the recommended approach—based on available information—is to implement logging on your own webhook endpoint. This means you should configure your webhook receiver (the external service or endpoint you control) to log incoming requests for auditing or debugging purposes. If you need more advanced or built-in logging features for webhooks in Ory Kratos, the knowledge sources do not provide details on such capabilities.
l
@chilly-king-10285 flow details are not returned in post register webhook on a native flow
b
A message from kapa.ai
The knowledge sources indicate that there are known issues with native (API) registration flows in Ory Kratos where certain context, such as the flow details or
transient_payload
, may not be available in post-registration webhooks. This is due to how Ory Kratos manages session state and continuity containers in native flows. Specifically, the continuity container—which holds form data and flow context—relies on browser cookies, which are not present in native/API flows. As a result, the webhook may not receive the full flow details as it would in a browser flow. A member of the Ory team has confirmed this limitation and mentioned that a solution would require changes to how the continuity container is managed for native flows, such as attaching it to the
state
parameter. This is a recognized issue and not a misconfiguration on your part [Traits from the Update Registration API Flow payload with OIDC get lost](https://github.com/ory/network/issues/345). Summary: Flow details are not returned in the post-registration webhook on a native flow due to a limitation in how Ory Kratos handles session continuity for API/native flows. This is a known issue and may require future changes in Ory Kratos to resolve.