Reset Room E2E Key

Prev Next
Post
/api/v1/e2e.resetRoomKey

Resets the E2E key of an encrypted room. For every member who has a key for the room, the current key is moved to their previous room keys, and the latest 10 previous keys are kept. Members other than the authenticated user are added to the room's queue of users waiting for the new key, up to 50 members. The new key is set for the authenticated user.

The authenticated user must have E2E keys, and the room must already be encrypted. Only one reset can run for a room at a time.

Permission required: toggle-room-e2e-encryption

Changelog

Version Description
8.3.0 The 403 response returns error-not-allowed instead of unauthorized
7.0.0 Added
Header parameters
X-User-Id
stringRequired

The user ID.

ExampleCkCPNctrgCDfmWLqC
X-Auth-Token
stringRequired

The authentication token.

Example1Dd4iN_ClKn5jl-xPC36snQ4s9Zd5GZnXCQuCNSKcVE
Body parameters
Example
{
  "rid": "wCiXndNp5NqNY3uCc",
  "e2eKey": "9b7c2e4f1a6dbmV3LWVuY3J5cHRlZC1rZXk",
  "e2eKeyId": "9b7c2e4f1a6d"
}
object
rid
string Required

The room ID.

ExamplewCiXndNp5NqNY3uCc
e2eKey
string Required

The new room key, encrypted with the authenticated user's E2E public key.

Example9b7c2e4f1a6dbmV3LWVuY3J5cHRlZC1rZXk
e2eKeyId
string Required

The ID of the new room key.

Example9b7c2e4f1a6d
Responses
200

OK

Success
{
  "success": true
}
object
success
boolean
400

Bad Request

Invalid Params
{
  "success": false,
  "error": "must have required property 'e2eKeyId'",
  "errorType": "invalid-params"
}
Reset in Progress
{
  "success": false,
  "error": "error-e2e-key-reset-in-progress"
}
No Room Access
{
  "success": false,
  "error": "error-not-allowed"
}
Reset Failed
{
  "success": false,
  "error": "error-e2e-key-reset-failed"
}
object
success
boolean
error
string
errorType
string
401

Unauthorized

Authorization Error
{
  "status": "error",
  "message": "You must be logged in to do this."
}
object
status
string
message
string
403

Forbidden

Permission Error
{
  "success": false,
  "error": "error-not-allowed"
}
object
success
boolean
error
string