# Protocol versions (https://docs.open-e2ee.dev/signal-relay/protocol-versions.md)

A Relay protocol version is the wire that the OpenE2EE Signal Protocol SDK and the OpenE2EE Signal Protocol Relay agree on. The Relay reads one version from each request.

- The Relay serves only version 3. See [served versions](https://docs.open-e2ee.dev/signal-relay/protocol-versions.md#served-versions).
- SDK 14.4.0 and later releases send version 3. They send the header `x-signal-relay-protocol: 3` on each HTTP request to a Relay route. They offer the subprotocol token `signal-relay.v3` on the mailbox socket, and the Relay echoes it. The connection document and CORS preflight read no version.
- SDK 13.5.0 through 14.3.0 send version 2. They send the header `x-open-e2ee-relay-protocol: 2` on each HTTP request to a Relay route. They offer the subprotocol token `open-e2ee-relay.v2` on the mailbox socket.
- SDK 10.1.0 through 13.4.0 send version 1. They send the header `x-open-e2ee-relay-protocol: 1` on each HTTP request to a Relay route. They send no header on the fetch of the connection document.
- SDK 10.0.0 sends no header.
- SDK 14.3.0 and earlier releases send version 1, version 2, or no version. The Relay refuses each of their requests with `UPGRADE_REQUIRED`. See [refusals](https://docs.open-e2ee.dev/signal-relay/protocol-versions.md#refusals).
- A delivery request gets `DELIVERY_ALREADY_ACCEPTED` when its message identifier belongs to an operation that the Relay already accepted. See [errors](https://docs.open-e2ee.dev/reference/errors.md#relay-delivery).

## Served versions [#served-versions]

| Version | First SDK release | Earliest removal |
|---|---|---|
| 3 | 14.4.0 | None |

SDK 14.4.0 and later releases send version 3. They send version 2 only after the Relay refuses version 3. See [what the SDK does with a refusal](https://docs.open-e2ee.dev/signal-relay/protocol-versions.md#what-the-sdk-does-with-a-refusal).

## Removed versions [#removed-versions]

| Version | SDK releases | Removed |
|---|---|---|
| 1 | 10.1.0 through 13.4.0 | 2026-11-15 |
| 2 | 13.5.0 through 14.3.0 | 2026-11-17 |

The Relay refuses a removed version with `UPGRADE_REQUIRED`.

## Protocol 3 [#protocol-3]

Version 3 uses the names in this section on the wire.

### Version carriers [#version-carriers]

| Carrier | Version 3 | Removed versions 1 and 2 |
|---|---|---|
| HTTP header | `x-signal-relay-protocol: 3` | `x-open-e2ee-relay-protocol: 1` or `x-open-e2ee-relay-protocol: 2` |
| Socket subprotocol token | `signal-relay.v3` | `open-e2ee-relay.v1` or `open-e2ee-relay.v2` |
| Socket auth entry prefix | `signal-relay.auth.` | Not read |

Version 3 is valid only on its own carrier. The Relay answers `PROTOCOL_UNSUPPORTED` to each of these requests:

- A request with version 3 on the header `x-open-e2ee-relay-protocol` or the token `open-e2ee-relay.v3`.
- A request with both HTTP headers.

A request with version 1 or version 2 gets `UPGRADE_REQUIRED` on each carrier. A request with no version also gets `UPGRADE_REQUIRED`.

The socket auth entry is the prefix followed by the device token. The Relay reads the auth entry only when its prefix matches the version of the subprotocol token.

### Device tokens [#device-tokens]

A version 3 request gets a device token with these names.

| Claim | Version 3 |
|---|---|
| `iss` | `signal-relay` |
| `aud` | `signal-relay-device` |
| Scope claim | `signal_relay_scope_id` |

The Relay accepts only a token with these names. A token with the earlier issuer, audience, or scope claim gets `TOKEN_INVALID`. When an HTTP call gets `TOKEN_INVALID`, the SDK gets a new token and sends the request once more.

### Signed labels [#signed-labels]

Each signed challenge starts with a label. The signed bytes hold the label followed by a NUL byte (`\0`). Version 3 uses these six labels.

| Signed value | Version 3 label |
|---|---|
| Device authentication | `signal-relay-device-authentication-v2` |
| Registration challenge | `signal-relay-registration-challenge-v2` |
| Recovery challenge | `signal-relay-recovery-challenge-v2` |
| Device link challenge | `signal-relay-device-link-challenge-v2` |
| Device token refresh challenge | `signal-relay-device-token-refresh-challenge-v2` |
| Sender certificate request | `signal-relay-sender-certificate-request-v2` |

### Response fields [#response-fields]

Each of these responses holds the version 3 key in this table.

| Where | Version 3 key |
|---|---|
| Response of `/identity/register`, `/identity/recover`, and `/identity/devices/link` | `signalRelayScopeId` |
| Response of `/mailbox/pull` and the socket `mailbox-capabilities` frame | `signalRelayReceipts: true` |

## Window policy [#window-policy]

When a later version ships, the earlier version gets an earliest removal date. That date is 180 days after the SDK release that carries the later version. The Relay removed versions 1 and 2 before their earliest removal dates.

The Relay never rolls back below a version that the Served versions table lists.

## Refusals [#refusals]

The Relay refuses a version outside the served set with one of two error codes.

| Code | Cause | HTTP | Socket | What the application does |
|---|---|---|---|---|
| `UPGRADE_REQUIRED` | The version is below the oldest served version, or the request has no version. | 426, `retryable` false | Close 4426 | Update to an SDK release that speaks a served version. A retry fails the same way. See [upgrades](https://docs.open-e2ee.dev/operate/upgrades.md#upgrading-from-1430-or-earlier). |
| `PROTOCOL_UNSUPPORTED` | The version is above the newest served version, or it is malformed. | 400, `retryable` true | Close 4400 | Retry later. A version above the newest served version is transient, because the Relay never rolls back below a version that the Served versions table lists. A malformed version fails until the client sends a valid one. The mailbox subscription of the SDK reconnects with its usual backoff. |

Version 3 is the only served version. A version 3 request from SDK 14.4.0 or a later release does not get `UPGRADE_REQUIRED`. SDK 14.3.0 and earlier releases get it.

## What the SDK does with a refusal [#what-the-sdk-does-with-a-refusal]

SDK 10.1.0 and later releases stop on `UPGRADE_REQUIRED`. On `PROTOCOL_UNSUPPORTED`, the mailbox socket reconnects, and an HTTP call throws an error whose `retryable` is true. SDK 14.4.0 and later releases first fall back from version 3 to version 2, as the last list on this page tells.

- An HTTP call that gets `UPGRADE_REQUIRED` throws `HostedSignalProtocolRelayUpgradeRequiredError`. Its `code` is `UPGRADE_REQUIRED`, and its `retryable` is false. The SDK does not retry it. See [errors](https://docs.open-e2ee.dev/reference/errors.md#relay-protocol-version).
- A socket close 4426 with the reason `UPGRADE_REQUIRED` moves the mailbox subscription to `stopped` with the reason `upgrade-required`. The subscription does not reconnect and does not pull. Only a newer SDK can connect again.
- A socket close 4400 with the reason `PROTOCOL_UNSUPPORTED` stays retryable, and so does the HTTP code `PROTOCOL_UNSUPPORTED`.

SDK 14.4.0 and later releases offer version 3 first. When the Relay refuses version 3 with `PROTOCOL_UNSUPPORTED`, the client offers version 2 from then on. The Relay refuses version 2 with `UPGRADE_REQUIRED`, so the client stops.

- An HTTP call sends the refused request once more with version 2. The Relay refuses the version before it reads the request, so the refused request had no effect. The client signs each proof in the request again with the label of version 2.
- After a socket close 4400 with the reason `PROTOCOL_UNSUPPORTED`, the mailbox subscription reconnects with its usual backoff. The next socket offers version 2.
- The client keeps version 2 until it stops. A new client, or a client that resumes from its store, offers version 3 again. The SDK does not store the offered version.
- The SDK does not fall back to version 1.
- The fallback needs a Relay that reads the version 3 carriers. A Relay that predates version 3 does not refuse version 3 with `PROTOCOL_UNSUPPORTED`, so the client does not fall back. Use SDK 14.4.0 or a later release with a Relay that serves version 3.
