# Mochi API: the Instagram, WhatsApp and Messenger DM sales CRM API

> The Mochi Public API lets software read and update a Mochi workspace: leads, signals, bookings, analytics, revenue, team, automations, tracking links, content and integrations. Mochi is a DM sales CRM for teams that sell through Instagram, WhatsApp and Messenger. Use the API when software should do the work unattended (CRM sync, custom dashboards, event-driven updates). Use Mochi MCP (https://themochi.app/mcp.md) when a person wants answers in Claude, ChatGPT or another AI agent.

- Page: https://themochi.app/api
- Base URL: https://api.themochi.app (versioned paths under /v1/, JSON in and out)
- OpenAPI contract: https://themochi.app/docs/api/openapi.json
- Docs index for agents: https://themochi.app/docs/llms.txt
- Quickstart: https://themochi.app/docs/api/start-here/getting-started
- API reference: https://themochi.app/docs/api/reference
- Agent skill: `npx skills add TheMochiApp/mochi-cli --skill mochi-api`

## Access

The API is in a controlled pilot. Mochi enables it per workspace; then Settings → Developers lets an admin create API keys. A docs link or direct URL does not grant access.

## Authentication

- Server, scheduled job or CI: API key sent as `Authorization: Bearer <key>`. One key belongs to one workspace.
- Trusted local computer with a person present: Mochi CLI with browser OAuth (`mochi auth login`).
- Third-party browser app: registered OAuth application.
- An AI tool already connected through MCP: keep using MCP. Never export or convert an MCP token for API use.

Agents must never ask for, read, paste, print or store a Mochi credential.

## Permissions (scopes)

Read: `leads:read`, `signals:read`, `analytics:read`, `bookings:read`, `revenue:read`, `config:read`, `team:read`.
Write: `leads:write`, `messages:send` (schedule approved follow-ups only), `automations:write`, `links:write`, `config:write`, `content:write`, `connections:write`, `team:write`.
Start with `leads:read`. Scopes never bypass member roles, provider approval or messaging safety rules.

## Limits and behaviour

- 120 read and 60 write requests per minute per key; 60,000 requests per day per workspace. `429` responses include `Retry-After`.
- Lists use cursor pagination: `data` plus `next_cursor`.
- Every write requires an `Idempotency-Key` header (UUID4). A retry with the same key replays the original response for 24 hours instead of applying the change twice.
- Responses include `X-Request-ID`; keep it for troubleshooting and support.

## Endpoints (62, from the OpenAPI contract)

- **Analytics:** `GET /v1/analytics/benchmarks/`, `GET /v1/analytics/funnel/`, `GET /v1/analytics/links/`, `GET /v1/analytics/messages/`, `GET /v1/analytics/reply-rate/`, `GET /v1/analytics/response-times/`, `GET /v1/analytics/team/`
- **Automations:** `GET /v1/automations/definitions/`, `POST /v1/automations/definitions/`, `GET /v1/automations/definitions/assets/`, `GET /v1/automations/definitions/capabilities/`, `POST /v1/automations/definitions/validate/`, `GET /v1/automations/definitions/{automation_id}/`, `PUT /v1/automations/definitions/{automation_id}/`, `POST /v1/automations/keyword/`
- **Bookings:** `GET /v1/bookings/`
- **Configuration:** `GET /v1/config/funnels/`, `PUT /v1/config/prompts/tags/{tag_id}/`, `PUT /v1/config/prompts/{prompt_kind}/`, `GET /v1/config/tags/`
- **Integrations:** `GET /v1/connections/`, `POST /v1/connections/`, `DELETE /v1/connections/ablefy/`, `POST /v1/connections/ablefy/`, `POST /v1/connections/elevenlabs/`, `DELETE /v1/connections/fanbasis/`, `POST /v1/connections/fanbasis/`, `DELETE /v1/connections/iclosed/`, `POST /v1/connections/iclosed/`, `DELETE /v1/connections/stripe/`, `POST /v1/connections/stripe/`, `DELETE /v1/connections/whop/`, `POST /v1/connections/whop/`
- **Content Hub:** `POST /v1/content/`, `DELETE /v1/content/{content_item_id}/`, `PATCH /v1/content/{content_item_id}/`
- **Flows:** `GET /v1/flows/`, `POST /v1/flows/`, `GET /v1/flows/runs/{run_id}/`, `GET /v1/flows/{flow_id}/`, `POST /v1/flows/{flow_id}/runs/`
- **Leads:** `GET /v1/leads/`, `POST /v1/leads/bulk/tags/`, `GET /v1/leads/{lead_id}/`, `PATCH /v1/leads/{lead_id}/`, `PUT /v1/leads/{lead_id}/assignment/`, `PATCH /v1/leads/{lead_id}/contact/`, `POST /v1/leads/{lead_id}/follow-ups/`, `GET /v1/leads/{lead_id}/intelligence/`, `GET /v1/leads/{lead_id}/signals/`, `POST /v1/leads/{lead_id}/tags/`, `DELETE /v1/leads/{lead_id}/tags/{tag_id}/`
- **Tracking links:** `POST /v1/links/`
- **Media:** `POST /v1/media/`
- **Revenue:** `GET /v1/revenue/manual/`, `GET /v1/revenue/summary/`, `GET /v1/revenue/transactions/`
- **Send policy:** `GET /v1/send-policy/`
- **Signals:** `GET /v1/signals/`
- **Team:** `POST /v1/team/invites/`, `GET /v1/team/members/`, `POST /v1/team/members/{member_id}/deactivate/`

## What teams build with it

### Dashboards (read scopes)

- **Your pipeline on any screen** (like Mochi's Home dashboard): See how many leads sit at every stage, and how many move on, in Looker, Sheets or on the office TV.
- **A team leaderboard that posts itself** (like Mochi's Performance dashboard): Messages sent, reply rates and response times per setter, dropped into Slack every morning.
- **Revenue next to the rest of your finances** (like Mochi's Payments dashboard): Every payment from Stripe, Whop, Commas and Ablefy, plus deals logged by hand, in your finance sheet.
- **Attribution for every launch** (like Mochi's Link analytics): Which links, posts and campaigns turned DMs into clicks, joined with your ad spend.
- **Show-rate and capacity reports** (like Mochi's Booked calls): Every booked call in one feed, so you can plan closer capacity and chase no-shows.
- **Your leads in your CRM** (like Mochi's Leads & lead profiles): Keep HubSpot, Salesforce, Airtable or your warehouse in sync with every lead, tag and stage.

### Workflows (write scopes)

- **Close the loop on payments** (Lead stages & tags): When your checkout fires, the lead moves to Won and gets the right tag. No one updates it by hand.
- **Route leads automatically** (Assignment): Assign new leads to whoever is on shift, based on your own rules or roster.
- **Follow up when it matters** (Follow-ups): Schedule an approved follow-up after a missed call, straight from your call tool.
- **Automations for every launch** (Automations): Create the comment-keyword automation for each new post from your content calendar.
- **Keep your AI Setter current** (AI Setter): Push this month's offer, pricing and objection answers to the AI from wherever you write them.
- **Onboard a workspace in minutes** (Integrations & team): Connect payment and booking tools and invite the team from one script, for every client you manage.

## API or MCP?

| | Mochi API | Mochi MCP |
| --- | --- | --- |
| Used by | Software: scripts, servers, scheduled jobs | People chatting with Claude, ChatGPT or another AI agent |
| Code needed | Yes, or a no-code tool that makes HTTP requests | No |
| Results | Exact, structured JSON | Answers, summaries and suggestions |
| Runs | Unattended, on a schedule or event | When someone asks |
| Address | https://api.themochi.app | https://mcp.themochi.app/mcp |

## FAQ

### What is the Mochi API?

It's a way for your other software to talk to Mochi. Your CRM, spreadsheets, BI tools and internal apps can read your leads, bookings, revenue and team numbers, and trigger things like lead updates, follow-ups and automations.

### Do I need a developer?

Usually, yes, or a no-code tool that can make web requests. If you'd rather not write any code, Mochi MCP lets you ask questions and take quick actions by chatting with Claude or ChatGPT instead, and our Zapier app connects Mochi to 6,000+ tools.

### Should I use the API or MCP?

Use MCP when a person wants answers or quick actions in their AI tool. Use the API when software should do the work on its own, like syncing your CRM every night or updating a lead when a payment lands. Many teams use both.

### How do I get access?

The API is in a controlled pilot. Ask your Mochi contact to enable your workspace, and a Developers page appears in Settings where you can create keys.

### Is it safe to try?

Yes. Each key only works for your workspace and only does what you allow. Start with a read-only key: it can look at your data but can't change anything or message anyone. You can revoke a key at any time.

### Where are the technical details?

Everything else, from authentication and permissions to every endpoint and code examples in several languages, is in the API docs.
