- Uploads accept a URL or base64.
files.uploadtakes an https URL ImageKit fetches, or base64-encoded content. It is exempt from rate limits but the largest payloads take a while, so the client allows 120 seconds. - Deletes are permanent.
files.delete,files.bulkDelete,fileVersions.deleteandfolders.deletecannot be undone; ImageKit keeps no trash. Version restore works only while the version still exists. - Bulk calls can partly succeed. The three bulk tag calls cap at 50 files per request;
files.bulkDeleteand the bulk tag calls answer 207 with per-file errors when some targets failed, which this plugin parses as a result, not as a thrown error. - Folder operations run as jobs.
folders.copy,folders.moveandfolders.renameanswer ajobIdat once; pollfolders.getJobStatusuntil status isCompleted.cache.purgedoes the same with arequestIdandcache.getPurgeStatus. - Rate limits. Every endpoint except upload is rate limited per account; a 429 carries
X-RateLimit-Resetin milliseconds. The plugin retries 429s up to three times with backoff starting at one second. - Paging.
files.listpages withlimit(up to 1000) andskip; there is no cursor, so pages past a concurrent change can overlap. - Search.
files.listnarrows with asearchQueryexpression over name, tags, type, size and createdAt, e.g.name = "summer" AND tags IN ["sale"]. In a query,typeisfile,file-versionorfolder; to keep only images, also passfileType: 'image'.
- 26 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
List files in a folderWhat’s next
API reference
Every
imagekit.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.