Skip to main content
Use Leiga through Corsair: one client, typed API calls. Leiga authenticates in two steps. Create a client pair under Settings, OpenAPI in Leiga (https://guide.leiga.com/settings/openapi), then store its Client ID as client_id and its Secret Key as api_key. The plugin exchanges the pair for an access token, sends it in an accessToken header and keeps it until it expires, so you never handle the token yourself. A token is only used with the pair that created it: store a different pair and the next call exchanges it for a new token. Things to know before you call:
  • Every error is HTTP 200. Leiga reports failures as { "code": "...", "msg": "..." } with a 200 status. A code other than "0" is a failure, and the plugin throws a LeigaAPIError carrying that code rather than returning an empty result. 15 means Leiga refused the access token, 18 a rejected client id, 100 a missing required field. On a 15 the plugin exchanges the pair for a new token and repeats the call once before it throws.
  • Ids are numbers, timestamps are epoch milliseconds. createTime and updateTime are milliseconds since 1970, not ISO strings, and a project id is a number rather than a string.
  • Some lists are POSTs. issues.list, sprints.list, workflows.list, workflows.nextStates and tags.list take their filter or project id in a JSON body, not a query string.
  • issues.list is the only paged operation. It takes pageNumber and pageSize and returns { issues, total }. Every other list returns all of its records at once under a named key, such as { projects }, { sprints } or { tags }.
  • Status types. statusTypes on issues.list filters by phase rather than by step name: 2 not started, 3 in progress, 4 done.
What you get:
  • 15 typed API operations

Setup

1

Install

2

Add the plugin

corsair.ts
With multiTenancy: true, scope calls with corsair.withTenant(id). See Quick start for KEK + Hub keys, and Multi-tenancy for account isolation.
3

Choose authentication

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.

Example API calls

Query the open issues in a project
Read one project by id
See the full list on the API page.

What’s next

API reference

Every leiga.api.* operation with input and output types.

Connect / OAuth

createLink, Hub delivery, and tenant connect flows.

Use with agents

Expose this plugin’s operations as MCP tools.