Skip to content

Guides

My own AI and my backend, talking to my data

If you got here, you’ve probably already seen the MCP server and the API reference separately. They’re two faces of the same /public/v1 surface — this page is the bridge that connects them, for the real case of “I want my own AI assistant (Claude, Cursor) talking to my Aymar Agents data, AND my own backend calling the public API directly”.

The MCP server has no logic of its own: its tools are generated by reading the same OpenAPI definition that documents this REST reference, and every tool call forwards your own API key to /public/v1, as is. All the real control — permissions, plan, limits, per-account isolation — is applied by the API, never by the MCP adapter. That’s why: one key, one set of scopes, two ways to use them.

  1. Create an API key with the scopes both uses need. See API keys — it’s shown in full only once, save it. If your AI assistant only needs to read leads and your backend also needs to create tickets, give the key both scopes: tenant:leads.read and tenant:tickets.manage, for example — the same key serves both uses at once.
  2. Connect your AI assistant via MCP with that key — Claude Desktop, Claude Code or Cursor speak Streamable HTTP at https://mcp.aymaragents.com/mcp with the X-Api-Key header. See Connect your assistant. From there, your assistant can read and (with your confirmation, see Confirmation on writes) write to your account during the conversation.
  3. Connect your backend directly to the public API, with the same key, in the X-API-Key header of every HTTP request — no MCP in between, for code that runs without a human supervising turn by turn. See the 5 use cases with code examples.
PathWhat it’s forConfirmation
MCP (https://mcp.aymaragents.com/mcp)Your conversational assistant (Claude, Cursor) explores and acts on your account inside a session with a person present.Every write requires confirm: true — built so the person sees the action’s summary before approving it.
Public API (https://api.aymaragents.com/public/v1)Your own backend, a scheduled script, or an integration with another system (CRM, helpdesk, Zapier…) running without turn-by-turn supervision.No confirmation step in between — your code decides and executes directly.

A real example using both at once: your Claude Code assistant, connected via MCP, looks up and qualifies leads while you talk to it; your own backend, with the same key but through the direct API, syncs those same leads to your CRM every hour without anyone watching — see Sync leads to your own CRM.