> ## Documentation Index
> Fetch the complete documentation index at: https://docs.corsair.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# noCRM plugin

> noCRM.io leads, pipeline steps, client folders, comments, attachments, prospecting lists and prospects, users, teams, post-sales tasks and webhooks, plus the one-call lead actions of noCRM's simplified API.

Use **noCRM** through Corsair: one client, typed API calls, local DB sync, and incoming webhooks.

Create a key under Admin panel → Integrations → API & automations → API Keys; noCRM shows it once. Connect with the key and the account subdomain (the \<subdomain> in https\://\<subdomain>.nocrm.io; a full URL works too). The key goes in the X-API-KEY header and acts with admin rights: a lead created without userId is unassigned. A trial account allows 2,000 requests a day. A 429 is not retried, since it can mean the day's quota is used up; the error carries retryAfter from API-RETRY-AFTER.

Four routes are for registered noCRM partner integrations only and need the partnerKey option (sent as X-API-PARTNER-KEY): calls.listContacts, emailSignatures.set, leads.logCall and prospects.logCall (both call routes are deprecated by noCRM). The simplified API routes (leads.markWon, leads.assignRoundRobin, ...) change data even though noCRM serves them as GET.

Webhooks: noCRM POSTs \{"webhook\_event": \{...}} and signs it with SHA-1 of the webhook event id followed by the API key chosen for the webhook (checked live; the reference says the object id). The plugin verifies that with the connection's key and hands the handler the unwrapped event.

Not covered: login, logout and log\_as (user-token sessions) and partner key activation. The database keeps leads (id, title, status, step, amount, currency, owner and client folder ids), client folders (id, name, active), prospecting lists (id, title, owner id), teams (id, name, member count) and users (id, admin, activated). Lead descriptions, contact emails, phone numbers, people's names and comments are not stored. Webhook hooks see the body as delivered (\{"webhook\_event": \{...}}); the handler returns the unwrapped event.

**What you get:**

* 93 typed API operations
* 5 synced entities (`clientFolders`, `leads`, `prospectingLists`, `teams`, `users`) for fast `.search()` / `.list()`
* 28 incoming webhook event types

## Setup

**1. Install**

```bash npm theme={null}
npm install corsair @corsair-dev/nocrm better-sqlite3
npm install --save-dev @types/better-sqlite3
```

```bash yarn theme={null}
yarn add corsair @corsair-dev/nocrm better-sqlite3
yarn add --dev @types/better-sqlite3
```

```bash pnpm theme={null}
pnpm install corsair @corsair-dev/nocrm better-sqlite3
pnpm install --save-dev @types/better-sqlite3
```

```bash bun theme={null}
bun add corsair @corsair-dev/nocrm better-sqlite3
bun add --dev @types/better-sqlite3
```

**2. Add the plugin**

```ts corsair.ts theme={null}
import Database from 'better-sqlite3';
import { createCorsair } from 'corsair';
import { nocrm } from '@corsair-dev/nocrm';

export const corsair = createCorsair({
	plugins: [
		nocrm(),
	],
	database: new Database('corsair.db'),
	kek: process.env.CORSAIR_KEK!,
	multiTenancy: true,
	hub: {
		projectApiKey: process.env.CORSAIR_API_KEY!,
		signingSecret: process.env.CORSAIR_SIGNING_SECRET!,
	},
});
```

With `multiTenancy: true`, scope calls with `corsair.withTenant(id)`. See [Quick start](https://docs.corsair.dev/quick-start.md) for KEK + Hub keys, and [Multi-tenancy](https://docs.corsair.dev/concepts/multi-tenancy.md) for account isolation.

**3. Choose authentication**

> [tab] API Key (Recommended)
>
> Store the noCRM API key before the first call: `pnpm corsair setup --plugin=nocrm --tenant=acme api_key=<your-key>` (leave out `--tenant` without `multiTenancy`), or pass it as `key` in the plugin options. With Hub, each tenant enters their own key on the connect page. See [API key auth](https://docs.corsair.dev/concepts/api-key).
>
> ```ts theme={null}
> nocrm()
> ```
>
> More: [API Key](https://docs.corsair.dev/concepts/api-key)

**4. Connect a tenant**

Mint a connect link and send the tenant to it. Hub hosts the page and delivers the result to your app — see [Connect / OAuth](https://docs.corsair.dev/management/connect).

```ts theme={null}
const { connectUrl } = await corsair.manage.connect.createLink({
	plugin: 'nocrm',
	tenantId: 'acme',
});
// redirect the user's browser to connectUrl
```

## Example API calls

**Leads in to-do or standby with a tag**

```ts theme={null}
const tenant = corsair.withTenant('acme');
await tenant.nocrm.api.leads.list({
	status: ['todo', 'standby'],
	tags: ['prospect'],
	limit: 50,
});
```

**Create a lead and assign it**

```ts theme={null}
const tenant = corsair.withTenant('acme');
await tenant.nocrm.api.leads.create({
	title: 'Acme Corp',
	description: 'Contact: Jane Doe\nEmail: jane@acme.example',
	userId: 'sales@yourcompany.example',
	tags: ['inbound'],
});
```

See the full list on the [API](https://docs.corsair.dev/plugins/nocrm/api.md) page.

## Query synced data

Synced entities support `tenant.nocrm.db.<entity>.search()` and `.list()`: `clientFolders`, `leads`, `prospectingLists`, `teams`, `users`.

See [Database](https://docs.corsair.dev/plugins/nocrm/database.md) for filters and operators.

## Webhooks

This plugin registers **28** webhook event types. Configure the provider to POST to your Corsair HTTP handler, then use `webhookHooks` on the plugin factory.

See [Webhooks](https://docs.corsair.dev/plugins/nocrm/webhooks.md) for every event path and payload shape, and [Webhooks concept](https://docs.corsair.dev/concepts/webhooks.md) for routing.

## What's next

> [card] [API reference](https://docs.corsair.dev/plugins/nocrm/api.md)
>
> Every `nocrm.api.*` operation with input and output types.

> [card] [Database](https://docs.corsair.dev/plugins/nocrm/database.md)
>
> Synced entities, search filters, and operators.

> [card] [Webhooks](https://docs.corsair.dev/plugins/nocrm/webhooks.md)
>
> Event paths, payloads, and `webhookHooks` examples.

> [card] [Connect / OAuth](https://docs.corsair.dev/management/connect)
>
> createLink, Hub delivery, and tenant connect flows.

> [card] [Use with agents](https://docs.corsair.dev/mcp-adapters/mcp-adapters)
>
> Expose this plugin's operations as MCP tools.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.