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. Acodeother than"0"is a failure, and the plugin throws aLeigaAPIErrorcarrying that code rather than returning an empty result.15means Leiga refused the access token,18a rejected client id,100a missing required field. On a15the plugin exchanges the pair for a new token and repeats the call once before it throws. - Ids are numbers, timestamps are epoch milliseconds.
createTimeandupdateTimeare 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.nextStatesandtags.listtake their filter or project id in a JSON body, not a query string. issues.listis the only paged operation. It takespageNumberandpageSizeand 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.
statusTypesonissues.listfilters by phase rather than by step name:2not started,3in progress,4done.
- 15 typed API operations
Setup
1
Install
2
Add the plugin
corsair.ts
multiTenancy: true, scope calls with corsair.withTenant(id). See Quick start for KEK + Hub keys, and Multi-tenancy for account isolation.3
Choose authentication
- API Key (Recommended)
No setup required yet. When you make your first request as a tenant, Corsair prompts for the API key.More: 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.
Example API calls
Query the open issues in a projectWhat’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.