---
title: "Retrieve the keys from the backup for a given room."
method: GET
path: "/_matrix/client/v3/room_keys/keys/{roomId}"
tags: ["End-to-end encryption"]
---

# Retrieve the keys from the backup for a given room.

`GET /_matrix/client/v3/room_keys/keys/{roomId}`

## Request

- Base URL: `https://matrix.org`
- URL: `https://matrix.org/_matrix/client/v3/room_keys/keys/{roomId}`
- Auth: one of:
  - API key in query parameter `access_token`
  - HTTP bearer
- TypeScript: <https://skmtc.dev/matrix/apis/matrix-client-server-api/docs/_matrix/client/v3/room_keys/keys/:roomId/get.ts> (a function with typed inputs; its response is checked against the schema)

Retrieve the keys from the backup for a given room.

## Path parameters

- `roomId` string, required

## Query parameters

- `version` string, required

## Response `200`

The key data.  If no keys are found, then an object with an empty
`sessions` property will be returned (`{"sessions": {}}`).

- object: The backed up keys for a room.
  - `sessions` object, required: A map of session IDs to key data.

## Other responses

- `404`: The backup was not found.
- `429`: This request was rate-limited.

---

[API](https://skmtc.dev/matrix/apis/matrix-client-server-api.md) - [All operations](https://skmtc.dev/matrix/apis/matrix-client-server-api/llms.txt) - [OpenAPI document](https://skmtc.dev/matrix/apis/matrix-client-server-api/revisions/c7fe4072c681?raw)
