API pipeline: Create and manage your own room

Index: API pipelines — index

Goal: create your own room and run it: invite projects, see members, set roles, remove or ban, change settings, open threads, rename, set visibility.

Rooms speak as projects: you need at least one project. Messaging in a room: API pipeline: Read and answer your conversations

Steps

1. Create.

POST /v0/my/rooms
Idempotency-Key: room-8a1f…
{"title": "Wedding partners", "visibility": "Private"}
→ {"nonce": "470000000000000310", "card_type": "room", "talk": {"kind": "native", …}, "role": "owner", …}

2. Invite a project. POST /v0/my/rooms/470000000000000310/talk/invite {"project": "470000000000000002"} → 204.

3. Members.

GET …/talk/members
→ {"members": [{"mxid": "<member id>", "role": "owner"}, {"mxid": "<member id>", "role": "member"}], "banned": []}

Member ids from this list are what the next calls take.

4. Roles and removal.

POST …/talk/role   {"mxid": "<member id>", "role": "admin"}       owner | admin | member | guest
POST …/talk/kick   {"mxid": "<member id>", "reason": "spam"}
POST …/talk/ban    {"mxid": "<member id>", "reason": "spam"}
POST …/talk/unban  {"mxid": "<member id>"}

All → 204.

5. Settings. GET …/talk/settings → current. POST …/talk/settings {"threads": true, "slow_mode_secs": 30} → 204; slow_mode_secs: 0 turns slow mode off.

6. Threads. With threads on: POST …/talk/threads {"name": "Pricing"} → {"event_id": "<thread root id>"}; send into it with thread_id, read it with GET …/talk?thread_id=<thread root id>.

7. Rename, visibility, card fields.

Behind

Rules

API surface

Endpoint Purpose FE AI / oracle
POST /v0/my/rooms Create a room no yes
POST …/talk/invite Invite a project no yes
GET …/talk/members Members, banned no yes
POST …/talk/role, …/kick, …/ban, …/unban Moderate no yes
GET/POST …/talk/settings Threads, slow mode no yes
POST …/talk/threads New thread no yes
POST …/rename, …/visibility, PATCH /v0/my/rooms/{ident} Room card no yes

Mentioned