Skip to content

Matrix

Matrix integration uses the Client-Server API with long-poll sync for real-time message delivery.

  1. Create a Matrix account for your bot on any homeserver (e.g., matrix.org, or your own Synapse/Dendrite)
  2. Get an access token — you can use the login API or extract it from Element’s settings
  3. Invite the bot to the rooms you want it to participate in
  4. In KinBot, add a Matrix channel with the access token and homeserver URL
  5. Optionally, restrict to specific room IDs with the allowlist
FieldRequiredDescription
Access TokenMatrix access token (stored encrypted)
Homeserver URLe.g., https://matrix.org
Allowed Room IDsRestrict to specific rooms
  • Inbound: KinBot uses Matrix’s /sync endpoint with long-polling to receive events in real time. It filters for m.room.message events, extracts text and media, and routes to the Kin.
  • Outbound: Messages are sent via the PUT /rooms/{roomId}/send endpoint. Long messages (>4,096 chars) are split. Images use m.image message type, other files use m.file.
  • Text messages with HTML formatting
  • Image and file attachments (via Matrix content repository)
  • Room and DM support
  • Automatic message chunking
  • Typing indicator
  • Long-poll sync (no webhook needed, works behind NAT/firewalls)
  • No public URL required — Matrix uses client-side long-polling, so KinBot doesn’t need to be publicly reachable
  • Federated — works with any Matrix homeserver
  • Self-hostable — run your own homeserver for full control