Skip to main content
When you create a Corsair instance, every plugin exposes its API endpoints through a nested, intuitive structure. Each plugin’s API is accessible directly on the Corsair instance.
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 — 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