2023-06-07 14:16:29 +02:00
openapi : 3.1 .0
2016-07-12 15:58:33 +02:00
info :
2023-06-07 14:16:29 +02:00
title : Matrix Client-Server Rooms API
version : 1.0 .0
2016-07-12 15:58:33 +02:00
paths :
"/rooms/{roomId}/initialSync" :
get :
summary : Snapshot the current state of a room and its most recent messages.
description : |-
2024-12-17 20:31:33 +01:00
{{% boxes/note %}}
This api should now exclusively be used for "peeking" into publicly viewable rooms you're not a member of ([Room Previews](/client-server-api/#room-previews))
{{% /boxes/note %}}
2016-07-12 15:58:33 +02:00
Get a copy of the current state and the most recent messages in a room.
2016-07-13 12:09:53 +02:00
2024-12-17 20:31:33 +01:00
Using this endpoint for something other than peeking was deprecated in r0 of this specification. \
The relevant information for syncing is now returned by the
2021-10-12 19:07:01 +02:00
[ `/sync`](/client-server-api/#get_matrixclientv3sync) API. See the
2021-01-29 01:00:39 +01:00
[ migration guide](https://matrix.org/docs/guides/migrating-from-client-server-api-v-1#deprecated-endpoints).
2017-08-03 01:19:34 +02:00
operationId : roomInitialSync
2016-07-12 15:58:33 +02:00
security :
2024-04-09 18:12:30 +02:00
- accessTokenQuery : [ ]
- accessTokenBearer : [ ]
2016-07-12 15:58:33 +02:00
parameters :
- in : path
name : roomId
description : The room to get the data.
required : true
2023-06-07 14:16:29 +02:00
example : "!636q39766251:example.com"
schema :
type : string
2016-07-12 15:58:33 +02:00
responses :
2023-06-07 14:16:29 +02:00
"200" :
2016-07-12 15:58:33 +02:00
description : The current state of the room
2023-06-07 14:16:29 +02:00
content :
application/json :
schema :
title : RoomInfo
2016-07-12 15:58:33 +02:00
type : object
properties :
2023-06-07 14:16:29 +02:00
room_id :
2016-07-12 15:58:33 +02:00
type : string
2023-06-07 14:16:29 +02:00
description : The ID of this room.
membership :
type : string
description : The user's membership state in this room.
enum :
- invite
- join
- leave
- ban
messages :
type : object
title : PaginationChunk
description : The pagination chunk for this room.
properties :
start :
type : string
description : |-
A token which correlates to the start of `chunk`. Can be passed to
2024-11-14 12:11:34 +01:00
[ `/rooms/<room_id>/messages`](/client-server-api/#get_matrixclientv3roomsroomidmessages)
2023-06-07 14:16:29 +02:00
to retrieve earlier events.
2021-08-25 12:48:45 +02:00
2023-06-07 14:16:29 +02:00
If no earlier events are available, this property may be omitted from
the response.
end :
type : string
description : |-
A token which correlates to the end of `chunk`. Can be passed to
2024-11-14 12:11:34 +01:00
[ `/rooms/<room_id>/messages`](/client-server-api/#get_matrixclientv3roomsroomidmessages)
2023-06-07 14:16:29 +02:00
to retrieve later events.
chunk :
type : array
description : |-
If the user is a member of the room this will be a
list of the most recent messages for this room. If
the user has left the room this will be the
messages that preceded them leaving. This array
will consist of at most `limit` elements.
items :
$ref : definitions/client_event.yaml
required :
- end
- chunk
state :
type : array
description : |-
If the user is a member of the room this will be the
current state of the room as a list of events. If the
user has left the room this will be the state of the
room when they left it.
items :
$ref : definitions/client_event.yaml
visibility :
2016-07-12 15:58:33 +02:00
type : string
2023-06-07 14:16:29 +02:00
enum :
- private
- public
2016-07-12 15:58:33 +02:00
description : |-
2023-06-07 14:16:29 +02:00
Whether this room is visible to the `/publicRooms` API
or not."
account_data :
2016-07-12 15:58:33 +02:00
type : array
2023-06-07 14:16:29 +02:00
description : The private data that this user has attached to this room.
2016-07-12 15:58:33 +02:00
items :
2023-06-07 14:16:29 +02:00
title : Event
type : object
allOf :
- $ref : ../../event-schemas/schema/core-event-schema/event.yaml
required :
- room_id
examples :
response :
value : {
"membership": "join" ,
"messages": {
"chunk": [
{
"room_id": "!636q39766251:example.com" ,
"$ref": "../../event-schemas/examples/m.room.message$m.text.yaml"
},
{
"room_id": "!636q39766251:example.com" ,
"$ref": "../../event-schemas/examples/m.room.message$m.file.yaml"
}
] ,
"end": "s3456_9_0" ,
"start": "t44-3453_9_0"
},
"room_id": "!636q39766251:example.com" ,
"state": [
{
"room_id": "!636q39766251:example.com" ,
"$ref": "../../event-schemas/examples/m.room.join_rules.yaml"
},
{
"room_id": "!636q39766251:example.com" ,
"$ref": "../../event-schemas/examples/m.room.member.yaml"
},
{
"room_id": "!636q39766251:example.com" ,
"$ref": "../../event-schemas/examples/m.room.create.yaml"
},
{
"room_id": "!636q39766251:example.com" ,
"$ref": "../../event-schemas/examples/m.room.power_levels.yaml"
}
] ,
"visibility": "private" ,
"account_data": [
{
"type": "m.tag" ,
"content": {
"tags": {
"work": {
"order": "1"
}
}
}
}
]
}
"403" :
description : |
You aren't a member of the room and weren't previously a member of the room.
2016-07-12 15:58:33 +02:00
tags :
- Room participation
2024-12-17 20:31:33 +01:00
deprecated : false
2023-06-07 14:16:29 +02:00
servers :
- url : "{protocol}://{hostname}{basePath}"
variables :
protocol :
enum :
- http
- https
default : https
hostname :
default : localhost:8008
basePath :
default : /_matrix/client/v3
components :
securitySchemes :
2024-04-09 18:12:30 +02:00
accessTokenQuery :
$ref : definitions/security.yaml#/accessTokenQuery
accessTokenBearer :
$ref : definitions/security.yaml#/accessTokenBearer