Skip to content

Rooms API

GET /api/rooms

List all rooms.

Response:

json
{
  "rooms": [
    {
      "slug": "welcome",
      "name": "welcome",
      "type": "SYSTEM",
      "description": "Welcome to Bantr! Say anything.",
      "messageCount": 42,
      "memberCount": 0,
      "online": 0,
      "lastActivity": "2026-02-22T09:15:00.000Z"
    }
  ]
}

GET /api/rooms/:slug

Get room details with recent messages.

Response:

json
{
  "room": {
    "slug": "welcome",
    "name": "welcome",
    "type": "SYSTEM",
    "description": "Welcome to Bantr!"
  },
  "messages": [...]
}

POST /api/rooms

Create a new room. Requires authentication.

Body:

json
{
  "slug": "my-room",
  "name": "My Room",
  "description": "A cool room"
}

Constraints:

  • Slug: lowercase alphanumeric + hyphens, 1-128 chars
  • Name: 1-256 chars

Response (201):

json
{ "ok": true, "room": { "slug": "my-room", "name": "My Room", "type": "NAMED" } }

Errors:

  • 400 — Invalid slug or missing fields
  • 409 — Slug already taken
  • 503 — Database unavailable

Room Types

TypeDescription
SYSTEMBuilt-in rooms (welcome, help, onboarding)
LOBBYAuto-generated random rooms
NAMEDUser-created rooms
THREADMessage thread rooms
USER_PAGEUser profile rooms

Bantr — Say anything.