---
name: "X-Up-Fail-Context"
area: "API"
kind: "HTTP header"
parent: "up.protocol module"
visibility: "experimental"
url: "https://unpoly.com/api/X-Up-Fail-Context"
---
<nav aria-label="Unpoly docs">[All docs](https://unpoly.com/index.md) · [up.protocol module](https://unpoly.com/api/up.protocol.md)</nav>

# X-Up-Fail-Context

**This feature is experimental**. Please [share](https://github.com/unpoly/unpoly/discussions) your experiences so we know what to keep or change.

This request header contains the [context](https://unpoly.com/learn/layer-context.md) of the layer that Unpoly updates when the server sends an [error response](https://unpoly.com/learn/error-responses.md), serialized as JSON.

An error response has a status code other than 2xx, but still contains HTML.

Server-side code is free to render different HTML for different contexts.

## Example {#example}

```http
X-Up-Fail-Context: { "lives": 3 }
```

