Skip to main content
When you create a Corsair instance, every plugin exposes its API endpoints directly on the instance under a nested structure.
corsair.ts

API structure

All plugins follow the same pattern: corsair.[plugin].api.[resource].[action]().
example.ts

Strongly typed

Every API call is fully typed, both request parameters and responses. Your editor shows exactly what’s required and what you’ll get back.
example.ts

With multi-tenancy

When multi-tenancy is enabled, use withTenant() to scope operations.
example.ts
See Multi-Tenancy for details.

Automatic persistence

API responses are stored in your database automatically. Create foreign key relationships to Corsair resources, and they stay in sync through API calls and webhooks.
example.ts
See Database for the full ORM API.

Hooks

Add before/after hooks to customize API behavior.
corsair.ts