# Chatforma — how to use (mcp.ai)

Connect your Chatforma account and use 10 tools for AI chatbots straight from your AI agent. Connect with your own API key. Chatforma is a chatbot automation platform for managing bots, users, segments, broadcasts, dialogs, forms, notifications, and variables.

## Option A — via MCP (recommended)
Remote MCP endpoint (HTTP, streamable): `https://api.mcp.ai/p_chatforma?ms=1787293380000`
Add it as a custom/remote MCP connector in your client (Claude, Cursor, VS Code…), then authenticate when prompted. Once connected, ask the agent to use the server's tools (e.g. `chatforma_get_user_variable`).

## Option B — via direct REST API
Base URL: `https://api.mcp.ai/api/chatforma`
Auth: `Authorization: Bearer sk_live_…` — create a workspace API key at https://mcp.ai/settings/api-keys
Discover endpoints: `GET https://api.mcp.ai/api/chatforma/_endpoints`

### Endpoints
- `POST https://api.mcp.ai/api/chatforma/get/user/variable` — Get the current value of one bot variable for one bot user.
  - body: { bot_id: integer, bot_user_id: integer, variable_id: integer }
- `POST https://api.mcp.ai/api/chatforma/list/bots` — List bots belonging to the connected Chatforma account so their IDs can be used in bot-scoped tools.
- `POST https://api.mcp.ai/api/chatforma/list/dialog/messages` — Return one page of messages exchanged in a specific user's bot dialog, with a cursor for continuing the history.
  - body: { bot_id: integer, user_id: integer, per_page?: integer, next_cursor?: string }
- `POST https://api.mcp.ai/api/chatforma/list/predefined/messages` — List predefined messages configured in a bot so a message ID can be selected for sending.
  - body: { bot_id: integer }
- `POST https://api.mcp.ai/api/chatforma/list/segments` — List the user segments configured for a bot, including segment IDs needed for targeted sends.
  - body: { bot_id: integer }
- `POST https://api.mcp.ai/api/chatforma/list/users` — List a bot's users, members of one segment, or users with open dialogs; choose the view that matches the task.
  - body: { view?: string, bot_id: integer, deleted?: boolean, per_page?: integer, segment_id?: integer|string, next_cursor?: string }
- `POST https://api.mcp.ai/api/chatforma/list/variables` — List variables configured for a bot, including IDs and types needed to read user-specific values.
  - body: { bot_id: integer }
- `POST https://api.mcp.ai/api/chatforma/send/dialog/message` — Immediately send a user-visible text message into a specific user's bot dialog. This irreversible action may contact a real user.
  - body: { bot_id: integer, message: string, user_id: integer, idempotency_key: string }
- `POST https://api.mcp.ai/api/chatforma/send/predefined/message` — Send a configured bot message to one user or dispatch it to a segment. This irreversible action may contact one or many real users.
  - body: { bot_id: integer, run_at?: string, message_id: integer|string, segment_id?: integer|string, bot_user_id?: integer, recipient_type: string }
- `POST https://api.mcp.ai/api/chatforma/send/text/dispatch` — Create a user-visible text dispatch for one bot user or a segment. Delivery may be immediate or scheduled where supported and cannot be undone through this API.
  - body: { bot_id: integer, run_at?: string, content: string, segment_id?: integer|string, bot_user_id?: integer, recipient_type: string }

## Example prompts
- "What can I do in Chatforma?"
- "Show me a summary of my Chatforma account"

## More
- Page: https://mcp.ai/chatforma
- Agent spec (llms.txt): https://mcp.ai/chatforma/llms.txt
- Postman collection: https://mcp.ai/chatforma/postman.json
