---
category: [Administration & Integrations, Administration & Integrations/Workday API, Platform and Product Extensions, Platform and Product Extensions/Integration]
keyword: [Extend, Integrate, REST API]
nav: wcp_docs
parent_url: /wcp_docs/
title: >- 
  Concept: Warning Action REST API Header
layout: subsection
---

The `wd-warning-action` HTTP header enables developers to control whether data should be persisted when a REST API request returns warning-level validation errors. By default, any validation error prevents data from being saved.

The `wd-warning-action` header enables applications to:

-   Save data even if warning-level validations fail.
-   Add business logic to bypass non-critical warnings while still enforcing strict requirements for critical errors, enabling applications to differentiate between critical blockers and informative warnings.

    Example: Display a message to users, preventing them from being blocked by a warning about minor data issues that do not violate core business integrity.



To persist the data when a REST API validation fails with a warning, set the `wd-warning-action` header value to `updateonwarning`.

Example:

```
wd-warning-action: updateonwarning
```

In this example, a `POST /workers/{ID}/correctTimeOffEntry` request includes the `wd-warning-action: updateonwarning` header value and encounters a validation warning. This sample response includes updated data and error with the warning severity:

```
{
  "id": "a3831b16b11b0100165fb6bb5fc40000",
  "descriptor": "Absence Correction: Abs_Emp1_ 5911107",
  "businessProcessParameters": {
    "overallBusinessProcess": {
      "descriptor": "Absence Correction: Abs_Emp1_ 5911107",
      "id": "a3831b16b11b0100165fb6bb5fc40000"
    },
    "for": {
      "descriptor": "Abs_Emp1_ 5911107",
      "id": "a3831b16b11b0100162d92be3a610000"
    },
    "transactionStatus": {
      "descriptor": "Successfully Completed",
      "id": "b90bc51be01d4ae99b603b02b073714d"
    },
    "overallStatus": "Successfully Completed"
  },
  "days": [
    {
      "id": "a3831b16b11b0100165fb6bb5fc40001",
      "descriptor": "01/07/2025 - -7 Hours (Abs_Emp1_ 5911107)",
      "correctedEntry": {
        "descriptor": "01/07/2025 - -7 Hours (Abs_Emp1_ 5911107)",
        "id": "a3831b16b11b0100165fb6bb5fc40001"
      },
      "comment": "minimum and increments warning of 2",
      "dailyQuantity": "-7"
    }
  ],
  "errors": [
    {
      "error": "For 01/07/2025, the Daily Quantity for Time Off Type Name-597792026-03-11T10:09:57.976 should be in increments of 2 Hours.",
      "code": "A1023",
      "severity": "Warning"
    }
  ]
}
```

## <a id="section_usage_guidelines"></a>Usage Guidelines

Consider these guidelines when using the header:

-   You can use the `wd-warning-action` header with endpoints that have warning validations for methods that update data: `POST`, `PATCH`, `PUT`, and `DELETE`.
-   The only valid header value is `updateonwarning`. An invalid or null value returns an error.
-   A misspelled header name results in the default behavior (a warning returns an error response without data persistence).
-   A critical validation failure is a critical error that stops processing and blocks data persistence, regardless of warning validations and the `wd-warning-action` setting.
-   To ensure data integrity and system efficiency, the REST API framework performs validation checks in a specific sequence. The framework immediately stops processing and returns an error as soon as the first critical validation failure occurs. Subsequent validation levels will not be evaluated until the preceding errors are resolved.
-   Warnings themselves do not persist as part of the business object. If you need an audit trail of warnings, capture them from the error response.
-   The `wd-warning-action` and `x-validate-only` REST API headers are mutually exclusive. You cannot use both headers in the same REST API request, even if `x-validate-only:0`.


