Skip to main content

Commsuite Bot API

Bots are real Commsuite accounts (role = 'bot'). They appear in People, can be added to groups, and cannot sign in with a password. Each bot has an API token that lets your own program act as that account.

Create a bot in Settings → Developer tools, then open API on the bot card to copy its token. The same dialog contains a ready-to-run Python example.

Endpoints

All requests use Authorization: Bearer cmsb_….

Method Path Purpose
GET /api/bot/me Bot identity
GET /api/bot/updates?offset=0&timeout=30&limit=100 Long-poll incoming messages
POST /api/bot/sendMessage Send a message

sendMessage body:

{ "conversationId": "…", "text": "hello", "replyTo": "optional-message-id" }

updates response:

{
  "updates": [
    {
      "updateId": 42,
      "conversationId": "…",
      "message": { "id": "…", "senderId": "…", "body": "hi", "…": "…" }
    }
  ]
}

Pass the last updateId as offset on the next request; acknowledged updates are deleted. timeout keeps the request open while the bot is idle (maximum 50 seconds). A paused bot rejects its token with 401.

A bot can also call the regular user API (/api/conversations, /api/conversations/:id/messages, …) with the same token.

Python

pip install commsuite-bot
from commsuite_bot import CommsuiteBot

bot = CommsuiteBot("http://localhost:3000", "cmsb_…")

def handle(update):
    message = update["message"]
    bot.send_message(update["conversationId"], "echo: " + message["body"])

bot.run(handle)

The package is a single standard-library module, so it also works by copying commsuite_bot.py next to your script. See example_echo_bot.py for a complete echo bot. Only Python 3.8+ is required; there are no external dependencies.

Publishing a new version (maintainers): python -m build then twine upload dist/* from this folder, with TWINE_USERNAME=__token__ and TWINE_PASSWORD set to a PyPI API token.

Built-in replies and mini-apps

Bots without an external program can still use keyword replies and one mini-app (JSON formatter, Base64, or UUID generator). Both are managed from the bot card in Developer tools. send /help to a bot to discover its commands.

External programs receive updates for every message sent to the bot by a human account. Messages sent by other bots are not queued, which prevents runaway loops between automated accounts.

Metadata

Release files for commsuite-bot 1.0.40

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for commsuite-bot 1.0.40
File Size Uploaded Provenance Actions
commsuite_bot-1.0.40.tar.gz 3.8 kB Without provenance Details for commsuite_bot-1.0.40.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for commsuite-bot 1.0.40
File Interpreter ABI Platform Actions
commsuite_bot-1.0.40-py3-none-any.whl Python 3 none any Details for commsuite_bot-1.0.40-py3-none-any.whl

Total release size: 7.7 kB

Release files / commsuite_bot-1.0.40.tar.gz

Download URL commsuite_bot-1.0.40.tar.gz
Size 3.8 kB
Tags Source
SHA-256 checksum
How to use checksums
9623ba6132fcba25f3f3c6fd54a19643824e56a36ea0e94f20613b17c6e5619f
BLAKE2b-256 checksum
How to use checksums
66fe6447229a3a31545424fd7aadbf6ec5fce97299a04bc0c37f238aa35b2b75
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.14

Release files / commsuite_bot-1.0.40-py3-none-any.whl

Download URL commsuite_bot-1.0.40-py3-none-any.whl
Size 4.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
6ed9d99bb7a61dbb4d07fc7e8a484c97c2f49c711e91f4e799860be845172dd7
BLAKE2b-256 checksum
How to use checksums
923085a1cdf018c57760f7082aa68afadc15bd9c67618581d2e70134371aaf79
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.14

Security for commsuite-bot 1.0.40

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

1.0.40 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page