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

# OneDesk plugin

> Help desk and project management in one platform, with a public API over tickets, tasks, projects, timesheets, invoices, quotes and customer conversations.

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

OneDesk merges help desk and project management, so one account holds
tickets, tasks, projects, timesheets and invoices together.

Two things shape this plugin. First, OneDesk has no single "list" endpoint:
each resource is queried through a POST filter body, and the details variant
is what returns full records rather than ids. Second, a failure can arrive
with **HTTP 200** and a `code` of `ERROR_*`, so the plugin treats that as a
failed call rather than returning it as data.

Item and user writes need names the organization defines. Read them first
with `organization.itemTypes`, `organization.userTypes` and
`organization.lifecycleStatus`. `items.filter` takes `itemType` as an array;
a bare string is rejected.

A white-label or self-hosted account sets the `host` option; it defaults to
[https://app.onedesk.com](https://app.onedesk.com).

The public API needs a OneDesk **enterprise** account, and each API key
consumes one user license.

**What you get:**

* 79 typed API operations

## Setup

**1. Install**

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

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

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

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

export const corsair = createCorsair({
	plugins: [
		onedesk(),
	],
	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}
> onedesk()
> ```
>
> 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: 'onedesk',
	tenantId: 'acme',
});
// redirect the user's browser to connectUrl
```

## Example API calls

**List work items with their details**

```ts theme={null}
const tenant = corsair.withTenant('acme');
await tenant.onedesk.api.items.filterDetails({
	itemType: ['Problem'],
	limit: 10,
});
```

**Create a ticket**

```ts theme={null}
const tenant = corsair.withTenant('acme');
await tenant.onedesk.api.items.create({ name: 'The blue button does not work', type: 'Ticket' });
```

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

## What's next

> [card] [API reference](https://docs.corsair.dev/plugins/onedesk/api.md)
>
> Every `onedesk.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.