API Reference
Connect AI agents (MCP)
MCP (Model Context Protocol) is a standard way for an AI agent, such as Claude Code, to use another system's features as tools. RabtCRM runs an MCP server, so an agent can work with your account using an API key you control, or through a browser sign-in from claude.ai, Claude Desktop or ChatGPT. Once it's connected you can ask things like:
- "List my automations."
- "Draft a welcome flow and validate it."
- "Create a template for order updates."
- "Who messaged today?"
The agent only sees the tools its access allows (the key's scopes, or the access level you choose when you connect an app), and everything it does is limited to your team.
Set Up in Claude Code
Step 1: Create an API key
- Go to Settings → Developers and click Create New Key.
- Name the key after the agent (for example "Claude Code").
- Under Access, pick the scopes. For analysis and reporting, choose the Read-only preset: it gives the agent no write or send tools. Add
:writescopes only for the work you want it to do. - Click Create and copy the key immediately — it won't be shown again.
See Authentication for the full key steps and Scopes for what each scope allows.
Step 2: Connect
Store the key in an environment variable named RABT_API_KEY, then run:
claude mcp add --transport http rabtcrm https://rabtcrm.com/api/mcp \
--header "Authorization: Bearer $RABT_API_KEY"
Step 3: Check the connection
Run /mcp inside Claude Code. You should see rabtcrm connected and its tools listed. Then ask: "Which WhatsApp channels does my team have?"
Connect from claude.ai, Claude Desktop or ChatGPT
These apps sign in with your browser instead of an API key. You don't create or paste a key.
-
In the app, add a custom connector (an MCP connector) with this URL:
https://rabtcrm.com/api/mcp -
Follow the sign-in prompts. A RabtCRM page opens: sign in to RabtCRM if you aren't already.
-
Choose the team the app may use and the access level, Read-only or Full, then click Allow.
-
Back in the app, the RabtCRM tools are available. Ask: "Which WhatsApp channels does my team have?"
Exact menu names differ between app versions, so look for the app's option to add a custom connector or MCP server.
Access levels
- Read-only gives the same tools as the Read-only API key preset: the app can read data but has no write or send tools.
- Full adds every write and send tool, such as
messages_sendandautomations_update. Turn on your app's approval for write and send tools (see Safety). - An app RabtCRM can't verify is marked Unverified app on the sign-in page and can only get Read-only access. If an app asks only to read data, Full isn't offered.
Managing a connection
- You need to be the team owner or have the Settings permission to connect an app.
- To disconnect an app, open Settings → Developers → Connected apps and click Disconnect. It loses access immediately.
- An app's access token lasts 1 hour and the app renews it automatically. A connection ends after 90 days, and the app asks you to sign in again.
- A connection also stops working when the person who connected it is removed from the team or loses the Settings permission, changes their password, or when the team is suspended (while the team is suspended the connection is paused; calls are refused).
- A connected app's token works only at
/api/mcp. It never works on/api/v1/*, so it can't be used as an API key.
Other Clients
Any MCP client that sends a custom Authorization header with an API key and sends no Origin header works. These two configurations are untested:
Cursor (.cursor/mcp.json), untested:
{
"mcpServers": {
"rabtcrm": {
"url": "https://rabtcrm.com/api/mcp",
"headers": { "Authorization": "Bearer YOUR_API_KEY_HERE" }
}
}
}
VS Code (.vscode/mcp.json), untested:
{
"servers": {
"rabtcrm": {
"type": "http",
"url": "https://rabtcrm.com/api/mcp",
"headers": { "Authorization": "Bearer YOUR_API_KEY_HERE" }
}
}
}
MCP clients that run inside a web page can't connect, because requests with an Origin header from another site are refused.
Tools
The tool name is the API operation name with . replaced by _. Each tool takes the same arguments as the matching endpoint, which you can look up in the API reference. The agent sees a tool only if the key has its scope. me_get and addons_get are always listed.
The last column shows which tools are marked as write or send tools. Your client uses that mark to decide whether to ask you first (see Safety).
| Area | Tool | What it does | Scope | Marked for approval |
|---|---|---|---|---|
| Account | me_get | Shows the team and key making the call | none | No |
| Account | addons_get | Shows the team's add-ons and which automation kinds it can create | none | No |
| Channels | instances_list, instances_get | Lists WhatsApp instances and Messenger/Instagram channels, or shows one WhatsApp instance | instances:read | No |
| Contacts | contacts_list, contacts_get | Lists contacts or shows one | contacts:read | No |
| Contacts | tags_list, customFields_list | Lists contact tags and custom fields | contacts:read | No |
| Contacts | contacts_update | Updates a contact's fields, tags and custom values | contacts:write | Yes |
| Contacts | contacts_import | Creates or updates up to 200 contacts by phone | contacts:write | Yes |
| Conversations | chats_list | Lists conversations, most recent first | chats:read | No |
| Conversations | messages_list | Lists one conversation's messages | messages:read | No |
| Messaging | messages_send | Sends a WhatsApp, Messenger or Instagram message to a real person | messages:send | Yes |
| Automations | automations_list, automations_get, automations_catalog | Lists automations, shows one with its flow, or lists the node types you can use | automations:read | No |
| Automations | automations_validate | Checks a flow and reports problems without changing it | automations:read | No |
| Automations | automations_create, automations_update | Creates an automation (it starts off) or edits one | automations:write | Yes |
| Automations | automations_enable, automations_disable | Turns an automation on or off | automations:write | Yes |
| Automations | automations_importMedia | Copies a public file into storage for a media step | automations:write | Yes |
| AI agents | aiAgents_list, aiAgents_get | Lists the team's AI agents or shows one | ai_agents:read | No |
| AI agents | aiAgents_update | Updates an AI agent's basic settings | ai_agents:write | Yes |
| Templates | templates_list, templates_get | Lists WhatsApp templates or shows one in full | messages:send | No |
| Templates | templates_create, templates_update | Creates or edits a template and submits it to Meta for review | templates:write | Yes |
| Templates | templates_delete | Deletes a template at Meta and in RabtCRM | templates:write | Yes |
| Templates | templates_sync | Syncs an instance's templates from Meta | templates:write | Yes |
| Templates | templates_importHeaderMedia | Copies a public file into storage for a template's media header | templates:write | Yes |
Notes:
messages_sendsends media only as a link (mediaUrl); file upload isn't available through MCP.templates_listandtemplates_getneedmessages:send, so a Read-only key doesn't see them.- A key created with Full access before
templates:writeexisted doesn't have it. Add it with Edit access on Settings → Developers.
Safety
- Turn on your client's approval for write and send tools, and don't add them to an auto-approve list. RabtCRM marks them as destructive, but it doesn't ask for confirmation itself. Whether you're asked depends on your client's approval settings.
- Customer messages are untrusted input. Tool results include text your customers wrote, and that text can contain instructions aimed at the agent. Don't let an agent send messages or edit data because of something a message says without reading what each call does.
- Keep files that hold your key out of version control. The Cursor and VS Code files above contain your API key: add them to
.gitignore, or put the server in your client's user-level configuration. - Give the key the fewest scopes it needs, and delete it from Settings → Developers when you stop using it.
Limits
Tool calls use the same scopes, rate limits and checks as the REST API.
- Rate limits: a tool call counts against the key's read or write limit. See Rate limits.
- Retries:
messages_send,contacts_import,automations_createandtemplates_updateaccept an optionalidempotencyKeyargument.automations_importMedia,templates_createandtemplates_importHeaderMediarequire one. Reuse a value only when retrying the exact same call. See Idempotency. - Errors: a failed tool call comes back with the endpoint's error body. See Errors.
- Size: a request body is limited to 1 MB. Split large
contacts_importbatches.
Troubleshooting
| Symptom | Cause | What to do |
|---|---|---|
401 | The Authorization header is missing, or the key is invalid or deleted; for a connected app, the connection was disconnected, expired or stopped (see Managing a connection) | Send Authorization: Bearer YOUR_API_KEY_HERE with a valid key, or connect the app again |
403 on connect | The client sent an Origin header from another site (it runs inside a web page) | Use a desktop or command-line MCP client |
A tool result with insufficient_scope (403) | The key lacks the scope that tool needs | Add the scope with Edit access. For a connected app: disconnect it, then connect again and choose Full |
429 right after connecting | 20 failed authentication attempts in a minute from one IP | Fix the key, then wait the number of seconds in Retry-After |
429 while working (in a tool result, or HTTP 429 when connecting or listing tools) | The key reached its read, write or connection-handshake limit | Wait Retry-After seconds, then retry |
413 | The request is over 1 MB | Send smaller batches |
| A tool is missing from the list | The key doesn't have the tool's scope | Add the scope with Edit access, then reconnect. For a connected app: disconnect it, then connect again and choose Full |
403 feature_not_enabled | Your plan doesn't include the feature the tool needs (templates, AI, or the Flow Builder), or the add-on a comment or order automation needs is off | Check your plan in RabtCRM |
Next Step
Look up the arguments and responses of every tool.