Auftragspilot API & MCP
Connect your own AI agent (Claude Code, Muse, Grok Bot, Dots, ChatGPT, Cursor, n8n, your own server) to your WhatsApp and Instagram conversations, calendar and CRM. Official WhatsApp Business API, no linked-device hacks, no ban risk. Deutsch: Gleiche Funktionen, Anleitung im Portal unter „Eigener KI-Agent“.
1. Access key
In the portal: Own AI agent → Create an access key. Keys start with ap_, are shown once and are scoped to your account. Scope read or read and reply. Send it as Authorization: Bearer ap_….
2. MCP server
Streamable HTTP, stateless, protocol 2025-06-18 (also 2025-03-26, 2024-11-05). URL: https://app.larsomatic.org/api/mcp
# Claude Code
claude mcp add --transport http auftragspilot https://app.larsomatic.org/api/mcp --header "Authorization: Bearer ap_…"
# Muse (Meta), Grok Bot (xAI), ChatGPT Dots, claude.ai / Claude Desktop / ChatGPT connectors (no custom headers): key in the URL, treat it like a password
https://app.larsomatic.org/api/mcp/k/ap_…
# Cursor ~/.cursor/mcp.json
{ "mcpServers": { "auftragspilot": { "url": "https://app.larsomatic.org/api/mcp", "headers": { "Authorization": "Bearer ap_…" } } } }First call for a new agent: get_setup_status. It lists what is missing (WhatsApp number, calendar, knowledge, plan) in plain words.
3. REST API
Every tool is also POST https://app.larsomatic.org/api/v1/<tool> with the arguments as JSON (read tools also via GET with query parameters). Response { data } or { error: { code, message } }. OpenAPI 3.1: /api/v1/openapi.json (import it into a Custom GPT action, n8n or Make).
curl -X POST https://app.larsomatic.org/api/v1/send_message \
-H "Authorization: Bearer ap_…" -H "Content-Type: application/json" \
-d '{"lead_id": "…", "text": "Hi Anna, yes, Saturday 3 pm works. Shall I book it?"}'4. Who answers
builtin (default): the Auftragspilot AI replies, qualifies and books; your agent can read along and step in (sending pauses the AI for that conversation). own_agent: the built-in AI stays silent, every incoming message reaches you as an event, you answer with send_message and book with get_free_slots + book_appointment. Switch with set_agent_mode or in the portal. pause_all is the emergency stop.
5. Events & webhooks
Event types: message.received, message.sent, lead.created. Poll with list_events / GET /api/v1/events?after=<cursor>&wait_seconds=25 (long-poll), or register a webhook with create_webhook (or in the portal). Webhook calls are POSTs with JSON and the header X-Auftragspilot-Signature: t=<unix>,v1=<hex>; HTTPS only, 8 s timeout, disabled after 50 failures in a row.
{
"id": "18233",
"type": "message.received",
"created_at": "2026-11-20T09:14:03.120Z",
"data": { "lead_id": "6f0c…", "client": "ocean-spa", "channel": "whatsapp", "name": "Anna", "phone": "+491701234567", "text": "Do you have time on Saturday?" }
}import crypto from "node:crypto";
// Express/Next: use the RAW request body
function verify(rawBody, header, secret) {
const parts = Object.fromEntries(header.split(",").map((p) => p.split("=")));
if (Math.abs(Date.now() / 1000 - Number(parts.t)) > 300) return false; // replay guard
const expected = crypto.createHmac("sha256", secret).update(parts.t + "." + rawBody).digest("hex");
return (parts.v1 || "").length === expected.length && crypto.timingSafeEqual(Buffer.from(expected), Buffer.from(parts.v1));
}6. Rules & limits
- WhatsApp/Instagram 24-hour rule: free-text replies only within 24 h of the guest's last message. To contact someone new, use
start_conversation(approved template, the person must have agreed to be contacted). - 600 requests per hour per key, 60 new conversations per hour per account, at most 10 keys and 10 webhooks.
- Keys only see their own account. Delete a key in the portal to revoke it instantly.
7. Tools
list_clients readlist_conversations readget_conversation readlist_bookings readget_report readsend_message writeset_ai writeset_status writeadd_note writeget_setup_links writerequest_expert_setup writeget_setup_status readget_business_brief readupdate_business_brief writeset_agent_mode writepause_all writeresume_all writelist_events readcreate_webhook writelist_webhooks readdelete_webhook writetest_webhook writeget_free_slots readbook_appointment writestart_conversation writeget_usage readwait_for_events readlist_templates readsend_template writeschedule_message writelist_scheduled readcancel_scheduled writelist_approvals readapprove writereject writecreate_broadcast writesend_broadcast writeget_broadcast readcreate_sequence writelist_sequences readenroll_in_sequence writestop_sequence writehand_to_person writehand_back_to_agent writestart_setup_test writecheck_setup_test read