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“.

Create an account Log in

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 read
List the businesses (clients) in this account with their status.
list_conversations read
List recent conversations (leads) with channel, status, last message and whether the AI is paused. Use unanswered_only to find guests waiting for a reply.
client, status, unanswered_only, limit
get_conversation read
Full conversation of one lead: contact, answers, booking, and the last 60 messages/events.
lead_id
list_bookings read
Upcoming bookings that came in through connected booking systems (with guest, date, service, and whether the guest chatted with the AI first).
client, days_ahead
get_report read
This month's numbers per client: new leads, replies, bookings, bookings after an AI chat.
client
send_message write
Send a message to the guest on their channel (WhatsApp or Instagram). Only possible within 24 hours of the guest's last message (WhatsApp/Instagram rule). Sending pauses the AI for this conversation, because a human took over.
lead_id, text
set_ai write
Turn the automatic AI replies on or off for one conversation.
lead_id, on
set_status write
Set the pipeline status of a conversation.
lead_id, status
add_note write
Add an internal note to a conversation (not sent to the guest).
lead_id, text
get_setup_links write
One-click links for the account owner (valid 2 hours, they log the person straight in): setup assistant, connect WhatsApp number, connect calendar (Google/Outlook), lead sources, test on WhatsApp, plan & go live, expert setup. Use for every step that needs the person's own sign-in. Give each link only to the account owner.
client
request_expert_setup write
For people who are unsure or have no time: we (the Auftragspilot team) set everything up for them. Notifies the team and returns the link to book the expert setup and a link for a free call. Ask the person first.
note, phone
get_setup_status read
Start here. Setup checklist per client: WhatsApp number, calendar, business knowledge, who answers (built-in AI or your own agent), live status, plan. Returns next_steps in plain words.
client
get_business_brief read
The business knowledge the agent works with: company, services, prices/FAQ (one fact per line), audience, contact person, rules (no_gos).
client
update_business_brief write
Update the business knowledge (only the fields you pass). faq and no_gos: one fact/rule per line. A live built-in agent is rebuilt automatically (takes a few minutes).
client, firma, branche, beschreibung, leistungen, zielgruppe, region, ansprechpartner, website, faq, no_gos, agent_name
set_agent_mode write
Who answers incoming messages. "builtin" = the Auftragspilot AI agent (default). "own_agent" = your agent: the built-in AI stays silent, every message comes to you as an event/webhook and you reply with send_message. The first contact (start template) is still sent automatically.
client, mode
pause_all write
Emergency stop: no automatic replies or follow-ups for this client (or all clients). Messages are still logged. Undo with resume_all.
client
resume_all write
Undo pause_all.
client
list_events read
New chat messages as events (message.received = guest wrote, message.sent = business replied), oldest first, with a cursor. First call without 'after' returns the current cursor and the last events; then pass the returned next_after. wait_seconds (max 25) long-polls until something arrives. Prefer this over polling list_conversations.
after, wait_seconds, types, client, limit
create_webhook write
Get a signed POST to your https URL on every event (message.received, message.sent, lead.created). The secret is shown once: verify X-Auftragspilot-Signature (t=<unix>,v1=hex HMAC-SHA256 of "<t>.<raw body>").
url, events
list_webhooks read
Webhooks of this account with their last delivery status.
delete_webhook write
Delete a webhook.
webhook_id
test_webhook write
Send a signed test event to a webhook and return the HTTP status.
webhook_id
get_free_slots read
Free appointment times in the client's calendar (its local time zone).
client, date_from, days
book_appointment write
Book an appointment for a conversation at a free time from get_free_slots (ISO start, e.g. 2026-11-24T10:00:00+01:00). The guest gets the usual WhatsApp confirmation and reminders.
lead_id, start
start_conversation write
Start a WhatsApp conversation with a new contact who agreed to be contacted (e.g. filled a form). Sends the approved start template; the conversation then shows up in list_conversations. Only for live clients.
client, phone, name, email, consent
get_usage read
Current plan, billing period and usage so far (units and usage cost).
wait_for_events read
Waits up to 25 s for new messages/events and returns them (use instead of polling list calls). Pass next_after from the previous call.
after, client, types
list_templates read
Approved WhatsApp templates known for a client (start template and follow-up templates). Only templates can reach people outside the 24-hour window.
client
send_template write
Sends an approved WhatsApp template to one lead (works outside the 24-hour window). Lead must not have opted out.
lead_id, template_name, language, parameters, idempotency_key
schedule_message write
Schedules a text (needs an open 24-hour window at send time) or a template to one lead, up to 90 days ahead. send_at ISO time.
lead_id, send_at, text, template_name, language, parameters, idempotency_key
list_scheduled read
Scheduled messages, approvals and broadcast/sequence items that are still open.
status, limit
cancel_scheduled write
Cancels a scheduled message or open approval.
id
list_approvals read
Messages prepared by draft keys that wait for the owner's approval.
approve write
Owner only (write key or app): releases a prepared message.
id
reject write
Owner only: discards a prepared message.
id, reason
create_broadcast write
Prepares a template broadcast to leads of one client (max 1000). Filter by status and/or created_after, or pass lead_ids. Nothing is sent until send_broadcast.
client, name, template_name, language, parameters, lead_ids, status, created_after
send_broadcast write
Owner only. Starts a prepared broadcast: needs confirm=true and consent_confirmed=true (all recipients agreed to be contacted). Sent at 30 per minute, 08:00-20:00, opted-out leads are skipped. send_at optional.
broadcast_id, confirm, consent_confirmed, send_at
get_broadcast read
Status and counts of a broadcast (or list all when broadcast_id is empty).
broadcast_id
create_sequence write
Creates a follow-up sequence (max 6 steps, each after_hours >= 1 since the previous step, text or template). Stops automatically when the lead replies or opts out.
client, name, steps
list_sequences read
Sequences of the account.
enroll_in_sequence write
Puts leads into a sequence (max 200 per call).
sequence_id, lead_ids
stop_sequence write
Stops a sequence for one lead, or for everyone when lead_id is empty.
sequence_id, lead_id
hand_to_person write
Hands a conversation to a human: the built-in AI pauses and agents can no longer send there (HANDED_OVER) until hand_back_to_agent.
lead_id, note
hand_back_to_agent write
Gives a handed-over conversation back to the agents (and optionally resumes the built-in AI).
lead_id, resume_ai
start_setup_test write
Setup test: sends the client's first WhatsApp to the person's OWN phone (ask for it first). Then poll check_setup_test.
client, phone, name
check_setup_test read
Result of a setup test: message sent, reply received, what is still missing.
test_id