Events in rooms of this version have the following structure:

Persistent Data Unit


A persistent data unit (event) for room version 4 and beyond.

Persistent Data Unit
Name Type Description
auth_events [string] Required:

Event IDs for the authorization events that would allow this event to be in the room.

Must contain less than or equal to 10 events. Note that if the relevant auth event selection rules are used, this restriction should never be encountered.

content object Required: The content of the event.
depth integer Required: The maximum depth of the prev_events, plus one. Must be less than the maximum value for an integer (2^63 - 1). If the room’s depth is already at the limit, the depth must be set to the limit.
hashes Event Hash Required: Content hashes of the PDU, following the algorithm specified in Signing Events.
origin_server_ts integer Required: Timestamp in milliseconds on origin homeserver when this event was created.
prev_events [string] Required:

Event IDs for the most recent events in the room that the homeserver was aware of when it made this event.

Must contain less than or equal to 20 events.

redacts string For redaction events, the ID of the event being redacted.
room_id string Required: Room identifier.
sender string Required: The ID of the user sending the event.
signatures {string: Server Signatures} Required: Signatures for the PDU, following the algorithm specified in Signing Events.
state_key string If this key is present, the event is a state event, and it will replace previous events with the same type and state_key in the room state.
type string Required: Event type
unsigned UnsignedData Additional data added by the origin server but not covered by the signatures.
Event Hash
Name Type Description
sha256 string Required: The hash.
UnsignedData
Name Type Description
age integer The number of milliseconds that have passed since this message was sent.

Examples

{
  "auth_events": [
    "$urlsafe_base64_encoded_eventid",
    "$a-different-event-id"
  ],
  "content": {
    "key": "value"
  },
  "depth": 12,
  "hashes": {
    "sha256": "thishashcoversallfieldsincasethisisredacted"
  },
  "origin": "example.com",
  "origin_server_ts": 1404838188000,
  "prev_events": [
    "$urlsafe_base64_encoded_eventid",
    "$a-different-event-id"
  ],
  "redacts": "$some-old_event",
  "room_id": "!UcYsUzyxTGDxLBEvLy:example.org",
  "sender": "@alice:example.com",
  "signatures": {
    "example.com": {
      "ed25519:key_version:": "these86bytesofbase64signaturecoveressentialfieldsincludinghashessocancheckredactedpdus"
    }
  },
  "state_key": "my_key",
  "type": "m.room.message",
  "unsigned": {
    "age": 4612,
    "key": "value"
  }
}