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

# Rentman plugin

> Rental and event production with Rentman - read and write contacts, projects, equipment, crew, appointments and invoices through the Rentman public API, with field projection, linked-item expansion and cursor paging.

Use **Rentman** through Corsair: one client, typed API calls.

Generate a token in Rentman under **Settings → Configuration → Account → Integrations**, in the **API** field. Send it as `Authorization: Bearer <token>`. Things to know before you call:

* **Only the newest token works.** Rentman keeps a single valid JWT per account, so clicking **Regenerate token** invalidates every integration already using the old one. A superseded token is refused by the gateway with `403`, which the plugin reports as an auth failure rather than a missing record.
* **Every list is a cursor walk.** A collection answers `{ data, itemCount, limit, next_page_url }`, and `next_page_url` carries an opaque `cursor`. The plugin returns both `next_cursor` and `next_page_url`: pass the cursor back unchanged, because Rentman warns that it must not be built or edited. The cursor is null on the last page.
* **Page size.** `limit` defaults to 300 and caps at 1500. The limit is carried into later pages by the cursor, so it only has to be set on the first request.
* **Filters are `field[operator]`.** Rentman reads a filter as a key such as `distance[lte]`, with the operators `eq`, `lt`, `gt`, `lte`, `gte` and `neq`. Each list models the operators its fields accept, so an unsupported one is rejected before the request rather than silently ignored. Rentman answers `400` to a filter on a field the resource does not have.
* **Projects take no customer through the API.** Rentman answers `400` ("not permitted to set the following field: customer") to a project write that names one, so `projects.create` and `projects.update` leave the customer to the Rentman app.
* **Contacts keep two emails and two phones** (`email_1`, `email_2`, `phone_1`, `phone_2`). The plugin's `email` and `phone` inputs write the first of each. A contact `type` is `company` or `private`, and country codes are lowercase (`nl`).
* **Linked items are paths by default.** A `customer` or `project` field comes back as `/contacts/12` unless you pass `expand`, which inlines the object. Nested expansions use dot notation and go three levels deep at most. `fields` projects the response, and a nested `fields` path must have a matching `expand`.
* **Equipment has no `active` flag.** Availability is `in_shop`, `in_planner` and `in_archive`, and the list filter is `in_shop`.
* **Contact addresses are nested in, flat out.** A contact carries three addresses, and the plugin takes each as an object under `mailing_address`, `visit_address` and `invoice_address`, then folds the prefix into the field names the API expects.
* **Contact deletes are permanent.** `contacts.delete` has no undo and is marked destructive.
* **Rate limits.** Rentman allows 10 requests a second, 20 at once and 50,000 a day, and sends no `Retry-After`, so a 429 is retried three times with exponential backoff. `500` and `502` are retried only for reads: a create that failed may already have written its record.

**What you get:**

* 19 typed API operations

## Setup

**1. Install**

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

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

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

```bash bun theme={null}
bun add corsair @corsair-dev/rentman 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 { rentman } from '@corsair-dev/rentman';

export const corsair = createCorsair({
	plugins: [
		rentman(),
	],
	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)
>
> No setup required yet. When you make your first request as a tenant, Corsair prompts for the API key.
>
> ```ts theme={null}
> rentman()
> ```
>
> 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: 'rentman',
	tenantId: 'acme',
});
// redirect the user's browser to connectUrl
```

## Example API calls

**List contacts in one country**

```ts theme={null}
const tenant = corsair.withTenant('acme');
await tenant.rentman.api.contacts.list({ country: 'nl', limit: 100, sort: '+displayname' });
```

**Create a company contact**

```ts theme={null}
const tenant = corsair.withTenant('acme');
await tenant.rentman.api.contacts.create({
	name: 'Acme Inc',
	country: 'nl',
	mailing_address: {
		street: 'Damrak',
		number: '1',
		city: 'Amsterdam',
		postalcode: '1012 LG',
	},
});
```

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

## What's next

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

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