### Clarify Server-Server API Request Signing Example Source: https://spec.matrix.org/v1.15/changelog/v1.10/checklist Clarifies the Server-Server API request signing example by recommending the use of the POST HTTP method. This is to ensure accuracy, as GET requests do not typically include request bodies, which are often part of signing mechanisms. ```APIDOC Server-Server API: Request Signing: - Clarify example to use POST HTTP method instead of GET. - Rationale: GET requests do not have request bodies, which are often relevant for signing. ``` -------------------------------- ### Example User Devices Response Source: https://spec.matrix.org/unstable/server-server-api An example JSON payload representing a successful response (200 OK) from the Matrix Federation API for retrieving user devices. ```JSON { "devices": [ { "device_display_name": "Alice's Mobile Phone", "device_id": "JLAFKJWSCS", "keys": { "algorithms": [ "m.olm.v1.curve25519-aes-sha2", "m.megolm.v1.aes-sha2" ], "device_id": "JLAFKJWSCS", "keys": { "curve25519:JLAFKJWSCS": "3C5BFWi2Y8MaVvjM8M22DBmh24PmgR0nPvJOIArzgyI", "ed25519:JLAFKJWSCS": "lEuiRJBit0IG6nUf5pUzWTUEsRVVe/HJkoKuEww9ULI" }, "signatures": { "@alice:example.com": { "ed25519:JLAFKJWSCS": "dSO80A01XiigH3uBiDVx/EjzaoycHcjq9lfQX0uWsqxl2giMIiSPR8a4d291W1ihKJL/a+myXS367WT6NAIcBA" } }, "user_id": "@alice:example.com" } } ], "master_key": { "keys": { "ed25519:base64+master+public+key": "base64+master+public+key" }, "usage": [ "master" ], "user_id": "@alice:example.com" }, "self_signing_key": { "keys": { "ed25519:base64+self+signing+public+key": "base64+self+signing+master+public+key" }, "signatures": { "@alice:example.com": { "ed25519:base64+master+public+key": "signature+of+self+signing+key" } }, "usage": [ "self_signing" ], "user_id": "@alice:example.com" }, "stream_id": 5, "user_id": "@alice:example.org" } ``` -------------------------------- ### Clarify Server-Server API Request Signing Example Source: https://spec.matrix.org/unstable/changelog/v1.10/checklist Clarifies the Server-Server API request signing example by recommending the use of the POST HTTP method. This is to ensure accuracy, as GET requests do not typically include request bodies, which are often part of signing mechanisms. ```APIDOC Server-Server API: Request Signing: - Clarify example to use POST HTTP method instead of GET. - Rationale: GET requests do not have request bodies, which are often relevant for signing. ``` -------------------------------- ### Matrix Presence EDU Example Source: https://spec.matrix.org/v1.15/server-server-api An example of a Matrix Event Description Unit (EDU) for presence updates, indicating a user's online status and message. ```json { "content": { "push": [ { "currently_active": true, "last_active_ago": 5000, "presence": "online", "status_msg": "Making cupcakes", "user_id": "@john:matrix.org" } ] }, "edu_type": "m.presence" } ``` -------------------------------- ### Matrix Federation API: Invite Request Body Example Source: https://spec.matrix.org/unstable/server-server-api Example JSON payload for inviting a user to a Matrix room via the federation API. ```json { "content": { "membership": "invite" }, "origin": "matrix.org", "origin_server_ts": 1234567890, "sender": "@someone:example.org", "state_key": "@joe:elsewhere.com", "type": "m.room.member", "unsigned": { "invite_room_state": [ { "content": { "name": "Example Room" }, "sender": "@bob:example.org", "state_key": "", "type": "m.room.name" }, { "content": { "join_rule": "invite" }, "sender": "@bob:example.org", "state_key": "", "type": "m.room.join_rules" } ] } } ``` -------------------------------- ### Matrix Federation API: 404 Not Found Response Example Source: https://spec.matrix.org/v1.15/server-server-api Example of a 404 Not Found response, indicating the specified room is unknown to the receiving server. ```json { "errcode": "M_NOT_FOUND", "error": "Unknown room" } ``` -------------------------------- ### 200 Response Example Source: https://spec.matrix.org/unstable/server-server-api An example JSON payload for a successful 200 OK response from the send_join API call, including auth_chain and state. ```json [ 200, { "auth_chain": [ { "content": { "see_room_version_spec": "The event format changes depending on the room version." }, "room_id": "!somewhere:example.org", "type": "m.room.minimal_pdu" } ], "event": { "auth_events": [ "$urlsafe_base64_encoded_eventid", "$a-different-event-id" ], "content": { "join_authorised_via_users_server": "@arbitrary:resident.example.com", "membership": "join" }, "depth": 12, "hashes": { "sha256": "thishashcoversallfieldsincasethisisredacted" }, "origin_server_ts": 1404838188000, "prev_events": [ "$urlsafe_base64_encoded_eventid", "$a-different-event-id" ], "room_id": "!UcYsUzyxTGDxLBEvLy:example.org", "sender": "@alice:example.com", "signatures": { "example.com": { "ed25519:key_version": "these86bytesofbase64signaturecoveressentialfieldsincludinghashessocancheckredactedpdus" }, "resident.example.com": { "ed25519:other_key_version": "a different signature" } }, "state_key": "@alice:example.com", "type": "m.room.member", "unsigned": { "age": 4612 } }, "state": [ { "content": { "see_room_version_spec": "The event format changes depending on the room version." }, "room_id": "!somewhere:example.org", "type": "m.room.minimal_pdu" } ] } ] ``` -------------------------------- ### Request Body Example Source: https://spec.matrix.org/unstable/server-server-api An example JSON payload for the request body of the send_join API call. ```json { "content": { "membership": "join" }, "origin": "matrix.org", "origin_server_ts": 1234567890, "sender": "@someone:example.org", "state_key": "@someone:example.org", "type": "m.room.member" } ``` -------------------------------- ### Matrix Receipt Data Structure Example Source: https://spec.matrix.org/unstable/server-server-api Example JSON object demonstrating the structure of a Matrix receipt EDU, indicating read progress within a specific room for a user. ```json { "content": { "!some_room:example.org": { "m.read": { "@john:matrix.org": { "data": { "ts": 1533358089009 }, "event_ids": [ "$read_this_event:matrix.org" ] } } } }, "edu_type": "m.receipt" } ``` -------------------------------- ### Matrix Federation API: 400 Bad Request Response Example Source: https://spec.matrix.org/v1.15/server-server-api Example of a 400 Bad Request response, typically indicating an incompatible room version. ```json { "errcode": "M_INCOMPATIBLE_ROOM_VERSION", "error": "Your homeserver does not support the features required to knock on this room", "room_version": "7" } ``` -------------------------------- ### Matrix Federation Send Join Request Body Example Source: https://spec.matrix.org/v1.15/server-server-api An example of the JSON payload for a Matrix Federation send join request. ```json { "content": { "membership": "join" }, "origin": "matrix.org", "origin_server_ts": 1234567890, "sender": "@someone:example.org", "state_key": "@someone:example.org", "type": "m.room.member" } ``` -------------------------------- ### Matrix Spec: Fix PDU examples OpenAPI reference Source: https://spec.matrix.org/v1.15/changelog/v1.7/checklist This update corrects PDU (Protocol Data Unit) examples by removing an invalid OpenAPI reference to `examples/minimal_pdu.json`. It ensures the specification's examples are correctly linked and valid. ```APIDOC Matrix Specification: PDU Example OpenAPI Reference Fix - Change: Remove invalid OpenAPI reference to `examples/minimal_pdu.json` from PDU examples. - Purpose: To fix PDU examples by ensuring correct and valid OpenAPI references. - Related Issue: #1454 ``` -------------------------------- ### 200 OK Response Example for Send Join Source: https://spec.matrix.org/unstable/server-server-api Example JSON payload for a successful room join request via the Matrix Federation API. It includes the event structure and the room version. ```JSON { "event": { "content": { "join_authorised_via_users_server": "@anyone:resident.example.org", "membership": "join" }, "origin": "example.org", "origin_server_ts": 1549041175876, "room_id": "!somewhere:example.org", "sender": "@someone:example.org", "state_key": "@someone:example.org", "type": "m.room.member" }, "room_version": "2" } ``` -------------------------------- ### 404 Not Found Response Example for Send Join Source: https://spec.matrix.org/unstable/server-server-api Example JSON payload for a 404 Not Found response, indicating an unknown room, for the Matrix Federation Send Join API. ```JSON { "errcode": "M_NOT_FOUND", "error": "Unknown room" } ``` -------------------------------- ### 404 Not Found Response Example (Error Object) Source: https://spec.matrix.org/unstable/application-service-api Example JSON payload for a not found response (404) indicating that no users were found with the given parameters. Includes an error code. ```JSON { "errcode": "COM.EXAMPLE.MYAPPSERVICE_NOT_FOUND" } ``` -------------------------------- ### Client Rendering Example for Room Join Rules Source: https://spec.matrix.org/v1.15/rooms/v10 Illustrates how a Matrix client might display the join rules for a room, specifically showing options for public/private status, allowing members of a space to join, and allowing knocking. This example is based on features introduced in room versions 7 and 8. ```text This room is: [ ] Public [x] Private Join rules (disabled when Public): [x] Allow members of `#space:example.org` to join [x] Allow knocking ``` -------------------------------- ### Matrix Federation Send Join 200 Response Example Source: https://spec.matrix.org/v1.15/server-server-api An example of a successful 200 response from the Matrix Federation send join endpoint, including the event structure. ```json [ 200, { "auth_chain": [ { "content": { "see_room_version_spec": "The event format changes depending on the room version." }, "room_id": "!somewhere:example.org", "type": "m.room.minimal_pdu" } ], "event": { "auth_events": [ "$urlsafe_base64_encoded_eventid", "$a-different-event-id" ], "content": { "join_authorised_via_users_server": "@arbitrary:resident.example.com", "membership": "join" }, "depth": 12, "hashes": { "sha256": "thishashcoversallfieldsincasethisisredacted" }, "origin_server_ts": 1404838188000, "prev_events": [ "$urlsafe_base64_encoded_eventid", "$a-different-event-id" ], "room_id": "!UcYsUzyxTGDxLBEvLy:example.org", "sender": "@alice:example.com", "signatures": { "example.com": { "ed25519:key_version": "these86bytesofbase64signaturecoveressentialfieldsincludinghashessocancheckredactedpdus" }, "resident.example.com": { "ed25519:other_key_version": "a different signature" } }, "state_key": "@alice:example.com", "type": "m.room.member", "unsigned": { "age": 4612 } }, "state": [ { "content": { "see_room_version_spec": "The event format changes depending on the room version." }, "room_id": "!somewhere:example.org", "type": "m.room.minimal_pdu" } ] } ] ``` -------------------------------- ### Matrix Federation API: 200 OK Response Example Source: https://spec.matrix.org/v1.15/server-server-api Example of a successful 200 OK response when sending a knock event. It includes the event template and room version details. ```json { "event": { "content": { "membership": "knock" }, "origin": "example.org", "origin_server_ts": 1549041175876, "room_id": "!somewhere:example.org", "sender": "@someone:example.org", "state_key": "@someone:example.org", "type": "m.room.member" }, "room_version": "7" } ``` -------------------------------- ### Signed JSON Structure Example Source: https://spec.matrix.org/unstable/appendices Provides an example of a JSON object structured for signing, detailing the `signing_keys`, `unsigned` data, and `signatures` fields. ```json { "name": "example.org", "signing_keys": { "ed25519:1": "XSl0kuyvrXNj6A+7/tkrB9sxSbRi08Of5uRhxOqZtEQ" }, "unsigned": { "age_ts": 922834800000 }, "signatures": { "example.org": { "ed25519:1": "s76RUgajp8w172am0zQb/iPTHsRnb4SkrzGoeCOSFfcBY2V/1c8QfrmdXHpvnc2jK5BD1WiJIxiMW95fMjK7Bw" } } } ``` -------------------------------- ### Example Event Payload Source: https://spec.matrix.org/v1.15/rooms/v2 A JSON example demonstrating the structure of a Persistent Data Unit (PDU) as defined for room versions 1 and 2. ```json { "auth_events": [ [ "$af232176:example.org", { "sha256": "abase64encodedsha256hashshouldbe43byteslong" } ] ], "content": { "key": "value" }, "depth": 12, "event_id": "$a4ecee13e2accdadf56c1025:example.com", "hashes": { "sha256": "thishashcoversallfieldsincasethisisredacted" }, "origin_server_ts": 1404838188000, "prev_events": [ [ "$af232176:example.org", { "sha256": "abase64encodedsha256hashshouldbe43byteslong" } ] ], "room_id": "!UcYsUzyxTGDxLBEvLy:example.org", "sender": "@alice:example.com", "signatures": { "example.com": { "ed25519:key_version": "these86bytesofbase64signaturecoveressentialfieldsincludinghashessocancheckredactedpdus" } }, "type": "m.room.message", "unsigned": { "age": 4612 } } ``` -------------------------------- ### Matrix Federation API: 200 Response Example (Backfill/Missing Events) Source: https://spec.matrix.org/v1.15/server-server-api Example JSON structure for a successful response containing a transaction with PDUs, typically used for backfilling or retrieving missing events. ```json { "origin": "matrix.org", "origin_server_ts": 1234567890, "pdus": [ { "content": { "see_room_version_spec": "The event format changes depending on the room version." }, "room_id": "!somewhere:example.org", "type": "m.room.minimal_pdu" } ] } ``` -------------------------------- ### Example Server Keys JSON Response Source: https://spec.matrix.org/unstable/server-server-api An example JSON object representing the response structure for queried server keys, including old and current verification keys, server name, signatures, and validity timestamps. ```json { "server_keys": [ { "old_verify_keys": { "ed25519:0ldk3y": { "expired_ts": 1532645052628, "key": "VGhpcyBzaG91bGQgYmUgeW91ciBvbGQga2V5J3MgZWQyNTUxOSBwYXlsb2FkLg" } }, "server_name": "example.org", "signatures": { "example.org": { "ed25519:abc123": "VGhpcyBzaG91bGQgYWN0dWFsbHkgYmUgYSBzaWduYXR1cmU" }, "notary.server.com": { "ed25519:010203": "VGhpcyBpcyBhbm90aGVyIHNpZ25hdHVyZQ" } }, "valid_until_ts": 1652262000000, "verify_keys": { "ed25519:abc123": { "key": "VGhpcyBzaG91bGQgYmUgYSByZWFsIGVkMjU1MTkgcGF5bG9hZA" } } } ] } ``` -------------------------------- ### Example Persistent Data Unit (PDU) Source: https://spec.matrix.org/v1.15/rooms/v11 A concrete JSON example illustrating the structure of a Persistent Data Unit (PDU) as defined for Matrix room version 11. ```json { "auth_events": [ "$urlsafe_base64_encoded_eventid", "$a-different-event-id" ], "content": { "key": "value" }, "depth": 12, "hashes": { "sha256": "thishashcoversallfieldsincasethisisredacted" }, "origin_server_ts": 1404838188000, "prev_events": [ "$urlsafe_base64_encoded_eventid", "$a-different-event-id" ], "room_id": "!UcYsUzyxTGDxLBEvLy:example.org", "sender": "@alice:example.com", "signatures": { "example.com": { "ed25519:key_version": "these86bytesofbase64signaturecoveressentialfieldsincludinghashessocancheckredactedpdus" } }, "type": "m.room.message", "unsigned": { "age": 4612 } } ``` -------------------------------- ### Matrix Federation Public Rooms Response Example Source: https://spec.matrix.org/unstable/server-server-api Example JSON response structure for a paginated chunk of public rooms in the Matrix federation API. It includes room details, pagination tokens, and an estimated total count. ```json { "chunk": [ { "avatar_url": "mxc://bleecker.street/CHEDDARandBRIE", "guest_can_join": false, "join_rule": "public", "name": "CHEESE", "num_joined_members": 37, "room_id": "!ol19s:bleecker.street", "room_type": "m.space", "topic": "Tasty tasty cheese", "world_readable": true } ], "next_batch": "p190q", "prev_batch": "p1902", "total_room_count_estimate": 115 } ``` -------------------------------- ### Persistent Data Unit Example Source: https://spec.matrix.org/v1.15/rooms/v5 A JSON example of a persistent data unit event, illustrating the structure and data types for fields like auth_events, content, hashes, and signatures. ```json { "auth_events": [ "$urlsafe_base64_encoded_eventid", "$a-different-event-id" ], "content": { "key": "value" }, "depth": 12, "hashes": { "sha256": "thishashcoversallfieldsincasethisisredacted" }, "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" } }, "type": "m.room.message", "unsigned": { "age": 4612 } } ``` -------------------------------- ### Persistent Data Unit JSON Example Source: https://spec.matrix.org/v1.15/rooms/v10 A concrete JSON example illustrating the structure of a Persistent Data Unit (PDU), including all fields and their typical data formats. ```json { "auth_events": [ "$urlsafe_base64_encoded_eventid", "$a-different-event-id" ], "content": { "key": "value" }, "depth": 12, "hashes": { "sha256": "thishashcoversallfieldsincasethisisredacted" }, "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" } }, "type": "m.room.message", "unsigned": { "age": 4612 } } ``` -------------------------------- ### Example Persistent Data Unit (PDU) Source: https://spec.matrix.org/unstable/rooms/v2 Provides a concrete JSON example of a Persistent Data Unit (PDU), illustrating the structure and typical values for its fields. ```json { "auth_events": [ [ "$af232176:example.org", { "sha256": "abase64encodedsha256hashshouldbe43byteslong" } ] ], "content": { "key": "value" }, "depth": 12, "event_id": "$a4ecee13e2accdadf56c1025:example.com", "hashes": { "sha256": "thishashcoversallfieldsincasethisisredacted" }, "origin_server_ts": 1404838188000, "prev_events": [ [ "$af232176:example.org", { "sha256": "abase64encodedsha256hashshouldbe43byteslong" } ] ], "room_id": "!UcYsUzyxTGDxLBEvLy:example.org", "sender": "@alice:example.com", "signatures": { "example.com": { "ed25519:key_version": "these86bytesofbase64signaturecoveressentialfieldsincludinghashessocancheckredactedpdus" } }, "type": "m.room.message", "unsigned": { "age": 4612 } } ``` -------------------------------- ### Persistent Data Unit Example Source: https://spec.matrix.org/v1.15/rooms/v4 A JSON example of a persistent data unit event, illustrating the structure and data types for fields like auth_events, content, hashes, and signatures. ```json { "auth_events": [ "$urlsafe_base64_encoded_eventid", "$a-different-event-id" ], "content": { "key": "value" }, "depth": 12, "hashes": { "sha256": "thishashcoversallfieldsincasethisisredacted" }, "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" } }, "type": "m.room.message", "unsigned": { "age": 4612 } } ``` -------------------------------- ### Matrix API: Server Keys JSON Example Source: https://spec.matrix.org/unstable/server-server-api A concrete JSON example illustrating the structure of the server keys response from the Matrix API. This includes sample data for old and current verification keys, server name, and signatures. ```json { "server_keys": [ { "old_verify_keys": { "ed25519:0ldk3y": { "expired_ts": 1532645052628, "key": "VGhpcyBzaG91bGQgYmUgeW91ciBvbGQga2V5J3MgZWQyNTUxOSBwYXlsb2FkLg" } }, "server_name": "example.org", "signatures": { "example.org": { "ed25519:abc123": "VGhpcyBzaG91bGQgYWN0dWFsbHkgYmUgYSBzaWduYXR1cmU" }, "notary.server.com": { "ed25519:010203": "VGhpcyBpcyBhbm90aGVyIHNpZ25hdHVyZQ" } }, "valid_until_ts": 1652262000000, "verify_keys": { "ed25519:abc123": { "key": "VGhpcyBzaG91bGQgYmUgYSByZWFsIGVkMjU1MTkgcGF5bG9hZA" } } } ] } ``` -------------------------------- ### Example Application Service Registration Source: https://spec.matrix.org/unstable/application-service-api A sample YAML configuration file demonstrating how to register an IRC bridging application service. It includes required tokens, a unique ID, sender localpart, and namespace definitions for users and aliases. ```yaml id: "IRC Bridge" url: "http://127.0.0.1:1234" as_token: "30c05ae90a248a4188e620216fa72e349803310ec83e2a77b34fe90be6081f46" hs_token: "312df522183efd404ec1cd22d2ffa4bbc76a8c1ccf541dd692eef281356bb74e" sender_localpart: "_irc_bot" # Will result in @_irc_bot:example.org namespaces: users: - exclusive: true regex: "@_irc_bridge_.*" aliases: - exclusive: false regex: "#_irc_bridge_.*" rooms: [] ``` -------------------------------- ### Matrix Federation API: Invite Request Body Example Source: https://spec.matrix.org/unstable/server-server-api Provides a concrete JSON example of the request body used for inviting a user to a Matrix room via the federation API. This includes a sample invite event, optional stripped state events for room identification, and the room version. ```json { "event": { "content": { "membership": "invite" }, "origin": "matrix.org", "origin_server_ts": 1234567890, "sender": "@someone:example.org", "state_key": "@joe:elsewhere.com", "type": "m.room.member" }, "invite_room_state": [ { "content": { "name": "Example Room" }, "sender": "@bob:example.org", "state_key": "", "type": "m.room.name" }, { "content": { "join_rule": "invite" }, "sender": "@bob:example.org", "state_key": "", "type": "m.room.join_rules" } ], "room_version": "2" } ``` -------------------------------- ### Matrix Spec: Fix PDU examples OpenAPI reference Source: https://spec.matrix.org/unstable/changelog/v1.7/checklist This update corrects PDU (Protocol Data Unit) examples by removing an invalid OpenAPI reference to `examples/minimal_pdu.json`. It ensures the specification's examples are correctly linked and valid. ```APIDOC Matrix Specification: PDU Example OpenAPI Reference Fix - Change: Remove invalid OpenAPI reference to `examples/minimal_pdu.json` from PDU examples. - Purpose: To fix PDU examples by ensuring correct and valid OpenAPI references. - Related Issue: #1454 ``` -------------------------------- ### Matrix Federation API: User Keys Query Response Example Source: https://spec.matrix.org/unstable/server-server-api A sample JSON payload demonstrating the structure of a successful (200 OK) response from the Matrix Federation API's user keys query endpoint, showing device keys for a user. ```json { "device_keys": { "@alice:example.com": { "JLAFKJWSCS": { "algorithms": [ "m.olm.v1.curve25519-aes-sha2", "m.megolm.v1.aes-sha2" ], "device_id": "JLAFKJWSCS", "keys": { "curve25519:JLAFKJWSCS": "3C5BFWi2Y8MaVvjM8M22DBmh24PmgR0nPvJOIArzgyI", "ed25519:JLAFKJWSCS": "lEuiRJBit0IG6nUf5pUzWTUEsRVVe/HJkoKuEww9ULI" }, "signatures": { "@alice:example.com": { "ed25519:JLAFKJWSCS": "dSO80A01XiigH3uBiDVx/EjzaoycHcjq9lfQX0uWsqxl2giMIiSPR8a4d291W1ihKJL/a+myXS367WT6NAIcBA" } }, "unsigned": { "device_display_name": "Alice's mobile phone" }, "user_id": "@alice:example.com" } } } } ``` -------------------------------- ### Persistent Data Unit (PDU) Example Source: https://spec.matrix.org/v1.15/rooms/v3 A complete JSON example of a Persistent Data Unit (PDU) event, demonstrating the structure and typical values for fields like auth_events, content, hashes, origin_server_ts, prev_events, room_id, sender, signatures, type, and unsigned data. ```json { "auth_events": [ "$base64encodedeventid", "$adifferenteventid" ], "content": { "key": "value" }, "depth": 12, "hashes": { "sha256": "thishashcoversallfieldsincasethisisredacted" }, "origin_server_ts": 1404838188000, "prev_events": [ "$base64encodedeventid", "$adifferenteventid" ], "redacts": "$some/old+event", "room_id": "!UcYsUzyxTGDxLBEvLy:example.org", "sender": "@alice:example.com", "signatures": { "example.com": { "ed25519:key_version": "these86bytesofbase64signaturecoveressentialfieldsincludinghashessocancheckredactedpdus" } }, "type": "m.room.message", "unsigned": { "age": 4612 } } ``` -------------------------------- ### APIDOC: Server-Server API - Fix edu_type in EDU examples Source: https://spec.matrix.org/v1.15/changelog/v1.6/checklist Fixes the `edu_type` field in EDU (End-to-End Encrypted Data) examples within the Server-Server API. This ensures accuracy in examples for encrypted data transmission. ```APIDOC Server-Server API: - Spec Clarifications: - Fix `edu_type` in EDU examples. ([#1383](https://github.com/matrix-org/matrix-spec/issues/1383)) ``` -------------------------------- ### APIDOC: Server-Server API - Fix edu_type in EDU examples Source: https://spec.matrix.org/unstable/changelog/v1.6/checklist Fixes the `edu_type` field in EDU (End-to-End Encrypted Data) examples within the Server-Server API. This ensures accuracy in examples for encrypted data transmission. ```APIDOC Server-Server API: - Spec Clarifications: - Fix `edu_type` in EDU examples. ([#1383](https://github.com/matrix-org/matrix-spec/issues/1383)) ``` -------------------------------- ### New Client-Server API Endpoints Source: https://spec.matrix.org/v1.15/changelog/v1.7/checklist Details new API endpoints introduced for media handling and authentication. ```APIDOC POST /_matrix/media/v1/create Description: Creates a new media upload endpoint. Related MSC: MSC1499 PUT /_matrix/media/v3/upload/{serverName}/{mediaId} Description: Uploads media to a specific server and media ID. Related MSC: MSC1499 POST /_matrix/client/v1/login/get_token Description: Retrieves an authentication token. Related MSC: MSC1530 ``` -------------------------------- ### New Client-Server API Endpoints Source: https://spec.matrix.org/unstable/changelog/v1.7/checklist Details new API endpoints introduced for media handling and authentication. ```APIDOC POST /_matrix/media/v1/create Description: Creates a new media upload endpoint. Related MSC: MSC1499 PUT /_matrix/media/v3/upload/{serverName}/{mediaId} Description: Uploads media to a specific server and media ID. Related MSC: MSC1499 POST /_matrix/client/v1/login/get_token Description: Retrieves an authentication token. Related MSC: MSC1530 ``` -------------------------------- ### Transaction 200 Response Example Source: https://spec.matrix.org/unstable/server-server-api Example JSON payload for a successful transaction response in Matrix federation, including origin, timestamp, and PDUs. ```json { "origin": "matrix.org", "origin_server_ts": 1234567890, "pdus": [ { "content": { "see_room_version_spec": "The event format changes depending on the room version." }, "room_id": "!somewhere:example.org", "type": "m.room.minimal_pdu" } ] } ``` -------------------------------- ### Example Application Service Registration Source: https://spec.matrix.org/v1.15/application-service-api Provides a sample YAML configuration for registering an application service with a homeserver. It details essential fields like service ID, URL, authentication tokens, and namespace interests for event routing. ```YAML id: "IRC Bridge" url: "http://127.0.0.1:1234" as_token: "30c05ae90a248a4188e620216fa72e349803310ec83e2a77b34fe90be6081f46" hs_token: "312df522183efd404ec1cd22d2ffa4bbc76a8c1ccf541dd692eef281356bb74e" sender_localpart: "_irc_bot" # Will result in @_irc_bot:example.org namespaces: users: - exclusive: true regex: "@_irc_bridge_.*" aliases: - exclusive: false regex: "#_irc_bridge_.*" rooms: [] ``` -------------------------------- ### Matrix Federation API: 403 Forbidden Response Example Source: https://spec.matrix.org/v1.15/server-server-api Example of a 403 Forbidden response, indicating the user or server is not permitted to knock on the room. ```json { "errcode": "M_FORBIDDEN", "error": "You are not permitted to knock on this room" } ``` -------------------------------- ### Matrix Server-Server API: PDU Diagram Update Source: https://spec.matrix.org/v1.15/changelog/v1.1/checklist Updates the example PDU (Protocol Data Unit) diagram in the Server-Server API documentation to better illustrate scenarios involving multiple `prev_events`. ```APIDOC PDU Diagram: - Description: Revised diagram to visually represent event chains and dependencies, particularly highlighting how multiple previous events (`prev_events`) are handled in event graphs. ``` -------------------------------- ### Example 200 Response JSON for User Keys Query Source: https://spec.matrix.org/v1.15/server-server-api A sample JSON payload representing a successful response from the Matrix Federation user keys query endpoint, illustrating the structure of device keys and associated metadata. ```json { "device_keys": { "@alice:example.com": { "JLAFKJWSCS": { "algorithms": [ "m.olm.v1.curve25519-aes-sha2", "m.megolm.v1.aes-sha2" ], "device_id": "JLAFKJWSCS", "keys": { "curve25519:JLAFKJWSCS": "3C5BFWi2Y8MaVvjM8M22DBmh24PmgR0nPvJOIArzgyI", "ed25519:JLAFKJWSCS": "lEuiRJBit0IG6nUf5pUzWTUEsRVVe/HJkoKuEww9ULI" }, "signatures": { "@alice:example.com": { "ed25519:JLAFKJWSCS": "dSO80A01XiigH3uBiDVx/EjzaoycHcjq9lfQX0uWsqxl2giMIiSPR8a4d291W1ihKJL/a+myXS367WT6NAIcBA" } }, "unsigned": { "device_display_name": "Alice's mobile phone" }, "user_id": "@alice:example.com" } } } } ``` -------------------------------- ### Matrix Federation Invite Room Request Body Example Source: https://spec.matrix.org/v1.15/server-server-api A sample JSON payload demonstrating how to structure a request to invite a user to a Matrix room using the federation API. It includes a complete invite event and illustrative stripped state events. ```json { "event": { "content": { "membership": "invite" }, "origin": "matrix.org", "origin_server_ts": 1234567890, "sender": "@someone:example.org", "state_key": "@joe:elsewhere.com", "type": "m.room.member" }, "invite_room_state": [ { "content": { "name": "Example Room" }, "sender": "@bob:example.org", "state_key": "", "type": "m.room.name" }, { "content": { "join_rule": "invite" }, "sender": "@bob:example.org", "state_key": "", "type": "m.room.join_rules" } ], "room_version": "2" } ``` -------------------------------- ### Matrix Read Receipt Example Source: https://spec.matrix.org/v1.15/server-server-api An example JSON payload representing a read receipt for a user in a specific room, indicating the timestamp and the last read event. ```json { "content": { "!some_room:example.org": { "m.read": { "@john:matrix.org": { "data": { "ts": 1533358089009 }, "event_ids": [ "$read_this_event:matrix.org" ] } } } }, "edu_type": "m.receipt" } ``` -------------------------------- ### Matrix Server-Server API: PDU Diagram Update Source: https://spec.matrix.org/unstable/changelog/v1.1/checklist Updates the example PDU (Protocol Data Unit) diagram in the Server-Server API documentation to better illustrate scenarios involving multiple `prev_events`. ```APIDOC PDU Diagram: - Description: Revised diagram to visually represent event chains and dependencies, particularly highlighting how multiple previous events (`prev_events`) are handled in event graphs. ``` -------------------------------- ### Request Body Example for Third-Party Invite Exchange Source: https://spec.matrix.org/unstable/server-server-api An example JSON payload representing the request body for exchanging a third-party invite via the Matrix Federation API. ```json { "content": { "membership": "invite", "third_party_invite": { "display_name": "alice", "signed": { "mxid": "@alice:localhost", "signatures": { "magic.forest": { "ed25519:3": "fQpGIW1Snz+pwLZu6sTy2aHy/DYWWTspTJRPyNp0PKkymfIsNffysMl6ObMMFdIJhk6g6pwlIqZ54rxo8SLmAg" } }, "token": "abc123" } } }, "room_id": "!abc123:matrix.org", "sender": "@joe:matrix.org", "state_key": "@someone:example.org", "type": "m.room.member" } ``` -------------------------------- ### APIDOC: Server-Server API - Inline invite endpoint examples Source: https://spec.matrix.org/v1.15/changelog/v1.6/checklist Includes examples inline instead of using a reference for invite endpoint definitions in the Server-Server API. This improves the readability and accessibility of invite-related documentation. ```APIDOC Server-Server API: - Spec Clarifications: - Include examples inline instead of using a reference for invite endpoint definitions. ([#1349](https://github.com/matrix-org/matrix-spec/issues/1349)) ```