# LDM Developer API — UI = MCP

LDM is a multi-tenant CRM and outbound mailing platform that exposes ~120 capabilities to autonomous agents through plain HTTPS. There is no separate "agent API" mirror to keep in sync — the human web UI and Claude / Cursor / your custom MCP client hit the same `/api/*` routes, with HybridAuthGuard resolving either a session cookie or a Bearer key to the same handler. Issue a key, grant scopes, and the agent can do everything the UI can: search and create companies, contacts, leads; manage pipelines; run mailing campaigns and self-approve them; tune anti-spam guardrails; pull exports; subscribe to webhooks.

> **TL;DR for agents:** Base URL: `https://api.live-direct-marketing.online`. Sign up with `POST /v1/signup` → Bearer `ldm_pk_…`. Then either call `/api/*` directly, or install the [`ldm-crm-mcp`](https://www.npmjs.com/package/ldm-crm-mcp) MCP server in Claude Desktop / Cursor and let your agent use the tools.

## 60-second hello

```bash
# 1. Get a sandbox key
curl -X POST https://api.live-direct-marketing.online/v1/signup \
  -H "Content-Type: application/json" \
  -d '{"email":"you@example.com","org":"Your SaaS","use_case":"Automated CRM ops via MCP"}'

# 2. Hit any /api/* endpoint with that key
curl https://api.live-direct-marketing.online/api/companies?pageSize=5 \
  -H "Authorization: Bearer ldm_pk_..."

# 3. Discover the live capability list (~120 entries)
curl https://api.live-direct-marketing.online/.well-known/agent-card.json | jq .
```

## Plug into Claude Desktop / Cursor (MCP)

The whole API is also published as an MCP server — install the npm package and your agent gets ~30 tools (search/create companies/contacts/leads, manage pipelines, run mailings, anti-spam, AI generate, exports, webhooks).

```json
// claude_desktop_config.json
{
  "mcpServers": {
    "ldm-crm": {
      "command": "npx",
      "args": ["-y", "ldm-crm-mcp"],
      "env": { "LDM_API_KEY": "ldm_pk_..." }
    }
  }
}
```

## Endpoint map

- `POST /v1/signup` — issue a sandbox or full-account key. Public.
- `GET  /v1/me` — bearer-authenticated profile + quota.
- `GET  /v1/health` — service liveness.
- `GET  /.well-known/agent-card.json` — LDM discovery (custom format), lists every `/api/*` capability with its scope.
- `/api/*` — the unified surface (companies / contacts / leads / pipelines / dialogs / mailing / exports / webhooks / ai / suppression / files / …). Same routes the UI calls.

## Where to read next

- **Get started** → [Quickstart](/quickstart), [Authentication](/authentication), [Agent Card](/agent-card)
- **CRM** → [Companies & Contacts](/crm-companies), [Leads & Pipelines](/leads-pipeline), [Pipelines & Stages](/pipelines-stages), [Activities](/activities), [Tags & Saved Views](/tags-views), [Custom Fields](/custom-fields)
- **Dialogs / Mail** → [Dialogs](/dialogs), [Mailing Campaign](/mailing-flow), [Tasks (lifecycle)](/tasks-campaigns)
- **Content** → [Briefs & Creatives](/briefs-creatives), [Files](/files)
- **Compliance & integrations** → [Anti-spam](/anti-spam), [Webhooks](/webhooks), [AI keys](/ai-keys), [Connectors](/connectors), [Best send time](/best-send-time)
- **Reference** → [Limits](/limits), [Errors](/errors)
