---
title: Set Failure Details node
description: Configure the Set Failure Details node to add a custom failure message, extra key-value fields, and custom response headers to the JSON response when a journey ends in failure.
component: auth-node-ref
version: 8
page_id: auth-node-ref::set-failure-details
canonical_url: https://docs.pingidentity.com/auth-node-ref/latest/set-failure-details.html
llms_txt: https://docs.pingidentity.com/auth-node-ref/llms.txt
docs_for_agents: https://developer.pingidentity.com/build-with-ai/docs-for-agents.md
keywords: ["Nodes &amp; Trees", "Journeys", "Authentication"]
superseded_by: https://docs.pingidentity.com/auth-node-ref/latest/set-failure-details.html
section_ids:
  examples: Examples
  availability: Availability
  inputs: Inputs
  dependencies: Dependencies
  configuration: Configuration
  outputs: Outputs
  callbacks: Callbacks
  outcomes: Outcomes
  errors: Errors
---

# Set Failure Details node

The Set Failure Details node adds details to the JSON response when a journey ends in failure. You can configure the node properties to return a failure message and extra information in the form of static `key:value` fields.

## Examples

This example uses the Set Failure Details node and assumes the following configuration:

* Failure Message

  * Key: `en-gb`

  * Value: `Your account is locked`

* Failure Details

  * Key: `Reason`

  * Value: `Exceeded max retries`

![set failure success details journey](_images/set-failure-success-details-journey.png)

* The [Page node](page.html) containing the [Platform Username node](platform-username.html) and [Platform Password node](platform-password.html) prompts for credentials.

* The [Data Store Decision node](data-store-decision.html) validates the username-password credentials.

* If authentication is successful:

  * The [Increment Login Count node](increment-login-count.html) updates the number of successful authentications in the user profile.

  * The [Set Success Details node](set-success-details.html) adds any configured details to the JSON response.

* If authentication fails:

  * The [Retry Limit Decision node](retry-limit-decision.html) checks the number of failed authentications against the configured limit. If the retry limit is reached, the journey continues on the `Reject` outcome path.

  * The [Account Lockout node](account-lockout.html) locks the account.

  * The Set Failure Details node displays the configured message to the user and adds both the message and the details to the JSON response.

    For example:

    ```json
    {
      "code":401,
      "reason":"Unauthorized",
      "message":"Your account is locked",
      "detail":{
        "Reason":"Exceeded max retries"
      }
    }
    ```

## Availability

| Product                               | Available? |
| ------------------------------------- | ---------- |
| PingOne Advanced Identity Cloud       | Yes        |
| PingAM (self-managed)                 | Yes        |
| Ping Identity Platform (self-managed) | Yes        |

## Inputs

None. This node doesn't read shared state data.

## Dependencies

This node has no dependencies.

## Configuration

| Property        | Usage                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
| --------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Failure Message | The message to add to the JSON response when authentication fails:Add a custom, localized message per locale:1) Click [icon: plus, set=fa].

2) In the Key field, enter the locale. For example, `en-gb`.[1](#locale-footnote)

3) In the Value field, enter the message. For example, `Your account has been locked`.

4) Click Done.

5) Repeat to add more messages and save your changes when you're done.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
| Failure Details | The details to add to the JSON response on journey failure:1) Click [icon: plus, set=fa].

2) In the Key field, enter a name to identify the details. For example, `Reason`.

3) In the Value field, enter the details to return. For example, `Exceeded max retries`.

   The value can be a simple text string, a boolean value, or a JSON formatted value. The value is formatted appropriately when output in the JSON response.

   For example:

   Key	Value	Output&#xA;&#xA;example&#xA;&#xA;&#x9;&#xA;&#xA;this is a test value&#xA;&#xA;&#x9;&#xA;"example": "this is a test value"&#xA;&#xA;&#xA;&#xA;boolean&#xA;&#xA;&#x9;&#xA;&#xA;true&#xA;&#xA;&#x9;&#xA;"boolean": true&#xA;&#xA;&#xA;&#xA;field&#xA;&#xA;&#x9;&#xA;&#xA;{ "nested": "nested value" }&#xA;&#xA;&#x9;&#xA;"field": {&#xA;   "nested": "nested value"&#xA;}

4) Click Done.

5) Click [icon: plus, set=fa]Add to repeat and add more details.

6) Save your changes. |

(1) Specify a [locale that Java supports](https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/util/Locale.html), such as `en-gb`. Otherwise, the node throws a configuration exception with an `Invalid locale provided` message.

## Outputs

The node adds the `FailureDetailsTreeHook`, which runs when the tree completes. Learn more in [Create tree hooks](https://docs.pingidentity.com/pingam/8/am-authentication/post-authn-plugins-treehook.html).

## Callbacks

This node doesn't send any callbacks.

## Outcomes

Single outcome path: when the journey ends in failure, this node adds the configured details to the JSON response.

## Errors

This node doesn't log any error or warning messages of its own.
