Room Admin API
Manage rooms on your Palpo server.
List Rooms
List all rooms the server knows about with pagination and filtering.
Endpoint: GET /_synapse/admin/v1/rooms
Query Parameters:
Example Request:
curl -X GET "https://your-server/_synapse/admin/v1/rooms?limit=10&order_by=joined_members&dir=b" \
-H "Authorization: Bearer <access_token>"
Example Response:
{
"rooms": [
{
"room_id": "!roomid:example.com",
"name": "General Chat",
"canonical_alias": "#general:example.com",
"joined_members": 150,
"joined_local_members": 100,
"version": "10",
"creator": "@admin:example.com",
"encryption": "m.megolm.v1.aes-sha2",
"federatable": true,
"public": true,
"join_rules": "public",
"guest_access": "can_join",
"history_visibility": "shared",
"state_events": 500
}
],
"offset": 0,
"total_rooms": 50,
"next_batch": "10"
}
Get Room Details
Get detailed information about a specific room.
Endpoint: GET /_synapse/admin/v1/rooms/{room_id}
Path Parameters:
room_id - Room ID (e.g., !roomid:example.com)
Example Request:
curl -X GET "https://your-server/_synapse/admin/v1/rooms/!roomid:example.com" \
-H "Authorization: Bearer <access_token>"
Example Response:
{
"room_id": "!roomid:example.com",
"name": "General Chat",
"canonical_alias": "#general:example.com",
"joined_members": 150,
"joined_local_members": 100,
"version": "10",
"creator": "@admin:example.com",
"encryption": "m.megolm.v1.aes-sha2",
"federatable": true,
"public": true,
"join_rules": "public",
"guest_access": "can_join",
"history_visibility": "shared",
"state_events": 500,
"topic": "Welcome to the general chat room!"
}
Get Room Hierarchy
Get the room hierarchy (for spaces).
Endpoint: GET /_synapse/admin/v1/rooms/{room_id}/hierarchy
Query Parameters:
Get Room Members
List all members in a room.
Endpoint: GET /_synapse/admin/v1/rooms/{room_id}/members
Example Response:
{
"members": [
"@alice:example.com",
"@bob:example.com",
"@charlie:other-server.org"
],
"total": 3
}
Get Room State
Get all state events in a room.
Endpoint: GET /_synapse/admin/v1/rooms/{room_id}/state
Example Response:
{
"state": [
{
"type": "m.room.name",
"state_key": "",
"content": {
"name": "General Chat"
},
"sender": "@admin:example.com",
"origin_server_ts": 1609459200000
},
{
"type": "m.room.topic",
"state_key": "",
"content": {
"topic": "Welcome!"
},
"sender": "@admin:example.com",
"origin_server_ts": 1609459300000
}
]
}
Get Room Messages
Get messages from a room with pagination.
Endpoint: GET /_synapse/admin/v1/rooms/{room_id}/messages
Query Parameters:
Example Response:
{
"chunk": [
{
"type": "m.room.message",
"content": {
"msgtype": "m.text",
"body": "Hello everyone!"
},
"sender": "@alice:example.com",
"origin_server_ts": 1609459200000,
"event_id": "$eventid1:example.com"
}
],
"start": "t1-2-3",
"end": "t4-5-6"
}
Block Room
Get or set the block status of a room. Blocking a room prevents local users from joining.
Get Block Status
Endpoint: GET /_synapse/admin/v1/rooms/{room_id}/block
Example Response:
{
"block": false,
"user_id": null
}
Set Block Status
Endpoint: PUT /_synapse/admin/v1/rooms/{room_id}/block
Request Body:
Example Request:
curl -X PUT "https://your-server/_synapse/admin/v1/rooms/!roomid:example.com/block" \
-H "Authorization: Bearer <access_token>" \
-H "Content-Type: application/json" \
-d '{"block": true}'
Example Response:
{
"block": true,
"user_id": "@admin:example.com"
}
Get Forward Extremities
Get the forward extremities of a room (useful for diagnosing federation issues).
Endpoint: GET /_synapse/admin/v1/rooms/{room_id}/forward_extremities
Example Response:
{
"count": 2,
"results": [
{
"event_id": "$event1:example.com",
"state_group": 12345,
"depth": 100,
"received_ts": 1609459200000
}
]
}
Delete Room
Delete a room, removing all local users.
Endpoint: DELETE /_synapse/admin/v2/rooms/{room_id}
Request Body:
Example Request:
curl -X DELETE "https://your-server/_synapse/admin/v2/rooms/!roomid:example.com" \
-H "Authorization: Bearer <access_token>" \
-H "Content-Type: application/json" \
-d '{"block": true, "purge": true}'
Example Response:
{
"kicked_users": [
"@alice:example.com",
"@bob:example.com"
],
"failed_to_kick_users": [],
"local_aliases": [
"#general:example.com"
],
"new_room_id": null
}
Room Fields Reference